Skip to content

Add bounded PR review history iteration using shared pagination - #114

Open
jabbertones-cloud wants to merge 1 commit into
prooflinedev:mainfrom
jabbertones-cloud:add-pr-review-history-pagination
Open

jabbertones-cloud wants to merge 1 commit into
prooflinedev:mainfrom
jabbertones-cloud:add-pr-review-history-pagination

Conversation

@jabbertones-cloud

Copy link
Copy Markdown

Problem

An SDK consumer that needs a pull request's complete review history currently has to implement its own cursor traversal and limits around list_pull_request_reviews.

Implementation

Adds iter_pull_request_reviews to both clients. Extracts the existing iterator loop into a private helper for each sync/async client so organization-wide and PR-scoped iteration use the same page/item bounds, cursor checks and error behavior. The request callback preserves organization, repository and PR coordinates; caller filters are copied rather than mutated. The public-operation contract and README are updated.

Addresses #101. I noticed #90, #102 and #108 cover the same feature. This is an independently implemented alternative that shares the full existing iterator loop rather than introducing additional copies of it. Happy for maintainers to choose one approach or use only the useful tests.

Verification

Base: 663f4d8b0cb7f00a986d98d042332cc4b0c0fd44.
Tested head: 53f74b0c5434865f50e27ae263ef07209b29ab3c.

  • Full SDK test suite: 234 passed on Linux and macOS (Python 3.12).
  • Public operation/outcome contract: passed.
  • Ruff lint and formatting: passed.
  • mypy: passed.
  • Exact-tree replay with the same new tests plus existing pagination/public API tests: original 4/20, candidate 20/20. The original lacks the requested method; this is a feature regression comparison, not a claim that the original SDK is generally broken.
  • New tests exercise local HTTP requests in both modes, scoped URL encoding, unchanged filters, missing/repeated cursors, page/item bounds and validation before transport.

Reproduce with the repository's pinned development dependencies, then python -m pytest -q, python scripts/contracts.py, python -m ruff check . and python -m mypy proofline.

No live service credentials were used. The change is scoped to SDK behavior; generated API code and server behavior are unchanged. AI assistance was used to research, implement and test this contribution.

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