Skip to content

fix: paginate GraphQL review thread fetches in PR helper scripts#715

Merged
strawgate merged 3 commits intomainfrom
fix-issue-714-review-thread-pagination-c19feafe1087f613
Apr 14, 2026
Merged

fix: paginate GraphQL review thread fetches in PR helper scripts#715
strawgate merged 3 commits intomainfrom
fix-issue-714-review-thread-pagination-c19feafe1087f613

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

This PR fixes dropped review-thread data on large pull requests by adding full GraphQL cursor pagination in both affected scripts.

What changed

  • Updated claude-workflows/pr-review/scripts/pr-existing-comments.sh:
    • Added pagination for reviewThreads(first: 100) using pageInfo.hasNextPage/endCursor.
    • Added pagination for nested thread comments (comments(first: 50)) per thread.
    • Preserved existing output shape consumed by downstream formatting/filtering.
  • Updated claude-workflows/mention-in-pr/scripts/gh-get-review-threads.sh:
    • Added pagination for reviewThreads and nested comments.
    • Preserved output behavior, including optional author filter handling.
  • Added regression tests in tests/test_review_thread_pagination.py:
    • Verifies threads are fetched across multiple pages.
    • Verifies comment conversations exceeding 50 comments are fully collected.

Validation

  • make test could not run in this environment initially because uv is unavailable.
  • Created an isolated venv and ran equivalent pytest validation directly:
    • python -m pytest tests/test_review_thread_pagination.py tests/test_safe_input_ready_to_make_pr.py -q
    • Result: 34 passed

Closes #714.


What is this? | From workflow: Trigger Framework Best Practices

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

github-actions bot and others added 2 commits March 16, 2026 13:50
Add cursor-based pagination for reviewThreads and nested comments in both PR review helper scripts to avoid dropping data on large pull requests. Includes regression tests with a stubbed gh GraphQL client to validate pagination beyond single-page limits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added the medium_boom Medium PR blast radius; likely benefits from human review label Mar 16, 2026
@strawgate strawgate marked this pull request as ready for review March 24, 2026 19:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@strawgate has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c95ef0c-f3a0-413c-9db3-a3b136c3646c

📥 Commits

Reviewing files that changed from the base of the PR and between e2acd5e and 3bd5002.

📒 Files selected for processing (3)
  • claude-workflows/mention-in-pr/scripts/gh-get-review-threads.sh
  • claude-workflows/pr-review/scripts/pr-existing-comments.sh
  • tests/test_review_thread_pagination.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-issue-714-review-thread-pagination-c19feafe1087f613
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@strawgate strawgate merged commit 707fc67 into main Apr 14, 2026
25 checks passed
@strawgate strawgate deleted the fix-issue-714-review-thread-pagination-c19feafe1087f613 branch April 14, 2026 17:17
strawgate added a commit that referenced this pull request Apr 14, 2026
Recompiles lock files to reflect merged changes from PRs:
#903, #901, #890, #885, #881, #866, #856, #814, #715

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

medium_boom Medium PR blast radius; likely benefits from human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[framework-best-practices] Paginate GraphQL review thread fetches to avoid dropping comments on large PRs

1 participant