Skip to content

Add iter_pull_request_reviews pagination helper to sync and async clients - #125

Open
aman179102 wants to merge 1 commit into
prooflinedev:mainfrom
aman179102:feature/iter-pull-request-reviews
Open

aman179102 wants to merge 1 commit into
prooflinedev:mainfrom
aman179102:feature/iter-pull-request-reviews

Conversation

@aman179102

Copy link
Copy Markdown

Summary

This PR adds iter_pull_request_reviews to both synchronous (ProoflineClient) and asynchronous (AsyncProoflineClient) clients to streamline cursor pagination across all reviews of a pull request.

Context & Problem

While iter_reviews was available for general reviews and iter_export_pages for exports, iterating reviews scoped to a specific pull request via list_pull_request_reviews required manual cursor tracking, bounds checking, and loop management.

Key Changes

  • ProoflineClient.iter_pull_request_reviews: Synchronous iterator yielding ReviewSummary across pages.
  • AsyncProoflineClient.iter_pull_request_reviews: Asynchronous iterator yielding ReviewSummary across pages.
  • Validation & Limits: Adheres to _page_limits, cursor cycle detection via seen, and limits on max_pages and max_items.
  • Comprehensive Tests: Added test_pull_request_reviews_iteration in tests/test_http.py validating multi-page pagination, query parameter preservation, and boundary error handling in both sync and async modes.
  • Documentation: Updated README.md noting iter_pull_request_reviews availability.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant