Repository navigation
prs merge: leave an already-merged PR alone instead of trying to repair it - #102
Merged
Merged
Conversation
…ir it A PR merged between the search and the read came back state=MERGED, and --fix still ran it through the repair path: mergeStateStatus=UNKNOWN reads as updatable, so the sweep asked GitHub to merge the base into a head branch the merge had just deleted. The output was two alarming lines -- FIXING then FIXME "Could not resolve head ref" -- about a PR that was simply already done. Repair is for open PRs. Gate the --fix block and isUpdatable on state, so a settled PR falls through to the ordinary SKIP state=MERGED. Same root cause in Gh.pullRequest: mergeable=UNKNOWN means "ask again" only while a PR is open. A merged one rests there for good, so every read spent the full five attempts -- eight seconds per merged PR -- waiting out a verdict that was never coming. Return a non-open PR on the first read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan23 finding(s) HIGH/CRITICAL: 4 | MEDIUM: 10 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
A sweep printed this about crawlproof.com#316:
The PR was merged between
gh searchandgh pr view. Merging deletes the head branch, soupdate-branchhad nothing to resolve. Two alarming lines about a PR that was simply already done.isUpdatablenever looked atpr.state, and a merged PR reportsmergeStateStatus=UNKNOWN, which reads as updatable.The fix
Repair is for open PRs. Gate the
--fixblock andisUpdatableonstate === 'OPEN'; a settled PR falls through to the ordinarySKIP … state=MERGED.Same root cause in
Gh.pullRequest:mergeable=UNKNOWNmeans "ask again" only while a PR is open. A merged one rests there permanently, so every read spent all five attempts — 8s per merged PR — waiting out a verdict that was never coming. Non-open PRs now return on the first read.Tests
Three added;
prs-mergesuite 41/41 green,tsc --noEmitclean. The suite also dropped from 5.5s to 0.5s, which is the polling fix showing up directly.test/root-ubuntu.test.tshas 6 failures on this box; verified identical on a reverted tree, so pre-existing and unrelated.🤖 Generated with Claude Code