docs(merge-gate-watcher): ask git whether a PR merged, and reach REST when GraphQL is dead - #177
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Self-review (Copilot has been quota-blocked all day across both repos, so this is the review of record — and re-requesting a fourth time is the exact "retry into a known-exhausted resource" this PR argues against). Two findings, both fixed here rather than after merge. The false-positive example was unverified prose. It said "a months-old dependency bump mentioned The ancestry check silently fails under squash. A squash merge writes one new commit with a new hash, so the original head is never an ancestor and the check reads "not merged" forever — a watcher built on this advice would hang in any squash-merge repo. Added the limit and the one-REST-call alternative. This is the finding I care about: the recommendation was correct for the repo I was standing in and wrong as a general rule. Refutations that did not hold:
|
… when GraphQL is dead Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
A squash merge writes a new commit, so the original head is never an ancestor and the check would read 'not merged' forever. Found while reviewing the patch, not after shipping it. Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
2e52e71 to
6863568
Compare
|



Two additions to
merge-gate-watcher.md, both from burning the GraphQL budget twice in one session while doing nothing unusual."Has it merged yet?" needs no API at all
The existing "Watcher cost" section makes a watcher cheaper — one per subject, REST over GraphQL, 180 s. It does not say that the commonest watcher question is free: once a PR is queued, the only thing left to learn is whether its head landed on the base, and
git merge-base --is-ancestoranswers that from the local graph. It keeps working while both budgets are exhausted, which is exactly when a watcher is still running.Added with the trap that bit me:
git log --grep="#<pr>"is not that test.--grepsearches the whole commit message, so an older commit whose body mentions the number matches. A watcher on PR #765 reportedMERGEDfrom its first tick because a months-old dependency bump mentioned that number; the PR was actuallyCONFLICTING. Same asymmetry as the section's own empty-result rule, inverted — an empty result is first a broken query, and a positive result from a text search is first a coincidence.REST still opens a PR when GraphQL is dead
gh pr createis GraphQL. Withgraphql: 0/5000andcore: 4700/5000the wholegh pr *surface is unusable while REST is fine, andgh api repos/$O/$R/pulls -X POSTtakes the same arguments. Same for PR comments. Both used on 2026-08-13 to finish work thatgh pr createrefused.Plus one flag trap found next to it:
gh api --paginate --slurpis rejected together with--jq, so paginated check-runs need a file and thenjq.Not added
The section already says to sleep to the reset in one background command rather than retrying into the limit. I violated that rule rather than found it missing, so it needs no more prose.