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 - #6337
Merged
Conversation
…nd redrive it on a new head or green checks (GH-6327) A confirmed CI timeout with no check run ever discovered now sets a purpose-built hold flag (with head SHA and redrive counter, persisted and kept by RestoreState) instead of leaving a dead-end failed row. redriveCITimeoutHeldPR re-enters waiting_ci on a new head, or on the same head only when at least one check run is discovered and all passed (an empty result or a CheckCI error is never green). Two redrives per PR, then the terminal label. One PR comment at the hold and one at re-entry, through the secret mask. The monitor logs the never-reported Warn once per head.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
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: