You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
guardrails: block-unresolved-pr-merge counts a superseded cancelled run as failing #8255
The guardrails hook block-unresolved-pr-merge refused a guarded merge of #8247 and reported failing checks. The newest ci-status run on the head had passed (run 39137521225). The checks it counted came from an older run on the same head, 39137509879, whose jobs were cancelled when the newer run superseded it. Re-running the cancelled run (gh run rerun 39137509879) made it pass, and the merge then went through.
Expected: a cancelled check run is superseded by a newer completed run of the same check on the same head, so the merge is not blocked. The supersede logic is meant to do this (plugins/guardrails/hooks/block-unresolved-pr-merge.sh:536-562, #7549). Either a case slips past that logic, or the matrix-leg rule (<name> (<leg>)) does not match how this repository's CI names its legs (test-bash (0), test-python (0)).
The rerun replaced the cancelled run's original job data, so the exact check-run set that tripped the hook is no longer visible on 39137509879. The fix needs a fixture rebuilt from the check-runs API shape: a cancelled run in one check suite, plus a newer successful run of the same workflow in another check suite with matrix legs.
Fix
Find the check-run shape that the jq at block-unresolved-pr-merge.sh:552-562 leaves counted as cancelled, and supersede it with the newer successful run of the same check.
Verification
A stay-quiet test in block-unresolved-pr-merge.test.sh fails before the fix: a cancelled older run plus a newer successful run, with bare and (<leg>) names, gives no block.
Moved here from #8401, a duplicate of this issue under a different name. It has the check-run set this issue says is no longer visible.
PR #8397, head fcdfcf0f4185f05d50264ed9d64b0572ac1f025c (guardrails 0.52.0), check runs on the head (GET commits/<sha>/check-runs):
started_at
name
conclusion
05:42:12Z
test-bash
cancelled
05:42:12Z
test-python
cancelled
05:42:12Z
ci-status
cancelled
05:42:42Z
test-bash (0)
success
05:42:42Z
test-python (0)
success
05:45:43Z
ci-status
success
The hook blocked with Failing checks: test-bash, test-python. The cancelled runs use the bare names, and the runs that replaced them use the (<leg>) names. That points at the second hypothesis above: the supersede logic doesn't match a bare-name cancelled run to its newer (0) leg. The fixture for the stay-quiet test is this table.
A second case of this bug, from #8401, which is being closed as a duplicate of this issue: the replacement checks carry a different name from the cancelled ones. On PR #8397 (head fcdfcf0f4185f05d50264ed9d64b0572ac1f025c), the hook refused a guarded merge with "Failing checks: test-bash, test-python". Those check runs had been cancelled and replaced by successful runs under different names. The current supersede logic (block-unresolved-pr-merge.sh:540-561) matches only the same name or a "name (...)" pattern. A fix must cover both cases, with a stay-quiet test for each.
Closing as fixed by #7823, which shipped in guardrails 0.53.0. Checked against main:
plugins/guardrails/hooks/block-unresolved-pr-merge.sh:637-639: a cancelled run counts as superseded when a newer successful run of the same app, in another check suite, is named <name> (...). A matrix job cancelled before it expanded reports under its bare name.
A newer run under a truly different name is still blocked on purpose (matrix-other-name). Same-name cancelled checks are cleared by the newest-by-id rule.
Activity
github-actions commentedon Oct 18, 2026
Thanks for the report. Automated triage handed this issue to a maintainer.
Proposed work class: work-class: scoped
Basis: automated intake triage; a maintainer confirms or changes it.
Automated triage. A maintainer reviews it.
kyle-sexton commentedon Oct 19, 2026
Moved here from #8401, a duplicate of this issue under a different name. It has the check-run set this issue says is no longer visible.
PR #8397, head
fcdfcf0f4185f05d50264ed9d64b0572ac1f025c(guardrails 0.52.0), check runs on the head (GETcommits/<sha>/check-runs):The hook blocked with
Failing checks: test-bash, test-python. The cancelled runs use the bare names, and the runs that replaced them use the(<leg>)names. That points at the second hypothesis above: the supersede logic doesn't match a bare-name cancelled run to its newer(0)leg. The fixture for the stay-quiet test is this table.kyle-sexton commentedon Oct 19, 2026
A second case of this bug, from #8401, which is being closed as a duplicate of this issue: the replacement checks carry a different name from the cancelled ones. On PR #8397 (head
fcdfcf0f4185f05d50264ed9d64b0572ac1f025c), the hook refused a guarded merge with "Failing checks: test-bash, test-python". Those check runs had been cancelled and replaced by successful runs under different names. The current supersede logic (block-unresolved-pr-merge.sh:540-561) matches only the same name or a "name (...)" pattern. A fix must cover both cases, with a stay-quiet test for each.kyle-sexton commentedon Oct 20, 2026
Closing as fixed by #7823, which shipped in guardrails 0.53.0. Checked against main:
plugins/guardrails/hooks/block-unresolved-pr-merge.sh:637-639: a cancelled run counts as superseded when a newer successful run of the same app, in another check suite, is named<name> (...). A matrix job cancelled before it expanded reports under its bare name.test-bash/test-python, then run 39137521225 withtest-bash (0)/test-python (0)passing) is thematrix-cancelled-then-legsfixture inblock-unresolved-pr-merge.test.sh:144, asserted green at :299.matrix-other-name). Same-name cancelled checks are cleared by the newest-by-id rule.Reopen if it recurs on guardrails 0.53.0 or later.