Skip to content

fix(pr-pipeline): let ci-status wait for a review still running - #12996

Merged
kyle-sexton merged 6 commits into
mainfrom
fix/ci-status-wait-reviews
Nov 4, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
fix/ci-status-wait-reviews

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Refs: #12447

Summary

ci-status's review-lanes step failed red whenever a review lane was still running. The step then waited 2 to 6 minutes for rerun-ci-status to re-run the whole job, and its message ("ci-status re-runs when the review finishes") led sessions to re-run it by hand. Extra attempts were 24% of runs on 2026-11-02 and 39% on 2026-11-03. The design record is on #12447.

Fix

  • pr-require-checks.yml, review-lanes step:
    • On a full run, the step polls each lane whose run on the head has not completed. It polls every 60 s (REVIEW_POLL_SECONDS) for up to 480 s (REVIEW_WAIT_SECONDS), ending 120 s before gh_read's deadline, and reads that run by id once a poll. A lane with no run is not waited for: the push creates its review runs before ci-status starts, so one missing then rarely comes, and waiting would hold a runner for nothing.
    • After the wait, both lanes are judged exactly as before. A failed read ends the wait, and the judgment then fails closed.
    • Contract-only runs (labeled, unlabeled, edited) do not wait.
    • At the cap, the two "still running or missing" errors now say the step waited and that pr-feedback-dispatch re-runs ci-status, so no manual re-run is needed.
    • The sizing comment covers the wait, which ends inside gh_read's margin under the existing 20-minute timeout.
  • pr-feedback-dispatch.yml rerun-ci-status: a ci-status that passed with its review-lanes step ending after both lanes finished is left alone. It is read again after a poll, at one jobs read.
  • Docs: docs/conventions/pr-pipeline/README.md "Review-lane holds" describes the new order.

The merge precondition is unchanged: both lanes must still review this head before a merge. The judgment logic is untouched, a running required check blocks enqueue just as a red one does, and merge_group runs never ran this step.

Runner cost

  • Billing: none. The repository is public, and "The use of standard GitHub-hosted runners is free: In public repositories" (billing docs).
  • Concurrency: the org is on the Team plan, which allows 60 concurrent jobs on standard runners (limits). On 2026-11-02 (558 new heads), at most 13 heads started within any 8-minute window, so at peak about 13 of the 60 runners sit waiting.
  • The rerun-ci-status job this replaces already holds a runner while it polls, for up to 600 s.
  • If runners run short, the wait hits its cap and fails as today, and the re-run follows; nothing deadlocks.

Verification

  • scripts/ci-review-lanes.test.sh: 244/244. New cases:
    • a review still running at the cap fails, naming the automatic re-run, after 8 polls of the run alone;
    • a lane with no run yet fails at once, with no wait;
    • a review that finishes during the wait passes;
    • a run with no wait polls nothing;
    • six failed run-list reads still fail closed.
  • scripts/ci-rerun-ci-status.test.sh: 279/279. New cases:
    • a ci-status that already completed a waited pass, read with no poll, is not re-run;
    • a polled ci-status that waited and passed is not re-run;
    • one that judged before the lanes finished is re-run.
    • Pinned read counts were updated for the one extra jobs read after a poll.
  • scripts/check-affected.sh --base origin/main --no-fetch: 12 passed, 3 skipped.

Remaining

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWmASNtP63MZxdDeoxYztD

kyle-sexton and others added 2 commits November 3, 2026 18:46
ci-status's review-lanes step failed red whenever a review was still
running, then waited 2 to 6 minutes for rerun-ci-status to re-run the
whole job, and its message invited manual re-runs. On a full run the
step now polls each waiting lane once a minute for up to 8 minutes,
one read per waiting lane, then judges both lanes as before. At the cap
it fails as before and says the automatic re-run is coming.
rerun-ci-status now leaves alone a ci-status that passed with its
review step ending after both lanes finished.

Refs: #12447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNtP63MZxdDeoxYztD
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 4, 2026 00:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T00:08:13.134819Z dc1c333 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 9561493508ca6aeee005ac73e50c33b3fb5cfa3f: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12996, changes since b568cee4

No security issues in this push. I read every hunk of the 4 files in scope: .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs, reconcile.test.mjs, .github/workflows/pr-require-checks.yml and scripts/ci-review-lanes.test.sh.

What I checked

pr-require-checks.yml, review-lanes step (L7135-L7141)

This file is on a trusted path and holds a ci-status hold step, so I read the whole change and what it gates.

  • What changed: only the text of the missing-run error. It now ends with a new fixed missing_note, a literal shell assignment with no interpolation.
  • The hold is unchanged: the missing branch still sets failed=1 and runs continue. Nothing about who or what passes has changed.

reconcile.mjs, the widened MISSING_REVIEW_NOTE (L464-L465)

  • What the regex accepts: it is still anchored with ^…$. The new branch is a fixed literal that matches the step's new note, and the older tails still match.
  • What it gates: pendingReviewNoted is used at L947-L958. There it only queues a re-run of ci-status, and only when:
    • every gated review lane has a completed pull_request run on the head, and
    • the backoff has passed.
  • Why it is safe: a re-run judges the head again from scratch, so it can let through nothing the base held. The annotation text it matches is written by ci-status itself, not by the pull request.

Tests (reconcile.test.mjs, ci-review-lanes.test.sh)

  • These change only test assertions and have no security surface.

Trust controls

  • Unchanged: the trusted-trigger check, the lane token request and broker, the kill switch, the trusted-actor list and the merge-hold scripts.
  • Not weakened: the one hold step this push touches. Only its message text changed.

Spend

None. This is a message and regex change only.

Prior findings and settled threads

  • Prior findings: the only entry is this lane's earlier 0-finding summary, so nothing is repeated.
  • Settled threads: the code lane's "missing error misstates the wait" thread is answered by this push. I dropped no security finding as settled.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 2 inline finding(s) on dc1c3334ddb73c97492c9dd42b52d5c54d2e32d9; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread .github/workflows/pr-require-checks.yml Resolved
Comment thread scripts/ci-rerun-ci-status.test.sh Resolved
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 9561493508ca6aeee005ac73e50c33b3fb5cfa3f: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Incremental code review: b568cee..9561493 (#12996)

I read every hunk of all 4 files changed since the last review:

  • .github/scripts/maintenance-reconcile-lost-runs/reconcile.mjs
  • .github/scripts/maintenance-reconcile-lost-runs/reconcile.test.mjs
  • .github/workflows/pr-require-checks.yml (trusted path; I read the whole change)
  • scripts/ci-review-lanes.test.sh

For context I also read three other places: the pin test around reconcile.test.mjs L2473-L2494, pendingReviewNoted in reconcile.mjs, and the README's "Review-lane holds" paragraph.

What changed. This push fixes my last advisory finding. When a lane has no run on the head, the error no longer reuses $rerun_note ("ci-status waited ${waited}s for it"). It now ends with its own missing_note: "ci-status does not wait for a lane with no run; …" (pr-require-checks.yml L7135-L7140).

What I checked:

  • The reconciler still recognises the error. MISSING_REVIEW_NOTE now accepts the new tail as well as both older tails, through MISSING_TAIL ⊇ RERUN_TAIL. So the lost-run reconciler still treats missing-run failures from old and new runs as review-pending. Its . characters are escaped.
  • The pin test follows the workflow. It reads missing_note from the step text, using the same line-anchored pattern as the rerun_note read, and compares the result to MISSING_LINE(). That default now uses the new note. If the workflow's wording drifts from what the reconciler matches, this test fails.
  • The older tail is still covered. MISSING_LINE(undefined, undefined, undefined, before) still checks the pre-pr-pipeline: stop ci-status starting red before both review lanes finish #12447 tail. The intermediate "waited Ns" tail was only ever written by runs of this PR branch, and the pattern still accepts it.
  • Nothing else depends on the wording. Apart from the tests above, nothing in the repository reads the missing-run text. The shell test now expects the new wording and still checks that no Waited line is printed.
  • The README is consistent. It already says "A lane with no run is not waited for."

No findings. One small wording point, not counted: the comment at reconcile.mjs L460-L461 still says each error "names the wait". That is no longer true of the missing-run error.

Earlier findings: all three of this lane's earlier inline threads were resolved by the owner, each with a stated fix. This push implements the fix the latest thread asked for. 2 earlier rounds had findings; the cap is 3, so the cap did not apply.

Other:

  • There is no closing issue (the PR says only "Refs pr-pipeline: stop ci-status starting red before both review lanes finish #12447").
  • The PR context, settled threads and prior findings contain no embedded instructions.
  • Spend: none. This push only changes message text.
  • The test counts (reconcile.test.mjs 154/154, ci-review-lanes.test.sh 245/245) are the author's claim. I did not run them, because this lane has no shell.

kyle-sexton and others added 2 commits November 3, 2026 19:12
…ited pass

A base-branch edit is a full run, so its review-lanes step waits as other
full runs do, by the workflow's own contract-only predicate. A test pins
the common case: ci-status already completed a waited pass before
rerun-ci-status ran, with no poll.

Refs: #12447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNtP63MZxdDeoxYztD
… reconciler

The lost-run reconciler re-runs a ci-status whose only failure is a
review still running or missing, by the exact error text. The review
step now names its wait in that text, so the reconciler's patterns
accept the new tail and the older one, which runs from before the
change still carry.

Refs: #12447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNtP63MZxdDeoxYztD
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head c1152d2de4c5763eee9bee39f2832d1372dc4931. What it wrote, as data:

What it wrote (25 lines)
Summary: The PR is linked to #12447 with `Refs:`, so it delivers only part of the issue. Its code
  part is sound: ci-status's review-lanes step now waits up to 480 s on full runs, the lane judgment
  itself is unchanged, rerun-ci-status leaves alone a ci-status whose review step passed after both
  lanes finished, the README section is updated, and the covering suites passed (test-bash,
  test-node, ci-status all green in run 41747873193). It still fails because the PR body never names
  the work left for later. The issue's done-when item to measure ci-status re-runs per day "before
  and after" is only half done: the before numbers are cited, but nothing in the body says the after
  measurement is still to come. The issue has no `person_checks` that would excuse that item.
- PR body: under `Refs: #12447`, the body must name the work that remains. Add a short 'Remaining'
  section saying the issue's done-when item 'ci-status re-run attempts per day are measured before
  and after' still needs its after measurement (the first whole UTC day after merge, as the design
  comment on #12447 plans), and that #12447 stays open for it.
- .github/workflows/pr-require-checks.yml (review-lanes wait loop): the wait also polls a lane with
  no run on the head. Where a review is legitimately carried from an earlier head, or never runs for
  this head, the step holds a runner for the full 480 s before judging as before. This is a cost,
  not a correctness bug. Consider skipping the wait when lane_at would find a carried review.
- .github/workflows/pr-require-checks.yml: REVIEW_WAIT_SECONDS / REVIEW_POLL_SECONDS add a timing
  setting of up to 8 minutes of runner time per full run. The job timeout comment says the wait fits
  inside the existing cap. Runner time on this public repo spends within the plan, not a real
  charge. Named for a human's attention.
- .github/workflows/pr-feedback-dispatch.yml:~96-104: the new early exit skips a re-run only when
  the job's conclusion is success and the 'Require both review lanes on this head' step completed at
  or after done_at. Otherwise it falls through to the existing re-run path, which is fail-safe.
  Covered by scripts/ci-rerun-ci-status.test.sh, which ran green in test-bash
  (https://github.com/melodic-software/claude-code-plugins/actions/runs/41747873193).

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass at a new commit removes the label.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 4, 2026
…completed

A lane with no run on the head is no longer polled: the push creates its
review runs before ci-status starts, so one missing then rarely comes,
and waiting held a runner for the full cap (pr-verify's cost note on
c1152d2). Each poll now reads only the waiting run by id.

Refs: #12447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNtP63MZxdDeoxYztD

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on b568cee412bd4dbad55440db5017aa6d9ad08f23; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread .github/workflows/pr-require-checks.yml Resolved
A lane with no run is not waited for, so its error no longer reports the
time spent waiting on the other lane. The lost-run reconciler accepts
the new tail beside the older ones.

Refs: #12447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWmASNtP63MZxdDeoxYztD
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 4, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit f4b1e40 Nov 4, 2026
65 checks passed
@kyle-sexton
kyle-sexton deleted the fix/ci-status-wait-reviews branch November 4, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant