Repository navigation
pr-gate: read every rollup page, fail closed on an incomplete one - #866
Merged
Merged
Conversation
… is incomplete The MR-34 rewrite dropped the rollup-pagination checks that #698 added. The gate asked for contexts(first: 100) and only logged hasNextPage, then judged the first 100 checks: a failure or a newer re-run on a later page was missed (--required all could report green, a stale verify could report red or green). When the first page says there is more, the gate now reads the following pages of the same commit (one extra query per page, only then), and judges nothing for that poll when a page is malformed, repeats a cursor, belongs to another commit, fails to load, or the rollup exceeds 1,100 checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
scripts/pr-gate.mjsasked forstatusCheckRollup { contexts(first: 100) }and only loggedhasNextPage, then judged the first 100 checks. #698 (RR-87,rr-87-gate-rollup-completeness) had added pagination with a fresh-cursor, same-commit and count check; the MR-34 rewrite (#808) dropped it.Is it a real gap?
Yes, in principle. A full-ci PR reports about 50 checks, so the 100-item page normally covers it, but nothing enforced that. With more than 100 contexts, the gate judged a partial list:
--required all: a failure on a later page was never seen, so it could report green.--required verify:latestPerNamepicks the newest report per name, so an olderverifyon page 1 and its re-run (or a newer failure) on page 2 gives the wrong verdict, red or green.Fix
endCursor.hasNextPageis true the gate reads the following pages of the same commit (readAllChecks, one extra query per page, only when needed; the batched poll stays one query per interval).MAX_CONTEXT_PAGES), the gate judges nothing that poll (logs it, retries next interval, times out with 75 at worst). It never reports green or red from a partial list.Tests
scripts/pr-gate.test.mjs: page size and cursor in the query, a failure hidden on page 2, a re-run on page 2, three pages, commit targets, no extra query for a small rollup, and each fail-closed case (failed query, other commit, missing commit, malformed page, repeated cursor, missing cursor, endless rollup, healing on the next poll).No changelog fragment (tooling).
pnpm check:changedpasses.🤖 Generated with Claude Code