Repository navigation
feat: add iter_pull_request_reviews helper for paginating PR review runs - #90
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Add
iter_pull_request_reviewsiterator method to bothProoflineClientandAsyncProoflineClient, providing bounded cursor-based pagination over a specific pull request's review runs (/api/v1/organizations/{org_id}/reviews/pr/{repository}/{pull_request_number}).Problem
The SDK provides
iter_reviewsto traverse organization-level latest reviews (/api/v1/organizations/{org_id}/reviews), but exposes only single-page retrieval (list_pull_request_reviews) for pull-request review history. When an engineering workflow inspects the historical progression of reviews on a given pull request across multiple runs or iterations, callers must write custom cursor tracking, cycle detection, and pagination bound loops.Solution
iter_pull_request_reviewstoProoflineClientreturningIterator[ReviewSummary].iter_pull_request_reviewstoAsyncProoflineClientreturningAsyncIterator[ReviewSummary]._page_limits,_next_cursor, and_pagination_limit, supportingpage_size,max_pages,max_items, and optionalfilters.iter_pull_request_reviewsinscripts/contracts.pyhelper registry to maintain public contract validation.tests/test_http.pycovering:repository,pull_request_number, query filters)max_pagesandmax_itemsboundsTests
Ran native test suite and linters locally:
pytest tests/test_http.py -k "test_iter_pull_request_reviews": 2 passed in 0.84s (sync and async).pytest tests/test_exports.py: 14 passed.ruff check .: All checks passed.ruff format --check .: 237 files already formatted.mypy proofline scripts: Success (no issues found in 228 source files).python scripts/contracts.py: Python operation and outcome-vocabulary contracts passed.pytest -q): 221 passed, 8 subtests passed.Risk
None. This is an additive convenience method that does not modify existing method signatures or REST models.