Repository navigation
perf(pr-feedback-dispatch): skip ci-status re-runs that can only pass again - #12932
Conversation
… again rerun-ci-status re-ran a ci-status that had already passed after reading both finished review lanes, which only started pr-verify on the head again. It now leaves a ci-status alone when it passed on a read at or after both lanes finished, and times the read from ci-status's review-lanes step rather than the job start, so a job held before that step counts as a late read. Both use the job list the step already reads: no new API call. Over 6 h (117 re-runs) the rule skips 19 (17 success->success, 1 success->cancelled, 1 failure->failure) and none of the 64 failure->success re-runs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MWmASPDSoP4Ps23JPiGyZV
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 Security review: PR #12932No security issues found. The PR changes What I checked:
The PR description contains no embedded directives aimed at this lane. critical-findings: 0 |
|
claude-review reviewed Code review: PR #12932, perf(pr-feedback-dispatch): skip ci-status re-runs that can only pass againI found no blocking or advisory issues. I read every hunk of both changed files: What I checked
Notes (not findings)
SpendThe change cuts GITHUB_TOKEN calls and the runner time of skipped ci-status and pr-verify runs. It adds no charge. No closing issue (the PR cites hub lever L114), so there are no acceptance criteria to check. No plugin manifests changed. |
No related issue: hub lever L114 (GitHub call budget)
Summary
Measured over 6 h (2026-11-03 13:10Z to 19:10Z):
A ci-status that passed had counted both review lanes, so re-running it can only pass again. The re-run still starts another pr-verify on the head (pr-verify.yml runs on every completed pr-require-checks run,
.github/workflows/pr-verify.yml:69-71, and its gate accepts this job's record, line 187). That pr-verify costs about 37 calls (check-intent plus subscription, the attempt-2 median). Most of these passes began reading the reviews within the job's 60 s margin after the last lane finished. In some, the job started early and held before its review-lanes step, so the read came after the lanes finished but the job's start fell before.Fix
rerun-ci-status's find step now times ci-status's read of the reviews from itsRequire both review lanes on this headstep. When the jobs API lists no steps, it falls back to the job's start, which is earlier. ci-status is left alone in two cases:A failed or cancelled ci-status inside the margin is still re-run. Both checks use the job list the step already reads, so they add no API call. The kill-switch, trusted-actor, reconciler-record and record-before-re-run rules are unchanged.
Replaying the rule over the 117 re-runs skips 19: 17 success to success, 1 success to cancelled, 1 failure to failure. It skips none of the 64 failure to success re-runs. The replay times the read against the trigger lane's finish, which is never later than the job's
done_at, so 19 is an upper bound.Expected saving is about 160 to 200 GITHUB_TOKEN calls an hour (estimate). A skipped re-run spends about 50 calls: this job 3, a ci-status attempt about 8 (attempt-1 median), pr-verify about 37, post-verify-notes about 2. At 19 per 6 h that comes to about 160 an hour. All 19 skipped rows come after #12797 merged at 14:31Z (the earliest at 14:59Z), so over the 4.65 h since then it comes to about 200 an hour. Each skip also saves one ci-status job and one pr-verify run of runner time.
On the two rules the hub asked for:
The data covers 102 of the 103 re-run pr-require-checks runs: one jobs read (run 41657424065) returned HTTP 502.
Not in this PR, reported to the hub:
Verification
scripts/ci-rerun-ci-status.test.sh: PASS=273 FAIL=0. New cases cover:ownerAdoption ... idleHoursin feedback-dispatch.test.mjs:3184, reads repository config this diff does not touch, so it comes from main.zizmor --offline: no findings.shellcheckon the test passes. Localactionlintreports onlyconcurrency.queue, which is already on main and which this local actionlint does not know.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01MWmASPDSoP4Ps23JPiGyZV