Repository navigation
fix(pr-status): hold --watch when a queued PR reads OPEN without an entry - #482
Conversation
…ntry On netresearch/typo3-ai-edition#13, --watch printed four "waiting: already in the merge queue" polls and then "ACTIONABLE: merge" on state OPEN, CLEAN and no queue entry. The queue merged the PR about a minute later, and the timeline records no drop before the merge. A caller acting on that line enqueues again or merges a PR that is merging. The NEXT ladder only reaches merge when queue_entry is null, and the watch loop kept no memory of the previous poll. It now remembers that the PR was queued. When a later read shows it OPEN without an entry, the watch re-reads until the PR is MERGED or queued again, for at most PR_STATUS_QUEUE_EXIT_GRACE seconds (default 120). After that it reports what it sees, preceded by a pr-status: line saying the queue did not merge the PR. A TIMEOUT inside the hold says the same. Whether GitHub drops the entry just before recording the merge, or the entry read transiently null mid-queue, is not established; the hold covers both. merge-gate-watcher.md no longer calls the GraphQL read the settled verdict and records the observation. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Review of 1268e3f (author's own review; Copilot is out of review quota and CodeRabbit refused this head as rate limited, so no bot review ran). Correctness: the hold sits after a successful snapshot and before every exit, so no ACTIONABLE line (including the check-failed exit) is printed while a PR that was queued on an earlier poll reads OPEN without an entry. It ends on a read with an entry ( Tests: Sonar: 6 new S7688 findings ("use Known limits are in the PR body: only a PR seen queued under the same watch is held, and a newly failing check is not reported during the bounded hold. |
|
Self-review: 1268e3f The bot review this pull request demands is unsatisfiable (Copilot quota wall or repeated bot failures on this head). The diff on this head was reviewed by the PR author; this comment is the on-the-record attestation the merge gate reads back. It stops matching on the next push. |



After this merges,
pr-status.sh --watchno longer returnsACTIONABLE: mergeon the read where a PR that was in the merge queue now reads OPEN without a queue entry. It re-reads until the PR is MERGED or queued again, for at mostPR_STATUS_QUEUE_EXIT_GRACEseconds (default 120), and then reports what it sees with apr-status:line saying the queue did not merge the PR.What was observed
On netresearch/typo3-ai-edition#13 (2026-11-22),
--watchprinted fourwaiting: already in the merge queue at position 1 (AWAITING_CHECKS)polls, thenACTIONABLE: mergewithstate: OPEN mergeable=MERGEABLE mergeState=CLEANandNEXT: merge — clean. The PR timeline showsadded_to_merge_queueat 21:07:28Z, thenmergedandremoved_from_merge_queue(reasonmerged) at 21:09:12Z, with nothing in between. A caller acting on that line would enqueue again or try to merge a PR that is merging.The NEXT ladder reaches
mergeonly whenqueue_entryis null (thequeue_entry != nullrung returnswaitbefore it), so that read had state OPEN and no entry. Whether GitHub drops the entry just before it records the merge, or the entry read transiently null mid-queue, is not established. The hold covers both.Known limits
--max-wait.Testing
tests/test_pr_status_watch_queue_exit.shdrives the watch through stubbed GraphQL reads, one phase per poll: queued → open → open → merged (nomerge, returns on MERGED), queued → open → queued (keeps waiting), queued → open past the grace (returnsmergewith the caveat line, which the documented Monitor filter keeps), the TIMEOUT inside the hold, and a PR never seen queued (returnsmergeat once). Withpr-status.shreverted tomain, the first two cases and the caveat/TIMEOUT cases fail and the output reproduces the reportedNEXT: merge — clean.