Repository navigation
Re-run failed checks once before a Declined CI fix fails the Run - #267
Merged
Merged
Conversation
When a CI-fix Repair leaves the head unchanged, ask GitHub to re-run the branch's own failed checks, once per workflow run, and watch CI on that head again from the new attempt on. Green carries on; red again, a check that can't be re-run, or a refused re-run is a Declined CI fix as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on main at 362b9ca; fix main first) 2026-10-01T13:02:36Z, host thirdshift. Uncommitted work at the time of failure is included in this commit.
JacobStephens2
marked this pull request as draft
October 1, 2026 13:02
4 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hared test helpers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JacobStephens2
marked this pull request as ready for review
October 1, 2026 17:50
Merged
This was referenced Oct 24, 2026
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
A CI-fix Repair that leaves the head unchanged no longer fails the Run straight away. The head first gets one Check re-run, so a check that failed on a flaky test or a runner fault can pass.
MAX_REPAIRSand the CI-fix Repair prompt are unchanged.Checkgainsjob: Option<ActionsJob>(check run id, workflow run id), read from the check run'sidand details URL.Ci::has_own_failurestells the Repair loop whether the re-run left a check of the branch's own red.rust-lang/cargo(29 check runs with the default filter, 58 withfilter=all).CONTEXT.md(the Declined CI fix entry, new Check re-run term), README step 6, Failed runs and the Spec PR, the help text, anddocs/adr/0010-one-check-re-run-before-a-declined-ci-fix.md.mainis merged in. Its ADR 0009 took the number this branch had used, so the ADR here is 0010.Evidence
CI red on <short sha> and the Repair found nothing to fix on the branchalthough the same commit would pass (One module for how a Run's ending shows and how a child Run's is read back #258).After:
cargo testpasses on the branch withmainmerged in: 29 test binaries, 0 failed, including 11 new tests.cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean.The existing Declined CI fix tests pass unedited: their checks are not GitHub Actions jobs, so nothing is re-run. The fake
ghgives check runs ids and answersgh run rerun <run> --failed, with arerunfield on a check saying what the new attempt comes to.Not tested against real GitHub: the re-run request itself, and how soon the new attempt is listed. Only the listing behaviour above was checked live.
Merge Danger
Door: two-way
Reverting the commits restores the old behaviour. Nothing is stored or migrated.
Blast Radius: Repair-loop
gh run rerun), which needs a token that may re-run workflows. A request that fails ends the Run as before, with the error on stderr.skippedand call CI green before the dependent job has run (see Unaddressed findings).Unaddressed findings
Addressed from this review: the progress line for a failed request no longer says "GitHub refused" for every error (it now reads
the failed checks on <short sha> were not re-run: <error>),has_own_failuresmoved ontoCi,before_rerunrenamedprevious_attempt, and two duplications in the tests and the fakeghremoved.Standards
tests/merge_run.rsandtests/spec_run.rsinline the check JSON and thegh run reruncall thattests/ci.rshas helpers for. Skipped: test files here keep their own copies of small helpers (checks_on_head,commits_fix), and each uses them once.handed_to_repairis an unnamed(String, FailedChecks)pair. Skipped: it is one local with two uses, and a named type would be more to read than the pair.ci::rerundoes the eligibility check, the request, the wait and the watch in one body, with threeNoneexits, and the Repair loop still readsOption<Ci>. Skipped: each exit says why in a progress line, and what Inherited failures mean after a re-run is the Repair loop's to decide, socireports what CI came to.Spec
skippedresult can be read as passing.--failedalso re-runs jobs that depend on a failed one, and their new check runs appear only after it finishes. Skipped: a first CI watch has the same gap (a job waiting onneedshas no check run yet), so closing it means watching workflow runs instead of check runs everywhere, which is a change to the CI watch as a whole. The issue's rule, never to take the failed result of the old attempt for the re-run's, holds.no re-run appeared on <sha> within Nsis an end state the issue does not name. Kept: without it the watch would report the old attempt's result, which the issue forbids.ghcommand that failed, and the loop returns on the first error, which the single-run test covers.only_a_check_run_whose_details_are_a_jobs_page_is_an_actions_job. Skipped: the acceptance criterion allows a commit status for the Run-level test, and both take the samejob: Nonepath.no re-run appeared on <sha> within 0sshows 0s for a sub-second grace period. Skipped: only tests set one, andwaiting up to 0s for CIalready reads the same way.Closes #262
🤖 Generated with Claude Code