Repository navigation
Read deployment reviews and hold a deploy job to them - #64
Closed
Olagold-hackxx wants to merge 1 commit into
Closed
Olagold-hackxx wants to merge 1 commit into
Olagold-hackxx wants to merge 1 commit into
Conversation
findings --deployment reads a deployment review by its public key through the review API's deployment operation, and refuses a reply that is another review or not a deployment review. ci deployment waits for the deployment review of the commit being deployed and reports it with the exit codes of ci review, including --fail-on. It only reads: the review API has no operation that requests one.
Member
|
Codex Closing as out of scope for the CLI. |
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
Engineers who deploy with Proofline connected. Today the CLI can read and gate on a pull-request review, but not on a deployment review:
get_deployment_reviewis in the pinned contract (GET …/reviews/deployments/{public_key}), and no command calls it. Someone who has arev_…address from the console cannot read that review in a terminal.ci reviewwaits only forPULL_REQUESTreviews. The existing test even records that "a deployment review of the same commit is not the pull request's". So a deploy job has no way to wait for the review of the commit it is deploying and stop on its result.What it adds
findings --deployment KEYreads through the deployment operation. It supports--json,--waitand--timeoutexactly as--reviewdoes, and prints with the existing renderer.ci deploymentwaits for theDEPLOYMENTreview whose head is the commit, then reports it. Exit codes are those ofci review: 0 complete, 2 not complete, 3 an open finding at or above--fail-on, 4 no answer before--timeout.Decisions
rev_plus 32 lowercase hex digits. The key becomes a path segment, so a malformed value never reaches the network.idis not the review the key names, or whosekindis notDEPLOYMENT. This mirrors whatsarif::validate_subjectdoes for SARIF: never report another review as the one the caller named.ci deploymentonly reads. The contract has no operation that requests a deployment review, so the job never asks for one, whatever event started it. Its OIDC exchange names no pull-request head.ci_review,ci_verdict,read_reviewandprint_review.read_reviewandshownow take anAddress(a review ID or a deployment key), and existing callers pass aUuidunchanged.ci reviewprints the same text and returns the same exit codes as before.Left out, on purpose
--sarifis refused with--deployment, andci deploymenthas no--sarif.proofline reviewsalready lists reviews as JSON with theirpublic_key. A--kindfilter there would be a separate change.ci deploymentdetail read. The job trusts the list'skind, asci reviewdoes.How the feature was chosen
I built this with an AI coding agent, as the role describes. Before any code, I had the agent read the application page, all four repositories and every open pull request, so the feature would not repeat another applicant's. It came back with four candidates:
coverage upload --repo owner/name, since the command needs a repository UUID the CLI cannot look up.I chose the first. It was the only candidate that closed a gap between the pinned contract and the CLI:
get_deployment_reviewexisted with no command, andci reviewdeliberately ignores deployment reviews. The others were either generic (completions) or already done for another SDK by someone else (the wait helper).How I verified it
cargo fmt --check,cargo clippy --locked --all-targets -- -D warningsandcargo test --lockedpass: 102 tests, 0 failures.tests/deployment.rsruns the built binary against a loopback console:--wait;--sarifare refused before any request;ci deploymentexit codes across complete, open-finding,--fail-on, unmeasurable-threshold and pull-request-only cases, with onlyGETrequests;--sarif, are refused.src/deployment.rscover key parsing and reply validation, including terminal-control characters in a server-suppliedkind.tests/contract.rsasserts the deployment operation exists inopenapi.public.jsonand returnsCustomerReviewDetail.Not verified: I have no Proofline workspace with deployment reviews, so this is tested against the contract and a stand-in console, not a live organization. I did not run
cargo deny checklocally;Cargo.tomlandCargo.lockare unchanged.