ci: qodo-gate sweeps its own stale red runs off the head commit - #397
Conversation
Each trigger event type creates its own workflow run, and the branch-protection rollup counts every run of a required check on the commit — so after resolving the last Qodo thread, the reply-triggered green run lands beside the stale red pull_request-event runs instead of superseding them, and the PR stays BLOCKED until each red run is re-run by hand from the Checks tab (four of them on the last PR). A passing run now re-runs this workflow's earlier failed runs on the same head SHA (actions: write + gh run rerun --failed). Convergent by construction: only a PASS sweeps, and a re-run that passes finds nothing red left; if threads are genuinely unresolved the re-runs go red again and the gate still holds. Best-effort — a failed re-run request cannot turn the PASS into a FAIL. Also re-verified the header's parser claim before reaching for the alternative: pull_request_review_thread is still rejected on push (zero-job "workflow file issue" run), so thread resolution still cannot retrigger directly and the reply-to-retrigger flow stays. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by Qodoci: qodo-gate self-heals by re-running stale failed runs on head SHA
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
The sweep step promised best-effort but only protected the reruns — with pipefail set, a transient failure of the run listing itself would have been the step's exit code, turning a PASS into a FAIL. The listing is now guarded and the step exits 0 on every path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The friction this removes
Merging #396 surfaced a gap in the gate's unblock flow: after resolving the last Qodo thread, the reply-triggered green run lands beside the stale red runs rather than superseding them — each trigger event type creates its own workflow run, and the branch-protection rollup counts every run of a required check on the head commit. The PR stayed
BLOCKEDwith a green latest run until all four redpull_request-event runs were re-run by hand from the Checks tab.The fix
A passing run now sweeps: it lists this workflow's
failure-conclusion runs on the same head SHA andgh run rerun --faileds each (newactions: writepermission). Properties:rerunfailures; it cannot turn a PASS into a FAIL.The failure message now points at the one remaining manual step (reply in a thread to retrigger) instead of also asking for Checks-tab re-runs.
The alternative, re-tested and still dead
Before adding machinery I re-verified the header's claim that GitHub rejects the documented
pull_request_review_threadtrigger — if that parsed, plain thread resolution would retrigger the gate and most of this would be unnecessary. It still doesn't: a scratch workflow carryingpull_request_review_thread: {types: [resolved, unresolved]}produced a zero-job "workflow file issue" run on push (run 31778980528). The header comment now records that this was re-verified empirically, not just inherited.What this does not change
The gate's semantics are untouched: not pinned to head (the anti-treadmill rationale stands),
skip-qodo-gatelabel escape hatch, pagination, thread-attribution logic — all as before. One net-new permission (actions: write), scoped to the workflow's own runs by construction (--workflow qodo-gate --commit <head>).Validation: YAML parses; the sweep's list/filter pipeline is the same query used to unblock #396 by hand. The self-referential part (a green qodo-gate re-running red qodo-gates) can only be observed on a PR that first goes red and then resolves — this PR itself will exercise the gate normally.
🤖 Generated with Claude Code