ci: isolate the trusted complexity check from candidate Bun config and run it on merge groups

Merged
TE
2mo ago
+121-33

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 complexity check started Bun in the pull request's web/ directory. Bun loads bunfig.toml (with preload) and .env from there, so the code under review could configure its own judge.
  • Fix: run check-complexity.mjs from trusted/web with --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_group against the policy at the group's base. The placeholder job from #13113 is removed.
  • Test: tests/test_web_complexity_trusted_workflow.py requires the isolated invocation on every Bun check. Fails on main, 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 .env load 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 actionlint pass.
  • Not done: the test is not in ci.yml yet (that edit forces a full macOS run; it goes with the next ci.yml change).

🤖 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.