Repository navigation
feat(pr-pipeline): re-run PR CI runs lost to a GitHub outage - #8505
Conversation
A scheduled reconciler, every 30 minutes, re-runs a CI workflow whose newest run on an open PR's current head ended cancelled, timed_out or startup_failure on its first attempt. The attempt number is the once-only record: attempt 2 or later is never touched again. It reads nothing from GitHub while githubstatus.com shows Actions as anything but operational or the page is unreadable, keeps at most 3 PRs with a re-run in flight (auto-merge PRs first), spaces writes at least 1 s apart, and stops on the first rate-limit error. It uses the job's own token; lost lane runs, whose trigger check refuses a github-actions[bot] re-run, are listed in the run summary for a person. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Incremental security review of PR #8505 at fcb4176, covering only the two test files changed since 6f0b2f9. The change swaps hand-built fake No security issues found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e5ffe64ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-review reviewed Incremental review of fcb4176 (since 6f0b2f9): no findings. The change swaps two hand-built fake fetch responses for real
I did not run the tests myself. The PR's stated verification is the author's claim and I did not independently confirm it. |
|
Security pass note (N1), traced at 5e5ffe6: when a github-actions[bot] re-run of pr-verify stops in check-trusted-trigger with |
… re-running The workflow re-run endpoint answers 201 with no body, which createGitHub parsed as JSON and threw on after GitHub had accepted the re-run. Any success with an empty body now returns null. The reconciler now re-reads the PR right before each re-run and skips it when the head moved, or the PR closed or went draft, since the listing: re-running an obsolete run would cancel the new head's CI in the PR concurrency group. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
createGitHub now reads the body with response.text() so a bodiless 201 returns null. The fake fetches in callers.test.mjs and report-check-run.test.mjs returned plain objects with only json(), so every POST through them threw and reportCheckRun exited 1. Return a Response, which carries both. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xk7Lz7d2twxvA3LfRxnLkT
Closes #8468
Summary
Step 1 of #8468 for PR CI: a scheduled reconciler (
maintenance-reconcile-lost-runs.yml, every 30 minutes) re-runs CI runs a GitHub outage ended without a result, so nobody has to re-run them by hand.pr-require-checks,pr-test-windows,pr-check-managed-files-hosted) whose newest run endedcancelled,timed_outorstartup_failure, on attempt 1, created in the last 24 hours, is lost.githubstatus.com/api/v2/components.jsonshows Actions as anything butoperational, or the page cannot be read.Fix
.github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs: the rules above, no model, using the job's own token (actions: write,pull-requests: read). That is the same authoritypr-merge.yml's post-merge-dispatch job and the hourly triage sweep already use unattended. No new secret, App permission or broker activity..github/workflows/maintenance-reconcile-lost-runs.yml: schedule plus dispatch, main only, checks the lanes kill switch, pinned actions, no PR checkout.scripts/outside-node-packages.txt: registers the package so CI runs its tests.Not covered here, listed in the run summary or left as today:
pr-mergere-enqueues its own PRs once their checks pass; a PR a person enqueued stays theirs.pr-require-checksrun (a label or edit event) that lands after a lost full run becomes the newest run on that head, so the lost full run is not re-run.Verification
node --test .github/scripts/maintenance-reconcile-lost-runs/reconcile.test.mjs: 15 pass. The suite covers: a re-fired run (attempt 2) is not re-fired; a run re-run between the listing and the write is left alone; every non-operational Actions status, and an unreadable page, makes no GitHub call at all; the in-flight cap and auto-merge order; writes at least 1 s apart; the first rate-limit error stops the run; the kill switch; lane, draft, fork and stale runs left alone.reconcile.mjs(attempt check, status gate, write gap, in-flight count, fresh read, newest filter, merge order, rate-limit stop, lane exclusion): all killed.actionlintandzizmoron the workflow: clean.scripts/affected-tests.sh --run: every selected suite passes (ci-test-node-stop-commands.test.shrun with PyYAML through uv).check-changelog-fragments.sh --check-required origin/main: no fragment needed (no plugin files changed).Related
#8446 (broker 5xx / token 403 re-fire; this covers the CI half), #8447 (scheduled pr-unblock-dispatch), #8445.
Hold: a human merges this
🤖 Generated with Claude Code