Skip to content

cli: support BOA_TRACE env flag for VM trace mode#4982

Closed
Flamki wants to merge 1 commit intoboa-dev:mainfrom
Flamki:feat/observability-4937-env-trace
Closed

cli: support BOA_TRACE env flag for VM trace mode#4982
Flamki wants to merge 1 commit intoboa-dev:mainfrom
Flamki:feat/observability-4937-env-trace

Conversation

@Flamki
Copy link
Copy Markdown
Contributor

@Flamki Flamki commented Mar 10, 2026

Summary

This is a minimal, first-step observability improvement for #4937.

It adds an opt-in environment toggle for existing VM trace output so tracing can be enabled in non-interactive workflows (scripts/CI/wrappers) without changing source code.

Changes

  • CLI: add BOA_TRACE support in addition to --trace.
  • Accept strict boolean-like values for BOA_TRACE:
    • truthy: 1, true, yes, on
    • falsy: 0, false, no, off
  • Error clearly on invalid/non-UTF8 BOA_TRACE values.
  • Keep precedence deterministic: --trace overrides BOA_TRACE.
  • Add focused unit tests for env var parsing.
  • Update docs/debugging.md with usage examples and value rules.

Scope

  • Intentionally narrow: CLI + docs only.
  • No VM core tracing redesign in this PR.
  • No metrics subsystem introduced yet.

Validation

  • cargo fmt --all -- --check
  • cargo test -p boa_cli tests::parse_bool_env_var -- --nocapture
  • cargo clippy -p boa_cli --all-targets --no-deps -- -D warnings

Partially addresses #4937.

@Flamki Flamki requested a review from a team as a code owner March 10, 2026 04:56
@github-actions
Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 49,713 49,713 0
Ignored 2,262 2,262 0
Failed 988 988 0
Panics 0 0 0
Conformance 93.86% 93.86% 0.00%

Tested main commit: dc02d4f354ac278dd845f529a3331001c4ea0ede
Tested PR commit: 34ec2da1c6640330b9e2e573ca152e8e4778e738
Compare commits: dc02d4f...34ec2da

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.35%. Comparing base (6ddc2b4) to head (34ec2da).
⚠️ Report is 830 commits behind head on main.

Files with missing lines Patch % Lines
cli/src/main.rs 55.55% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4982       +/-   ##
===========================================
+ Coverage   47.24%   58.35%   +11.11%     
===========================================
  Files         476      556       +80     
  Lines       46892    61171    +14279     
===========================================
+ Hits        22154    35697    +13543     
- Misses      24738    25474      +736     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jedel1043
Copy link
Copy Markdown
Member

Kind of superseeded by #4931, and arguably much better since this assumes you have an OS to get env variables, but the other PR is customizable per the host's requirements.

@jedel1043 jedel1043 closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants