Repository navigation
Add iter_pull_request_reviews to stream a pull request's review runs - #148
Closed
bobby-nandigam wants to merge 1 commit into
Closed
bobby-nandigam wants to merge 1 commit into
bobby-nandigam wants to merge 1 commit into
Conversation
list_pull_request_reviews returns a single page, so reading every review run of a pull request meant driving continuation cursors by hand, even though list_reviews already has iter_reviews for exactly this. Add iter_pull_request_reviews to the sync and async clients, mirroring iter_reviews: it reuses the shared page-bound, cursor-cycle, and item-bound helpers, preserves the organization, repository, pull request, and filters on every request, and raises the same invalid-pagination and pagination-limit errors so a partial traversal never looks complete. Cover both clients with a parametrized test and document the method in the README.
Author
|
Closing in favor of #149 (wait_for_merge_gate), which I'm leading with. |
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.
What this adds
iter_pull_request_reviewson bothProoflineClientandAsyncProoflineClient: a lazy iterator that streams every recorded review run of a single pull request across pages.Who it helps
A pull request accumulates a new review run on each push, rerun, and re-trigger, so inspecting its full history means walking several pages.
list_reviewsalready pairs withiter_reviewsfor exactly this, butlist_pull_request_reviewshad no equivalent — callers had to drivetruncated/next_cursorby hand and re-implement cursor-cycle and traversal-bound protection. This closes that asymmetry with a method that reads like the one engineers already know.Decisions
iter_reviewsone-to-one and reuses the existing_page_limits,_next_cursor, and_pagination_limithelpers rather than duplicating pagination logic.page_size,max_pages,max_items,filters), the same filter passthrough, and the sameurn:proofline:sdk:invalid-pagination/urn:proofline:sdk:pagination-limiterror types, so a partial traversal can never look complete.proofline/_generated/or the OpenAPI contract — in line with the contribution boundary stated in the README.Verification
ruff check,ruff format --check, andmypyare all clean.