Skip to content

Add iter_pull_request_reviews with tests and README - #108

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

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

Conversation

@arjunsreelatha

@arjunsreelatha arjunsreelatha commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

solves #101
Setup of the tools and enviornment completed
list_pull_request_reviews returns one page, and nothing followed its continuation cursor. Callers that need every review on a pull request had to loop over cursors themselves and re-implement the cycle and bound checks. This PR adds iter_pull_request_reviews to ProoflineClient and AsyncProoflineClient, mirroring iter_reviews.

Behaviour

  • Follows next_cursor while truncated is true, keeping the organization, repository, and filters on every request.
  • Accepts page_size (1..100), max_pages (1..1000), and max_items (1..100000). Bounds must be integers, and invalid values raise ValueError before any request.
  • A repeated or missing cursor on a truncated page raises urn:proofline:sdk:invalid-pagination.
  • If a bound is reached while more reviews remain, the iterator raises urn:proofline:sdk:pagination-limit without requesting another page. Finishing exactly at a bound is a normal end.
  • iter_reviews gets the same item-budget check, since it shares the loop.

Verification

  • Tests in tests/test_http.py (sync and async) cover:
    • cursor following, with filters preserved on each request
    • the success path with bounds set
    • distinct review IDs on each page
    • a repeated cursor, checking the second request sends it
    • a missing cursor, which fails on the first page
    • a bound exhausted within one page, and across pages
    • page_size=0 and fractional max_pages, rejected before any request
  • pytest tests: 220 passed.
  • ruff check and ruff format --check: clean.
  • mypy proofline: no issues.
  • Proofline review run 8 on commit 4798844: no findings.
  • README gained a "Pull request reviews" section with a runnable example.

Environment note: the test run uses the pinned dev tools from requirements-dev/pyproject.toml (pytest 9.2.0, pytest-asyncio 1.4.1, openapi-python-client 0.30.0).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ToC6VqPiYK8mT7841aWJtF

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