Skip to content

Require a checked environment in wait_for_review - #74

Open
milos-plavsic wants to merge 1 commit into
prooflinedev:mainfrom
milos-plavsic:feature/require-checked-environment
Open

milos-plavsic wants to merge 1 commit into
prooflinedev:mainfrom
milos-plavsic:feature/require-checked-environment

Conversation

@milos-plavsic

Copy link
Copy Markdown

Require a checked environment in wait_for_review

A release job can wait for the right commit and still get a completed review that covers only staging. Both Python clients now accept required_environment_key on wait_for_review, so a job deploying to production can require the review to have checked production. How Proofline checks a change

The regression test uses one completed review for the requested head. Staging is CHECKED. Production is NOT_APPLICABLE because pull-request reviews are disabled on its repository link.

Environment requested Outcome What the caller learns
Omitted COMPLETED The usual review and assessment checks completed.
staging COMPLETED This review also checked staging.
production INCOMPLETE The target was skipped. The recorded reason points to the repository link setting.

Callers can already pin a wait to the revision they intend to ship with head_commit_sha. The new keyword checks the deployment target on that same review response. Callers identify the target by its external key because display names are not unique. Exactly one entry must match that key and report CHECKED; duplicate keys are ambiguous rather than an opportunity to select a favorable result. Commit-pinned waits in PR #49

Missing, duplicate, and unchecked targets produce distinct gap codes. The SDK uses fixed diagnostic text and retains the server's reason on the environment entry. The feature uses the existing API operation and permissions, with no extra request, dependency, public type, or generated-code change.

Verification

The implementation and tests passed the full Linux gate on Python 3.11.18, 3.13.12 (the CI pin), and 3.14.6 at upstream 9413015. Each run passed generation, contracts, Ruff lint and format, mypy, 230 tests, and 8 subtests. Each built the 7.1.0 wheel and source distribution and exercised sync and async clients from both installations. The HTTP tests used a local server and made no calls to the Proofline production API.

Across both clients, the tests preserve the existing request shape and cover omission and an explicit None, exact key identity, every fixed diagnostic, conflicting duplicate keys, unresolved assessment evidence, a running checked response followed by a completed response without the target, and a deadline expiring immediately after another review is decoded. Installed wheel and source-package smoke tests require production and preserve the existing WORLD_UNAVAILABLE gap alongside REQUIRED_ENVIRONMENT_UNAVAILABLE.

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