Repository navigation
fix(ci): refuse a PR whose detect jobs died — its green verified nothing - #490
Merged
Merged
Conversation
`skipped` is only trustworthy when the job that decided to skip SUCCEEDED. Every expensive job is gated on `needs.detect.outputs.*`. When a `detect` job FAILS, its dependents report `skipped` — and branch protection accepts `skipped` as satisfied. So a PR can show all twelve required contexts satisfied with not one of them having run. Found on #473 while looking for a merge-bus candidate: two Rust files changed, all three detect jobs failed in the Actions-minutes outage, all 12 required contexts `skipped`, `mergeStateStatus` CLEAN. It was mergeable — by hand or by the bus — with nothing compiled or tested. A scan of every open PR found it was the only one left in that state; the others had been pushed to since. This is the same "a false skip is the worst failure mode available" that the `grep -c`-not-`grep -q` rule exists for, reached by a different route: there the detect job lies, here it dies. It also defeats the aggregator gates, since `test` and `DuckLake + extensions e2e` gate on `needs.detect.outputs.code == 'true'` and an empty output skips the gate before its fail-closed `case` can run. Requiring the detect contexts in protection is not the fix — three jobs under two names, and a required context that legitimately does not report blocks every PR forever. Checking it at the point of use is cheap and precise, so the bus now reads the candidate's check-runs and refuses one whose detect jobs concluded `failure`, naming the remedy ("re-run CI before batching"). Simulator covers it as `detect-died`: the unverified candidate is skipped with its reason, the genuinely-verified members still ride, and the unverified one is never merged. Mutation-tested by deleting the check. Suite now 67 assertions. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
force-pushed
the
bm/ci-merge-bus-detect-failed
branch
from
November 5, 2026 11:36
4c354f4 to
7fea3f1
Compare
Owner
Author
|
Rebased onto I'd opened #492 for that advisory before noticing another session had landed the same fix concurrently. Closed it as redundant: Local gates after the rebase: |
athvin
added a commit
that referenced
this pull request
Nov 5, 2026
… not data (#543) The third live attempt at a real landing was refused: #510 skip its detect jobs failed, so every gate reported skipped without running — re-run CI before batching #510 was fine. All three of its detect jobs had completed `success` twenty minutes earlier and the PR was CLEAN; the `14:18:16` timestamp that looked like a push was `updated_at` moving when the `merge-bus` label was added. The check I added in #490 was this: [ "$(gh api ... --paginate --jq '...|length' 2>/dev/null || echo 0)" != "0" ] `--paginate` emits one jq result per page and `|| echo 0` appends another on failure, so a call that emits a page and THEN errors — a secondary rate limit being the obvious candidate, given how many calls this loop makes per candidate — yields the two-line string "0\n0", which is `!= "0"`. A healthy PR is then refused as unverified. This is exactly the defect the pre-flight was fixed for in #482, reintroduced here one commit later. Replaced with a `detect_failures` function that reads the status explicitly, requires one line of three bare integers, and FAILS OPEN on anything else — consistent with the pre-flight, because `mergeStateStatus == CLEAN` remains the gate and a rate limit must not block every merge. It also compares `total_count` against what it fetched, so a commit with more than a page of check-runs says so instead of answering from a prefix. Two further traps hit while fixing it, both the same shape as the original: Whitespace-collapsing is NOT a fix. `"0\n0"` with the newline stripped is `"00"` — still numeric, still `!= "0"`. And the function's own warnings went to STDOUT, so `$(detect_failures …)` captured the warning text along with the count and skipped the PR anyway. A function whose stdout IS its return value must put diagnostics on stderr. My isolation test printed the warning and I read it as informational rather than as contamination; the simulator scenario is what caught it. Covered by `detect-read-flaky`, which asserts a healthy PR still rides when the check-runs read emits output and then fails. Mutation-tested both ways: putting the warnings back on stdout is caught, and restoring the original one-liner is caught. `detect-died` still skips, so the real guard is intact. Suite now 72 assertions. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
A green that verified nothing
skippedis only trustworthy when the job that decided to skip SUCCEEDED.Every expensive job is gated on
needs.detect.outputs.*. When adetectjob fails, its dependents reportskipped— and branch protection acceptsskippedas satisfied. So a PR can show all twelve required contexts satisfied with not one of them having run.Found on #473 while hunting for a merge-bus candidate:
er-cli/src/lib.rs,er-cli/tests/lake_e2e.rs)detectjobsfailure— starved in the Actions-minutes outage,steps=0skippedmergeStateStatus: CLEANIt was mergeable, by hand or by the bus, with nothing compiled or tested. I scanned every open PR: #473 is the only one left in that state, because the others have been pushed to since.
This is a known failure mode arriving by a new route
It's the same "a false skip is the worst failure mode available" that the
grep -c-not-grep -qrule exists for. There the detect job lies; here it dies. Same consequence.It also defeats the aggregator gates.
testandDuckLake + extensions e2ecarryif: !cancelled() && needs.detect.outputs.code == 'true'— withdetectfailed that output is empty, so the gate is skipped before its fail-closedcasecan run. The aggregator pattern assumesdetectsucceeds.Why not just require the detect contexts
Three jobs under two names (
detect changes×2,detect infra changes), and a required context that legitimately doesn't report blocks every PR forever — the exact trap theplan (<env>)episode already cost. Checking at the point of use is cheap and precise:The bus now does this and refuses such a candidate, naming the remedy:
Also in here
The skill section hit the enforced 500-line body limit (527). The merge-bus detail moved to
references/merge-bus.md(105 lines, with the## Contentsa long reference requires), leaving a tight summary and a link — the repo's own convention rather than trimming prose.Verification
Simulator scenario
detect-died: the unverified candidate is skipped with its reason, the genuinely-verified members still ride, the unverified one is never merged. Mutation-tested by deleting the check — caught. Suite now 67 assertions.skills-check all→ exit 0.Operational note
Anyone merging by hand after an Actions outage should run the query above first. A PR whose CI was starved reads green.
🤖 Generated with Claude Code