Read the state marker and PR lists without result limits#48
Open
Phlogistique wants to merge 1 commit into
Open
Read the state marker and PR lists without result limits#48Phlogistique wants to merge 1 commit into
Phlogistique wants to merge 1 commit into
Conversation
b9fe14d to
aaa135a
Compare
gh pr view --json comments returns the first 100 comments, so on a busy PR the state marker could fall outside the window and the resume would give up. Read the comments through gh api graphql --paginate, which walks every page, and keep the last marker among our own comments. The two gh pr list calls had the same shape of problem at their default limit of 30: a silently truncated fan-out, or a missed conflicted sibling letting the shared base branch be deleted. List pulls through gh api --paginate so every page is read. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JHvKryT4QUpHYdNq9YEQxX
aaa135a to
b8aa527
Compare
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.
Reworked from the original "raise the limit to 100", which only traded one arbitrary cutoff for another.
The real problem was the state-marker read:
gh pr view --json commentsreturns the first 100 comments, so on a busy PR the marker could fall outside the window and the resume would give up.read_state_markernow usesgh api graphql --paginate— gh walks the cursor itself via$endCursor/pageInfo— filtered to our own comments (viewerDidAuthor), keeping the last marker. Every comment is seen, no hand-rolled loop.The two
gh pr listcalls had the same shape of problem at their default limit of 30 (silently truncated fan-out; a missed conflicted sibling letting the shared base branch be deleted), so they now go throughgh api --paginatetoo.GITHUB_REPOSITORY(always set in Actions) is now required in conflict-resolved mode, since GraphQL has no{owner}/{repo}placeholder support.🤖 Generated with Claude Code
https://claude.ai/code/session_01JHvKryT4QUpHYdNq9YEQxX