Repository navigation
Wait for a deployment review by its public key - #55
Open
coolman-97 wants to merge 1 commit into
Open
coolman-97 wants to merge 1 commit into
coolman-97 wants to merge 1 commit into
Conversation
A deploy job knows its deployment's public key, not the review id, so it had to poll get_deployment_review itself and decide when the review had settled. wait_for_deployment_review does that on both clients with the same deadline, backoff and outcome rules as wait_for_review. The first response pins the review id. A key that later resolves to a different review raises an invalid-response error instead of returning another review's result.
coolman-97
force-pushed
the
feat/wait-for-deployment-review
branch
from
November 16, 2026 17:44
d1edc71 to
6399d98
Compare
Member
|
Codex review: Validate the first response against the requested deployment key and require DEPLOYMENT kind before reporting completion. |
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.
Who this helps
A deploy job knows its deployment's public key, not the review id. Today it has to call
get_deployment_reviewin its own loop and decide when the review is settled, which means copying the deadline, backoff and completion rules thatwait_for_reviewalready owns, or getting them subtly wrong (treatingCOMPLETEDwith missing check receipts as a pass, for example).wait_for_deployment_review(organization_id, public_key, *, timeout=300)on bothProoflineClientandAsyncProoflineClientgives that job one call that returns the sameReviewOutcomea review wait does:Decisions
outcome(..., review_id=...), so if the key starts resolving to a different review the wait raisesurn:proofline:sdk:invalid-responseinstead of returning another deployment's verdict. The pin is also applied to the finalTIMED_OUToutcome, so a drifted record is never retained as the last observation.FAILEDvsSTOPPED, the 5s to 60s backoff, the sharedDEADLINEbudget and the "transport timeout at the deadline meansTIMED_OUT" behavior all come from the existing code paths. The timeout validation moved into a small_wait_timeouthelper that both waits use.review_url. Once the id is known it is the normal review URL. If the wait times out before any response, it falls back to/orgs/by-id/{org}/reviews/deployments/{key}with the key percent-encoded. I couldn't confirm that console route from the public contract; happy to switch the fallback to whatever the console actually serves.proofline/_generated/changed.scripts/contracts.pylists the new method as a hand-written helper next towait_for_review.Verification
New tests in
tests/test_http.py, each run for sync and async against the loopback server:[5, 10]delays and reports the pinned review URLinvalid-responseand stops pollingtimeout=0: no request,TIMED_OUT, deployment URL; a 30s budget keeps the last running record and the review URL; negative,infandnantimeouts are rejectedpython scripts/check.py(generation check, contracts, ruff, mypy, full pytest, wheel and sdist install smoke) passed on Ubuntu via this repo's ownChecksworkflow on my fork: https://github.com/coolman-97/sdk-python/actions/runs/43921450158One note from running locally on Windows:
generate.py --checkreports a diff there becausewrite_textemits CRLF, and two deadline tests (test_streaming_and_resolution_keep_deadline_outcomes_explicit,test_body_stream_deadline_does_not_turn_authority_into_timeout) are timing sensitive on Windows. Both happen on a cleanmaintoo and are unrelated to this change.