Repository navigation
GH-6327: fix(autopilot): a PR that failed on a CI timeout with no check reported re-enters the pipeline on a new head or on green checks — purpose-built hold flag, capped redrive, kept across a restart - #6332
Conversation
…eported and re-enter it on a new head or green checks (GH-6327) handleWaitingCI now sets CITimeoutHoldActive (plus the head SHA and a redrive counter, persisted) at the confirmed-timeout site when no check was discovered, without the terminal label. redriveCITimeoutHeldPR runs in processOnePR before ProcessPR and re-enters waiting_ci on a new head or when the checks of the same head are all successful, capped at two redrives; at the cap the PR gets the terminal label as before. RestoreState keeps the row.
Review — REQUEST-CHANGES (head 86eb711). Closed without merge; #6327 is amended (items 8 and 9) for a second run.Blocker: a held PR with zero check runs is merged after a daemon restart ( Fix: the same-SHA redrive needs at least one discovered check run for that head SHA, all passed; plus a restart test with no checks. Other points
What is correct: items 1, 2, 4, 5, 6, 7 of the contract. |
|
This PR was closed without merging: closed without merging (no reason recorded) CI run: https://github.com/qf-studio/pilot/commit/86eb7115dd177fafb44f7fac185af9ecf4db33e7/checks |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Automated PR created by Pilot for task GH-6327.
Closes #6327
Changes
GitHub Issue GH-6327: fix(autopilot): a PR that failed on a CI timeout with no check reported re-enters the pipeline on a new head or on green checks — purpose-built hold flag, capped redrive, kept across a restart
Context
Autopilot does not take back a PR that failed on a CI timeout when its checks go green later. On 2026-11-11 the GitHub Actions run of PR #6317 stayed queued for 13 hours (a dead run on the GitHub side; no check ever reported). The log shows the platform-outage breaker hold, one re-adoption, and then "CI timeout confirmed by same-tick poll … missing_checks=true" with the stage set to failed. Hours later the branch got a new head and a green CI run; the PR was mergeable and clean; autopilot did nothing, and the PR was merged by hand.
Cause, in
internal/autopilot/controller.go: handleWaitingCI sets the failed stage at the confirmed timeout with an error text and a terminal label, and with no hold flag. ProcessPR does nothing for a failed stage. processOnePR keeps the PR tracked, but every redrive there needs a flag that this path never sets (redriveHeldPR, redriveSizeGuardHoldOnGreen, the breaker redrive, the rebase and API-outage redrives). RestoreState drops such a row at the next restart. The existing rule for a revival (memory autopilot-failed-stage-revival-is-a-flag-gated-redrive-before-processpr): a purpose-built boolean set only at the failure site, and a redrive keyed on it; never a match on the error text.Scope
internal/autopilot/types.go: a boolean for "held after a CI timeout with no check reported", the head SHA at that moment, and a redrive counter. Persist and load them ininternal/autopilot/state_store.go(column list, table rebuild list, insert, update and both scans; the columns of fix(autopilot): say it when the token cannot read CI — one PR comment, no pilot-failed label for this cause, and the github adapter reported unhealthy with the reason #6304 and fix(autopilot): a rejected or timed-out approval leaves a comment on the pull request — decision, who, reason, and how to continue #6305 show every place).Acceptance
go test -race -count=1 ./internal/autopilot/ -run 'CITimeout|Redrive|RestoreState'passes; paste the output into the PR body.Out of scope
The platform-outage breaker and its thresholds. A cancel or re-run of GitHub Actions runs by Pilot. Revival of any other failed PR.
Refs
Not verified
go test -race -count=1 ./internal/autopilot/ -run 'CITimeout|Redrive|RestoreState'passes; paste the output into the PR body.Reason: Not verified: shell operators are not allowed in evidence commands
Remove the call of the new redrive in processOnePR -> the new-head test fails.
Reason: freeform mutation, run manually
Drop the boolean from the rows RestoreState keeps -> the restart test fails.
Reason: freeform mutation, run manually
Pre-PR review
Mode: enforce
Verdict: APPROVE-WITH-NOTES
Fix: none
Defects:
Not-verified: