Repository navigation
ci: aggregate required checks into a single required_checks_done gate - #757
Merged
Merged
Conversation
Add a 'required_checks_done' job that depends on every test job and runs with 'if: always()'. It fails (and names the offending jobs in its log and the run summary) when any dependency does not succeed. This lets branch protection require a single status check instead of every individual job: adding, renaming, or removing a job now only means editing this job's 'needs' list, not the branch protection settings.
helly25
requested review from
dzbarsky,
fmeum,
jsharpe and
rrbutani
as code owners
June 4, 2026 17:13
Add a step to required_checks_done that parses the workflow with yq and fails if any declared job (other than the gate itself) is missing from its 'needs' list. This prevents a newly added job from silently escaping the required gate. yq is preinstalled on ubuntu-latest runners.
This was referenced Jun 4, 2026
dzbarsky
approved these changes
Jun 4, 2026
2 of 3 tasks
helly25
added a commit
to mboworks/bzl
that referenced
this pull request
Jun 4, 2026
The `done` job was a no-op `echo "Done"`. Without `if: always()`, GitHub skips it whenever a dependency fails -- so branch protection requiring only `done` would pass on a job that never actually ran. Apply the principle from bazel-contrib/toolchains_llvm#757: keep one required status check, but make it actually gate things. - `if: always()` so the gate runs on every outcome. - Reads `toJSON(needs)` via an env var (not script interpolation), writes a Job -> Result table to the run summary, treats `success`/`skipped` as passing, and fails with `::error::` annotations naming each non-passing dep. - A first step uses `yq` to verify every job declared in main.yml (other than `done` itself) is wired into `needs:`, so a newly added job cannot silently escape the gate. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
helly25
added a commit
to mboworks/mbo
that referenced
this pull request
Jun 4, 2026
The `done` job was a no-op `echo "Done"`. Without `if: always()`, GitHub skips it whenever a dependency fails -- so branch protection on the single `done` check would pass on a skipped, never-ran job. Apply the principle from bazel-contrib/toolchains_llvm#757: keep one required status check, but make it actually gate things. The job now runs on every outcome, parses `toJSON(needs)` (via env, not script interpolation), writes a Job -> Result table to the run summary, and fails with `::error::` annotations naming any dep that didn't succeed. A second step uses `yq` to verify every job declared in the workflow is wired into `needs`, so a future job can't silently escape the gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a single
required_checks_donejob to theTestsworkflow thatneeds:every test job and runs withif: always(). It fails (and names the offending jobs in its log and the run summary) whenever any dependency does not succeed.Why
Today branch protection has to list every individual job (
lint,test,toolchain_test,external_test,container_test,xcompile_test,abs_paths_test,sys_paths_test) as a required status check. Adding, renaming, or removing a job means editing the branch protection settings too, and it's easy to forget.With this aggregating gate, branch protection only needs to require one check â
required_checks_done. Adding/renaming/removing a job now only means editing this job'sneeds:list.Behaviour
if: always()so the gate still runs when a dependency fails or the run is cancelled (GitHub otherwise skips aneedsjob whose dependency failed).toJSON(needs)via an env var (not interpolated into the script â avoids injection), writes a Job â Result table to the run summary, and:success/skippedas passing (so a future conditionally-skipped job won't deadlock the gate),failure/cancelled, emitting a::error::annotation per offending job.Follow-up (repo settings)
After merge, update branch protection on
masterto require onlyrequired_checks_doneand drop the individual job checks.