Repository navigation
perf(pr-merge): end an uncovered wake on one read - #15535
Conversation
A PR-scoped pr-merge wake whose newest lane merge no full dispatch run covers yet ends today at the fresh check's --stop-uncovered exit 6, after the last-report, carry, lane-records reads and the check's own floor, anchor, merge, pin and run reads. The wake now reads main's newest full dispatch run first (babysit_postmerge.py --uncovered-since, one call) and compares it with the newest first-parent commit the lanes App authored. When the run is older, the wake ends with the same needs-dispatch outcome and skips those reads; any other answer runs today's path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VQb9Q1HHi6JACp77x2ZbE7
The pre-check's notice and outcome line now end as today's exit-6 wake
does ("no dispatch run covers ... (needs-dispatch)"), so tooling keyed on
that tail still counts these wakes; report=none tells them apart from a
fresh check's report=fresh. The job header comment names the pre-check.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VQb9Q1HHi6JACp77x2ZbE7
Codex Review Summary: ✅ CompletedThis 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 #15535 (
|
|
claude-review reviewed Code review: perf(pr-merge): end an uncovered wake on one readNo findings. I read every hunk of all 5 changed files. Three of them are on trusted paths: What I checkedThe new step can only end a wake early. It cannot arm or disarm anything.
Every other answer runs the old path. The step uses The two time stamps compared,
A settled lane merge cannot cause a false stop. There is one known false-stop case. A lanes App PR that a person merged has the App as commit author, but the fresh check does not judge it ( The git lookup has the history it needs.
CLI wiring is correct.
Job timeout. The step sum goes from 43 to 44 with the new 1-minute step, and the job timeout goes from 44 to 45 to stay above it. Tests.
Other criteria
API use: each PR-scoped wake makes one more GITHUB_TOKEN listing call when the newest lane merge is covered, and at least 35 fewer calls when it is not (the PR's own estimate). This is rate-limit budget only. No billing is involved, so there is no hold. |
No related issue: hub GITHUB_TOKEN cut (D132, L550)
Summary
A PR-scoped pr-merge wake (
pr-merge: arm #N) that runs while a lane merge has no full dispatch run covering it reaches "needs-dispatch" only after the last-report, carry, lane-records and fresh-check reads (36 or more GITHUB_TOKEN calls, estimated below), and arms nothing. That gap lasts until the next full run of main, which the 30-minute cap delays. This PR adds a one-call pre-check that ends such a wake before those reads. No gate is weakened: the pre-check can only end a wake early, never arm one.Fix
babysit_postmerge.py --uncovered-since MERGED_AT --branch main(newest_dispatch_before,babysit_postmerge.py:2977;_uncovered_since,:3012) readspr-require-checks.ymlworkflow_dispatch runs on the branch withper_page=1. It keeps the rows_runskeeps (this repository, that event, that branch) and adds no filter of its own: no conclusion filter and no actor filter, because_stop_uncovered's first pass counts every listed dispatch run. It exits 6 when the newest run was created before MERGED_AT, or when there are no runs at all, because_stop_uncovered(:2961) would stop in that case. It exits 0 when a run is newer and 3 on an unreadable page or a newest row that is not such a run. It returns before the identity, floor, anchor and pin reads (main():5606-:5635).pr-merge.ymlenable-auto-merge, new step "Check whether a full run covers the newest lane merge" (pr-merge.yml:2540), PR-scoped runs only:.basecheckout whose author ismerge.agent-identity(git log --fixed-strings --author, since the login's[bot]is a regex class otherwise), using its commit date (%cI).uncovered=trueand prints a notice. The last-report, code-changed, carry read, run-cache start, lane-records and keep-report steps (:2570,:2607,:2657,:2696) now skip on that output.report=none outcome=skipped: the pre-check found a lane merge no dispatch run covers (needs-dispatch): the same tail as today's exit-6 wake, which readsreport=fresh.workflow.test.mjsrequires the job timeout to exceed the sum of the step timeouts.Why a wrong answer is safe:
shared_refusal, which requires the report to judge every merge the check would judge, and the idle settle passes no recompute. A report made after the merge carriesneedsDispatch, andidle_report_refusalrefuses it. The fresh check then stops at exit 6 (pr-merge.yml:2747,--stop-uncovered).%cI) when it builds the group, which is at or beforemergedAt. "Uncovered" therefore means that no run was created aftermergedAteither. The bias is toward "covered", which falls through to today's path and only gives up savings. It is largest when the group spent a long time in CI.Verification
Calls per gap wake, before and after. These are estimates until measured on real runs after merge.
last-report.mjs5,carry-run-cache.mjs read4,lane-records.mjs read1.settle --idle-tickrefuses on the report alone (idle tick needs-dispatch), with no reads.default_floor,lane_floor,_default_is_human(:5606-:5635)_merged_sinceGraphQL pages (:3092) and the pin prefetch (:3111)_dispatch_runs(:3166), then the exit 6unverified-stale, and 43118947929 armed. The pre-check reads covered for both and lets them through.per_page=1listing), plus a localgit log.Tests (verbatim counts):
python3 -m unittest discover -s plugins/source-control/skills/babysit-prs/scripts/tests -p "test_babysit_postmerge*.py":Ran 578 tests ... OK. The newUncoveredSinceclass (9 tests) covers:node --test .github/scripts/pr-merge/workflow.test.mjs:tests 117, pass 117, fail 0. New tests:scripts/check-changelog-fragments.sh --check-required origin/main: passes.Related
--stop-uncoveredis the existing stop this pre-check runs ahead of.session: GitHub Support
🤖 Generated with Claude Code
https://claude.ai/code/session_01VQb9Q1HHi6JACp77x2ZbE7