Skip to content

Add wait_for_reviews: wait for several reviews under one shared deadline - #165

Open
mamane19 wants to merge 5 commits into
prooflinedev:mainfrom
mamane19:wait-for-reviews
Open

mamane19 wants to merge 5 commits into
prooflinedev:mainfrom
mamane19:wait-for-reviews

Conversation

@mamane19

@mamane19 mamane19 commented Dec 3, 2026

Copy link
Copy Markdown

What

Adds wait_for_reviews(organization_id, review_ids, *, timeout=300, head_commit_shas=None) -> dict[UUID, ReviewOutcome] to both ProoflineClient and AsyncProoflineClient, a README section under the wait docs, and tests in tests/test_wait_reviews.py.

Why

wait_for_review covers one review. Batches that must not run past a cutoff, a release train or a nightly re-review sweep, currently make every caller roll its own deadline loop, and a caller that waits one review after another can blow past its cutoff because the later waits never see the time already spent.

How

  • Every review keeps its own polling, retry and commit-pin policy; the batch holds all of them to one deadline computed before the first wait.
  • The sync client waits in the order given, each wait budgeted from what is left of the shared deadline. The async client waits concurrently under one anyio task group, so one slow review cannot delay the others past the deadline they all share.
  • A review that would start after the deadline has passed returns TIMED_OUT without a request. timeout=0 reads each review once. A review named twice is waited on once.
  • An error on one review records a FAILED outcome for that review carrying the error's detail while the others keep going; a deadline error surfaces the same way it does in wait_for_review.
  • timeout and every entry of head_commit_shas are validated before any request is made.
  • tests/test_wait_reviews.py covers the shared deadline under both clients, per-review error capture, dedupe, and pre-request validation. tests/test_http.py is untouched.

Checks: full suite 241 passed. One note: tests/test_generated_operation.py::test_new_public_operation fails on a pristine checkout too (it shells out to the generator), so it is unrelated to this change.

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