Skip to content

Test that wrapper help after toolchain arguments changes nothing - #5571

Merged
antoniosarosi merged 1 commit into
canaryfrom
antoniosarosi/toolchain-use-help
Nov 8, 2026
Merged

antoniosarosi merged 1 commit into
canaryfrom
antoniosarosi/toolchain-use-help

Conversation

@antoniosarosi

@antoniosarosi antoniosarosi commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Claude on behalf of Antonio

Wrapper 0.2.x treated --help/-h as help only right after toolchain, so the flag after a selector ran the command. Outside a project, on 0.2.3:

baml toolchain use 0.25.2 --help        # printed "selected BAML toolchain 0.25.2" and rewrote ~/.baml/config.toml
baml toolchain uninstall 0.25.2 --help  # deleted the toolchain

Canary already prints help in both wrappers (clap in the Rust wrapper, management() in the BAML wrapper), but no test covered the flag after an argument. This adds a wrapper test that puts --help/-h after the arguments of use, use --global, install --force, update and uninstall, and checks that help is printed and that BAML_HOME and the project are unchanged. It also adds the test to the ci profile, which is the one CI runs.

Summary by CodeRabbit

  • Tests
    • Expanded coverage for --help and -h when placed after toolchain command arguments. The checks verify that these flags display usage information without modifying project files or contacting the release server. No user-facing behavior changes are included in this update.

Wrapper 0.2.x only treated --help/-h as help when it came right after
`toolchain`, so `baml toolchain use 0.25.2 --help` changed the selection
and `baml toolchain uninstall 0.25.2 --help` deleted the toolchain.
Canary already prints help for these; this locks it in for both wrapper
implementations and adds the test to the ci profile.

Co-Authored-By: Claude <[email protected]>
@trunk-io

trunk-io Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
developer-docs Ready Ready Preview Nov 8, 2026 1:41am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The wrapper test suite adds a fixture tree listing method and a test for trailing help flags on toolchain commands. The CI test profile now includes that test.

Changes: Toolchain help delegation

Layer / File(s) Summary
Fixture snapshots and CLI help checks
baml_language/wrapper_tests/baml_src/ns_harness/harness.baml, baml_language/wrapper_tests/baml_src/delegation.baml, baml_language/wrapper_tests/baml.toml
Fixture.tree returns sorted directory and file details. The delegation test checks help output, unchanged BAML and project files, and no release-server requests. The CI profile includes the test.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Suggested reviewers: sxlijin, hellovai

Merge Risk: Minimal · up to 4d061

The new CI test covers the reported trailing-help side effects, with no identified issue blocking merge.

Architecture risk: Low · up to 4d061

The change affects 1 system.

Changed systems: baml_language

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — baml_language (service) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in baml_language/wrapper_tests/baml.toml: Added the CLI delegation test to the CI profile’s included tests.
  • observed — Modified behavior in baml_language/wrapper_tests/baml_src/delegation.baml: Adds coverage for trailing help flags on toolchain commands. For both --help and -h, the test checks use with and without --global, forced install, update, and uninstall; it verifies usage output, unchanged BAML and project state, and no release-server requests.
  • observed — Modified behavior in baml_language/wrapper_tests/baml_src/ns_harness/harness.baml: Fixture.tree recursively traverses directories under the requested path, records directory paths and file paths with size and modification time, then sorts the entries.
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Test that wrapper help after toolchain arguments changes nothing" matches the main change. The PR adds a wrapper test that checks --help and -h placed after toolchain arguments (use, …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Test that wrapper help after toolchain arguments changes nothing" matches the main change. The PR adds a wrapper test that checks --help and -h placed after toolchain arguments (use, install, update, uninstall) print usage without changing BAML or project files. The supporting changes in the CI profile (baml.toml) and the tree(path) helper in harness.baml are secondary to this test. The title is specific and does not cover every detail, which is acceptable.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each help flag twice,
Then watches files stay put and nice.
No server knocks, no folders roam,
The sorted paths all make it home.
The CI hare gives one small cheer!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 97931bac-103e-45e5-b163-0dbe4b1c85e2
Commits

Reviewing files that changed from the base of the PR and between b55d6cb and 4d06176.

Files selected for processing: 3

  • baml_language/wrapper_tests/baml.toml
  • baml_language/wrapper_tests/baml_src/delegation.baml
  • baml_language/wrapper_tests/baml_src/ns_harness/harness.baml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Binary size checks failed

❌ 2 violations · ✅ 1 passed

⚠️ Please fix the size gate issues or acknowledge them by updating baselines.

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 65.0 MB 27.6 MB file 73.1 MB -8.1 MB (-11.1%) OK
❌ packed-program Linux 🔒 39.3 MB 16.2 MB file 29.2 MB +10.2 MB (+34.9%) FAIL
❌ bridge_wasm WASM 26.1 MB 🔒 7.7 MB gzip 5.7 MB +2.1 MB (+36.4%) FAIL

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.

Details & how to fix

Violations:

  • packed-program (Linux) file_bytes: 39.3 MB exceeds limit of 30.1 MB (exceeded by +9.2 MB, policy: max_file_bytes)
  • packed-program (Linux) file_delta_pct: +34.9% exceeds limit of 3.0% (exceeded by +31.9pp, policy: max_delta_pct)
  • bridge_wasm (WASM) gzip_bytes: 7.7 MB exceeds limit of 5.9 MB (exceeded by +1.9 MB, policy: max_gzip_bytes)
  • bridge_wasm (WASM) gzip_delta_pct: +36.4% exceeds limit of 3.0% (exceeded by +33.4pp, policy: max_delta_pct)

Add/update baselines:

.ci/size-gate/wasm32-unknown-unknown.toml:

[artifacts.bridge_wasm]
file_bytes = 26140672
gzip_bytes = 7725978

.ci/size-gate/x86_64-unknown-linux-gnu.toml:

[artifacts.packed-program]
file_bytes = 39309864
gzip_bytes = 16154526

Generated by cargo size-gate · workflow run

@antoniosarosi
antoniosarosi added this pull request to the merge queue Nov 8, 2026
Merged via the queue into canary with commit 6d6708d Nov 8, 2026
93 checks passed
@antoniosarosi
antoniosarosi deleted the antoniosarosi/toolchain-use-help branch November 8, 2026 02:15

This branch was successfully deployed

1 active deployment
Preview – developer-docs — 4d061767 Deployed Nov 8, 2026 by vercel[bot]
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.

1 participant