Repository navigation
fix(pr-merge): re-read the head before closing an empty-diff pull request - #17689
Conversation
…uest decide judges the diff empty from the changed-files read made earlier in the run, and the close was a plain PATCH with no head check between them, so a push in that window closed a pull request that now changes files. The close now reads the pull request's head again first and leaves it open, with no disarm, close or note, when the head is not the one judged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 (incremental, blocking only): no security issues found. This review covers only the changes since
critical-findings: 0 |
|
claude-review reviewed Code review: PR #17689, incremental since This push changes one file, The new test is a PR-scoped
That assertion now fails if the outcome override at The env literal it passes matches the module's No new findings. This review was blocking only, because the lane already reviewed an earlier head. Loosened checks would be marked: fail (the default, because the wrapper wrote no No closing issue: the PR names none, so there are no acceptance criteria to check. I found no embedded directives in the PR context. Verifier dropped 0 of 0 candidates. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: review advisory from pr-pipeline-sandbox#403 on synced code
Summary
enable-auto-merge.mjscloses a lanes App pull request whose diff against main is empty.decidejudges the diff empty from the changed-files read made earlier in the run, and the close was a plainPATCH state: closedwith no head check in between, so a push in that window closed a pull request that now changes files.Fix
Before the disarm and the close, the close path reads the pull request again (
GET /repos/{repo}/pulls/{n}) and leaves it open, with no disarm, close or note, when its head is not the head the run judged. The run logsleft open: its head moved to <sha> after its diff read empty, and a PR-scoped run hands on that reason as its outcome instead of the empty-diff refusal; the next run judges the new head. A failed read goes to the existing catch: it counts as a failure and the next sweep tries again. This is the same fresh-head read the approval lift already makes before its label delete.Verification
node --test --test-concurrency=4 .github/scripts/pr-merge/enable-auto-merge.test.mjs: 247 pass, 0 fail. The new test, "an empty-diff pull request whose head moved after its diff read is left open", checks that an armed empty-diff pull request whose head moved gets no disarm, no close and no note.scripts/check-affected.sh: 13 passed, 7 skipped.Related
🤖 Generated with Claude Code