Repository navigation
feat: first-class handlers, validation, and documentation for deploy verifications and scans - #94
Open
AnkitaPriyadarshini-repos wants to merge 5 commits into
Open
AnkitaPriyadarshini-repos wants to merge 5 commits into
AnkitaPriyadarshini-repos wants to merge 5 commits into
Conversation
…loy-verifications-and-scans feat: add first-class handlers and validation for deploy verification…
…-verifications-and-scans docs: document commit deploy verifications and scan requests
This was referenced Nov 23, 2026
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.
Summary
This pull request introduces first-class client methods, pre-request validation, package exports, and documentation for two public OpenAPI operations that previously fell through to raw generated stubs:
get_commit_deploy_verifications(GET /api/v1/organizations/{org_id}/repositories/{repo_id}/commits/{commit_sha}/deploy-verifications):ProoflineClientandAsyncProoflineClient._head_commit(commit_sha)(requiring a full 40- or 64-character hexadecimal SHA).organization_id,repository_id) and backward-compatible aliases (org_id,repo_id) with conflict detection.CommitDeployVerifications.request_scan(POST /api/v1/organizations/{org_id}/repositories/{repo_id}/scans):ProoflineClientandAsyncProoflineClient.ScanRequestBodyand decodesScanResponse.Models & Code Generation:
_resolve_id()helper to handle canonical and alias IDs consistently across client operations.CommitDeployVerificationsat the package root.proofline/_generated/api/operations.pyviascripts/generate.py, cleanly excluding operations with hand-written client adapters.Problem & Motivation
The public OpenAPI contract defines operations for checking commit deployment verifications and triggering repository scans. In the Python SDK:
proofline/client.py, leaving callers to interact with raw generated methods inOperations/AsyncOperations.org_idandrepo_id, creating an ergonomic discrepancy with the rest of the hand-written client which standardizes onorganization_idandrepository_id.wait_for_review,get_commit_deploy_verificationsdid not perform client-side hexadecimal SHA validation, permitting malformed or non-commit strings to reach the server.CommitDeployVerificationswas not exported from the top-levelprooflinepackage namespace alongsideScanRequestBodyandScanResponse.Implementation & Trade-offs
_resolve_id()Helper: Resolves either canonical or alias parameters cleanly. If callers pass both with identical values, execution proceeds normally; if conflicting values are provided, a descriptiveValueErroris raised immediately._head_commit()Pre-flight Check: Reuses existing commit validation logic to reject non-hexadecimal, truncated, or branch-name inputs prior to HTTP execution.ProoflineClientandAsyncProoflineClientare automatically excluded fromproofline/_generated/api/operations.pybyscripts/generate.py, preventing duplicate method signatures or maintenance drift.README.mdwith idiomatic examples for both operations.Proofline Self-Review Evaluation
Before opening this upstream pull request, these changes were deployed to our fork (
ankita-proofline-eval/sdk-python) and evaluated in an end-to-end self-review workflow using the installed ProoflineDev GitHub App (fork PR #2).Proofline's automated review analyzed the changes and provided 4 actionable findings on our documentation snippets:
deploy.statusAttributeError (Serious): Proofline detected that theget_commit_deploy_verificationsexample referenceddeploy.status, whereas the underlyingCommitDeployVerificationmodel attribute isdeploy.state.ScanRequestBodyTypeError (Serious): Proofline detected that initializingScanRequestBody(budget_credits=100)omitted the requiredrequest_id: UUIDparameter.get_commit_deploy_verifications.All 4 findings were evaluated, verified against the model contracts, and fixed in commit
a654dbebefore opening this upstream pull request.Verification
The full test and verification suite passes locally with zero errors:
Added 8 new unit tests in
tests/test_http.pyacross sync and async modes testing:organization_id,repository_id).org_id,repo_id).ValueError).TypeError).