Repository navigation
fix(source-control): post-merge remediation disarms the lane's armed pull requests - #9538
Conversation
…pull requests babysit_postmerge.py --remediate now turns off native auto-merge on every open pull request into the judged branch that the agent identity both opened and armed, before it dequeues the identity's merge-queue entries. A pull request a person armed, or one the identity did not open, is left armed. Failures are reported as disarm: errors and do not stop the dequeue or the demotion issue. Closes #9518 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Record a failed lane merge" step now errors on a disarm: entry in the remediation report, as it does for demotion issue: and dequeue: entries. Also drops an issue number from a test comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A malformed page of the armed listing is now a read error instead of an empty listing, and a listing past the page limit still disarms what it read before reporting the error. babysit_merge.py reuses the postmerge disarm mutation, and the pr-merge.yml comment names the disarm. New tests cover the cursor, the judged branch, a malformed page and the page limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 No security issues found in this pull request (HEAD 0c62930). critical-findings: 0 I read the full diff (8 files) and the PR context. I also read the helpers the new code relies on in
I did not consult |
|
claude-review reviewed No findings. I read the full diff ( What I checked
The test results in the PR description (2743 Python tests, 42 Node tests) are the author's claims. I did not run them. |
Closes #9518
Summary
After a demotion,
babysit_postmerge.py --remediatedequeued the lane's merge-queue entries but left armed, not-yet-queued lanes App pull requests armed. Undermerge.lane-prs: native(#9508), GitHub could enqueue one of them before the next enable-auto-merge reader run disarmed it. Remediation now disarms them in the same run that dequeues.Fix
disarm_identity_pulls()inbabysit_postmerge.pyreads every open pull request into the judged branch (PostMergeArmed, 100 a page, at most 10 pages, the same limit asenable-auto-merge.mjs). It callsdisablePullRequestAutoMerge, the mutationenable-auto-merge.mjsdisarms with, on each one whoseauthorandautoMergeRequest.enabledByare both the agent identity. A pull request a person armed, or one the identity did not open, stays armed.nodesis not a list or whosepageInfois missing is a read error, as inenable-auto-merge.mjs, not an empty listing. A listing past the page limit still disarms what it read, then reports the overflow as a read error.remediate()runs the disarm before the dequeue and in a separate try block, so if one fails the other still runs. Disarming first means no armed pull request enters the queue after the dequeue has read it. The report gains adisarmedlist. A failed read or disarm is reported as adisarm: ...error. Every pull request is still tried, and the dequeue and the demotion issue still run. With no failure in the verdict, nothing is read or written, as before.babysit_merge.pyreusespostmerge.DISARM_MUTATIONinstead of its own copy of the same mutation.reference/guard-contract.mdnow list the disarm among the writes that--remediategates.pr-merge.yml, the "Record a failed lane merge" step's::errorfilter now also matchesdisarm:entries, so a failed disarm reports as an error like a failed dequeue or demotion issue, and the step's comment names the disarm.merge-job.test.mjscovers thedisarm:case.Token: the only
--remediatecaller is thatpr-merge.ymlstep. It runs under the lane token for activitymerge-pr, whose effectmergegrantspull-requests: write(.github/actions/resolve-config/effect-grants.json). That is the same grantenable-auto-mergedisarms with, so no token change is needed.Verification
uv run --with pytest python -m pytest plugins/source-control/skills/babysit-prs/scripts/tests: 2743 passed, 2132 subtests passed.node --test .github/scripts/pr-merge/merge-job.test.mjs: 42 passed; dropping thedisarm:filter turns one red.test_babysit_postmerge.pyRemediation:disarm:error.enabledBycheck or the author check turns two of the new tests red.Related
🤖 Generated with Claude Code