Repository navigation
fix: run unit tests with Bun's per-file isolation, load the forked Bash grammar, and update code-gauge - #1474
Conversation
…sh grammar, and update code-gauge Bun 1.4.3 includes the spawnSync fix (oven-sh/bun#44581), so `wb test` no longer needs `--no-isolate` and the unit-test rule no longer requires asynchronous spawns. wbfy loads the Bash grammar from @willbooster/tree-sitter-bash 3.0.4 through @willbooster/web-tree-sitter instead of a vendored WASM file, and wb uses code-gauge 10.2.2. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request optimizes the test execution environment by leveraging fixes in Bun 1.4.3, allowing for more efficient parallel test execution. It also updates the shell parsing infrastructure by migrating to forked tree-sitter packages, ensuring better maintainability and compatibility with the organization's release policies. Finally, it includes a minor version bump for code-gauge to incorporate recent improvements. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Tests run fast in parallel flow, Bun 1.4.3 makes them go. Grammars updated, bugs are gone, Coding work goes marching on. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request replaces the standard web-tree-sitter dependency with @willbooster/web-tree-sitter and @willbooster/tree-sitter-bash, loading the bash grammar directly via package resolution. It also upgrades code-gauge to version 10.2.2, removes the --no-isolate flag from unit tests (as the repository now pins Bun >= 1.4.3), and updates the documentation and comments to reflect these changes. There are no review comments, and I have no additional feedback to provide.
…leftover restores `bun test --parallel` gives each file a fresh global, module registry, and `process.env`, so test files no longer restore what they change, and `createTempDir` no longer restores `process.env`. A preload's `setDefaultTimeout` still reaches only one file of the non-isolated e2e run. Co-authored-by: WillBooster (Claude Code) <agent@willbooster.com>
Why
wb testpassed--no-isolate(fix(wb): run parallel unit test workers without per-file isolation #1421) only because, in Bun 1.4.2, aspawnSyncin a--parallelworker could miss its child's exit when the previous file's discarded stdout/stderr writers were garbage-collected during the call (oven-sh/bun#34069). The fix,oven-sh/bun#44581, describes exactly that mechanism and is included inbun-v1.4.3(the tag is 19 commits ahead of its merge commit and 0 behind). This repository already pins Bun 1.4.3.tree-sitter-bash.wasmbuilt from@willbooster/tree-sitter-bash2.1.0 and loaded it with upstreamweb-tree-sitter, so no fresh organization package could block wbfy's first install before wbfy refreshes the global release-age exclusions. Renovate cannot update a vendored file, and the grammar is at 3.0.4 now. Its ABI 16 cannot be loaded by upstreamweb-tree-sitter0.27 (Incompatible language version 16. Compatibility range 13 through 15). The organization is moving to the forked runtime and grammars. Both are exempt from the release-age gate, and that exemption shipped in feat(wbfy): exempt all our tree-sitter packages from the release-age gate #1405, before fix(wbfy): use established shell parser runtime during bootstrap #1422.Requirements
wb testkeeps running unit test files in parallel worker processes--no-isolatefor every Bun version and rely on the documented Bun >= 1.4.3 pin, because Renovate delivers Bun 1.4.3 in the same patch group as awbpatch release (fix(deps): update all patch dependencies #1471 bumpedmise.toml's Bun together withpackages/wb), and the remaining gap (wbfy writing 1.4.2 into a repository without a newer pin) closes when mise's release-age gate exposes 1.4.3 on 2026-10-17; rejected alternative: abun --versioncheck inwbthat keeps--no-isolatebelow 1.4.3, which adds a spawn per test run and transitional code to delete a week later[test] timeoutasbun test --timeout, becauseoven-sh/bun#7789andoven-sh/bun#43787are still open and a preload'ssetDefaultTimeoutstill reaches only one file of the non-isolated e2e run on Bun 1.4.3child_processimports and its Bun floor at 1.4.0, because raising the floor to 1.4.3 would make wbfy abort in repositories pinned to 1.4.2 until mise's release-age gate exposes 1.4.3 to wbfy's own Bun pinningCustomer Summary
wb testruns each unit test file in a fresh global, module registry, andprocess.envagain, while still using parallel worker processes, so test files no longer need to restore what they change.wb verify's code-gauge findings may change slightly with code-gauge 10.2.Technical Summary
packages/wb/src/scripts/execution/baseScripts.ts:testUnitpasses--parallelwithout--no-isolate.docs/expected-repository-rules.md: the unit-test rule requires Bun >= 1.4.3 instead of asynchronous spawns. Because--parallelimplies--isolate, each file gets a fresh global, module registry, andprocess.env(verified on Bun 1.4.3), so the rule no longer asks files to restore what they change. The--no-isolate-era helper code goes with it:createTempDir(packages/wb/test/helpers/shared.ts) no longer restoresprocess.envat file end, and thebuildWbcomment states the remaining reason for its once-per-run marker.setDefaultTimeoutin a preload now works in isolated unit runs but still reaches only one file of the sequential, non-isolated e2e run (oven-sh/bun#43787), and Bun still ignores[test] timeout(oven-sh/bun#7789). The docs andpackages/wb/src/utils/bunfig.tssay so, andwbkeeps passing--timeout.packages/wbfy/src/utils/shellParser.tsandpackages/wbfy/package.json: wbfy loads@willbooster/tree-sitter-bash/tree-sitter-bash.wasmthrough@willbooster/web-tree-sitter1.4.5, which the build keeps external. The vendored WASM and its license are deleted.packages/wb/package.json: code-gauge 10.1.0 → 10.2.2.Testing
bun run verifypassed.bun wb test -w packages/wb test/unit: 484 tests passed under the new--parallelcommand (which runs this repository's own suites), before and aftercreateTempDirstopped restoringprocess.env.bun wb test -w packages/wbfy test/unit: 369 passed and 2 failed locally inglobalReleaseAgeGate.test.ts. Those 2 fail identically onmainon this machine: the script's mise reads the developer's real~/.config/mise/config.toml, which is untrusted under the test's temporary HOME. CI's full test job passed, including them.bun test --parallel=1, a file's changes toglobalThis, an imported module, andprocess.envare invisible to later files; with--no-isolatethey leak. A preload'ssetDefaultTimeoutapplied to every file under--parallel, but to only one file without it.&&/||, subshells, pipes,$(...), backquotes,time -p,for,if, and$((...))parses to the same tree as the previous runtime and vendored grammar. The built wbfy bundle also resolves the grammar.Notes
wbuntil Renovate or wbfy lifts their pin.child_processimport ban and itsminimumBunVersioncan be raised to 1.4.3 once that gate passes.