ci: isolate the trusted complexity check from candidate Bun config and run it on merge groups
Merged
TE
2mo ago+121+121+012345678901234567890123456789-33-33-01234567890123456789
Needs an admin merge. Web complexity is red by design: the check refuses any pull request that edits web-complexity-trusted.yml, and this one has to.
Summary
- Hole: the trusted
Web complexitycheck started Bun in the pull request'sweb/directory. Bun loadsbunfig.toml(withpreload) and.envfrom there, so the code under review could configure its own judge. - Fix: run
check-complexity.mjsfromtrusted/webwith--no-env-file --config=<empty file>. The script is unchanged. - Must be
--config=: as a separate argument, the pinned Bun 1.3.14 treats the config file as the script and exits 0 silently, passing everything. - Merge groups: the check now also runs on
merge_groupagainst the policy at the group's base. The placeholder job from #13113 is removed. - Test:
tests/test_web_complexity_trusted_workflow.pyrequires the isolated invocation on every Bun check. Fails onmain, passes here.
Split out of #13102 (closed). Enable the merge queue after this lands.
Testing
- Reproduced locally on Bun 1.3.14: the preload and
.envload from the working directory; with--no-env-file --config=<empty>from another directory they do not; with--config <empty>the script never runs and exits 0. - New test and
actionlintpass. - Not done: the test is not in
ci.ymlyet (that edit forces a full macOS run; it goes with the nextci.ymlchange).
🤖 Generated with Claude Code
Summary by CodeRabbit
-
Bug Fixes
- Web complexity validation now runs reliably for merge-group events using trusted code and isolated configuration.
- Pull request settings can no longer influence complexity validation.
- Validation stops promptly when workflow jobs or steps fail.
-
Chores
- Removed web complexity from merge-group policy checks and merge-queue bridge requirements.
- Updated workflow documentation and added automated coverage for these safeguards.