Repository navigation
fix(pr-pipeline): re-run a dispatched in-set post-merge red once before demotion - #9132
Conversation
…re demotion With --lane-merges-only, babysit_postmerge.check() now also marks a red attempt 1 of a full run pr-merge dispatched for post-merge-dispatch's one re-run when no judged lane merge covers it, if the run is under 90 minutes old and a newly failing check demotes by the affected-set rule. The existing step re-runs it only at attempt 1 and records it, so it never repeats; post-merge-demotion-alert.yml demotes only if that re-run is red. Closes #9126 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lane re-run lookback was a static 90 minutes tied to red-main.confirm-wait-minutes only by a comment. It is now that config value, read at the branch tip through read_config_at (default 40, valid 0 to 45 as red-main.mjs resolves it), plus a 50-minute full-run allowance, so the default stays 90 and raising confirm-wait widens it. Drop the selector's own actor check, which lane_dispatched repeats, and judge the lane record before the run's outcome so a run the lane did not send reads nothing more. Add lookback boundary tests at 89 and 91 minutes, tests that the lookback follows a changed confirm-wait, and a test that the repository's config gives 90 minutes. Refs: #9126 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… typo Refs: #9126 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the artifact read outcome() decides attempt-1 green runs from the run object, so checking it before lane_dispatched() skips an artifact listing per green run and keeps a failed artifact read on a green run from dropping the pass to a warning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 #9132 (head 602ba1d)Result: no security findings. No inline comments posted. The PR lets the pr-merge lane re-run a red full run once, even when no lane merge covers it. It adds a Checks
|
|
claude-review reviewed No findings. I read the full diff, the PR context and the surrounding code in What I checked
Worth knowing, not a finding
|
… its dispatch runs (#9167) Refs: #9145 ## Summary During GitHub's degraded-API window on 2026-10-22 (about 14:18-17:41Z), pr-merge's post-merge check read a dispatched-run listing that answered HTTP 200 without the runs it holds. It took that as "no dispatch run by the agent identity within 6 h" and filed demotion records #9081, #9088 and #9114, which set unattended merging to rung off. Both merges had passing lane-dispatched full runs at their merge commits. A lagging record listing also filed #9088 as a second record for #9081's failure. Root cause and evidence: #9145 (comment) ## Fix All changes are in `plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py`: - **Confirm the absence before failing.** Before the deadline failure, `_judge` reads the branch's dispatch runs at the merge commit by `head_sha`, with no `created` filter (`_Context.dispatch_runs_at`, cached per commit). A run there that the listing lacked raises `PostMergeReadError`, so the verdict is unreadable (pr-merge holds and files nothing) instead of a failure. When the by-SHA read also shows nothing, the failure stands. - **A short listing raises.** In this module's `_paginated`, an object listing whose `total_count` exceeds the items returned raises instead of reading as complete. This covers `_runs`, the new by-SHA read and the failed-jobs read. `babysit_gh.flatten_paginated_items` is unchanged for its other callers. `_baseline` and `affected` read a capped `per_page=20` page on purpose and are left out. - **Re-read before filing.** When no existing record matches a failure, the filer reads the record listing once more just before the POST, and files only when that read also lacks the record (`_record_of`). An empty artifact listing in `_lane_record` can still read as "not the lane's run". Telling that apart from a run that really is not the lane's needs a design choice, so it is left to a follow-up. ## Verification - `uv run --with pytest python -m pytest plugins/source-control/skills/babysit-prs/scripts/tests/ -q`: 2508 passed, 1952 subtests passed. - 10 new tests. Each test of changed behavior failed before the fix: - a dropped dispatch run gives an unreadable verdict; - the same with `--remediate` makes no issue POST; - an empty by-SHA read keeps the deadline failure (stay-loud); - a short `total_count` raises; - a record that appears on the second read is matched, not filed again. - `scripts/run-ruff.sh check` on the scripts directory: clean. `scripts/check-changelog-fragments.sh --check`: valid. - Live read-only probes: the by-SHA read returns run 39696300084 for 861bf26, and healthy listings return as many runs as their `total_count` (62 of 62 dispatch, 88 of 88 canary). ## Related - #9081, #9088, #9114: the false records. Closing them is the owner's re-arm. - #9132: post-merge red re-run, same file, already merged into this branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #9126
Summary
Owner decision (Issue Triage, 2026-10-22): a red post-merge full run that pr-merge dispatched,
with a failing suite inside the merges' affected set, gets one re-run before demotion, chosen by
pr-merge's
--lane-merges-onlyselector.Before this change, the selector marked a re-run only for a red run inside a lane merge's
attribution window. Two kinds of red got no re-run. One was a red with no lane merge since the
floor (the early return in
check()). The other was a red after every lane merge it contains wasverified (
in_window). Each waited out the alert's 40 polls and demoted on attempt 1 alone (the22-of-29 count in #8898).
Fix
babysit_postmerge.py: the new_lane_reruns()runs under--lane-merges-onlyafter the mergeloop, and also when no lane merge is judged. It lists
workflow_dispatchfull runs from thelast
LANE_RERUN_LOOKBACK(90 minutes), newest first. It marksRerun(lane=True)for each runthat meets all of these:
RERUN;github-actions[bot];lane_dispatched(has thepr-merge-dispatched-<id>record);regressions(...)non-empty, which is the same baseline, affected-set and quarantine rule--judge-runapplies.ctx.quarantines, so--remediatefiles no quarantine for these runs; thealert's
--judge-run --file-quarantinealready does that. A failed read becomes alane-rerun-unreadable:warning, so the probe cannot make the merge gate's verdict unreadable.Re-run a red lane-dispatched full runstep in pr-merge.yml re-runs only atrun_attempt == 1and recordspr-merge-rerun-<id>-attempt-2. Once attempt 2 exists, the outcome is no longerRERUN.red-main.confirm-wait-minutesfor the bot'sattempt 2, files nothing when that attempt passes, and judges attempt 2 when it fails.
pr-merge.yml,post-merge-demotion-alert.yml,docs/conventions/pr-pipeline/README.md("Red main") andscripts/post-merge-demotion-alert.test.sh. A changelog fragment is added forsource-controland one for
pr-pipeline.Verification
LaneRerunOutsideAWindowtests intest_babysit_postmerge_quarantine.pyfailed 2 of 7 before the fix: the in-set red was not marked, and there was no warning on an
unreadable record.
scripts/post-merge-demotion-alert.test.shpasses (152 passed, 0 failed);check-changelog-fragments.sh --check-required origin/mainpasses.scripts/post-merge-demotion-alert.test.shcase "a dispatchedred per-merge run whose re-run passes files nothing";
fix issue" (
RERUN=failure).LaneReruntests cover a bot attempt 2 that passes (aflake) and one that fails (red).
Related
🤖 Generated with Claude Code