Repository navigation
Add --fail-on to proofline findings - #114
Open
jcatalaamat wants to merge 3 commits into
Open
jcatalaamat wants to merge 3 commits into
jcatalaamat wants to merge 3 commits into
Conversation
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.
Add --fail-on to proofline findings
Who it helps
Anyone who wants to gate a script on a review that already exists: a merge-queue or release step, a local
pre-mergecheck, or a coding agent deciding whether a branch is ready. Today they have two options, and neither fits:review --pr N --fail-on seriousgates, but it may request a review: it needsreviews:request, can start work, and can spend credits.findings --pr Nonly reads, but ignores any threshold, so the script has to parse--jsonitself. That means reimplementing theopen_itemsrules (dismissed and accepted findings don't count; PR reviews count both lanes) and getting them subtly wrong.What it does
proofline findings --fail-on warning|seriousmeasures the review thatfindingsreads, using the samereview_verdictthatreview --fail-onalready uses. It does not request a review.--wait), incomplete, or failedopen_itemsIt works with every selector (
--pr,--head,--review, or the checkout'sHEADby default), and with--json,--sarifand--wait. It changes only the exit code and one stderr line. stdout keeps exactly the same shape, so existing parsers are unaffected.Decisions
show(…, fail_on)path, sofindings,reviewandci reviewcan't drift apart on what counts. This PR adds no new verdict logic.review --fail-on, I didn't make the flag require--wait. A one-shot read of a running review already exits 2, which is the safe answer for a gate, and a script that wants to block can add--wait. Both behaviours are tested.--fail-onis compatible with--sarifand--jsonbecause reading and gating are independent; the output is unchanged.--fail-oncommand, and this flag picks it up for free.Changes
src/lib.rs:FindingsArgsgains--fail-on <SEVERITY>, passed toshow.tests/http.rs:--fail-onmatrix (dismissed, warning-only, serious, missingopen_items, incomplete, CODE-lane, partial and other-head cases) now also runsfindings --reviewandfindings --head, besideci reviewandreview --pr, and asserts thatfindingssends onlyGETs.ci_consolefake now namesacme/appin its review filters so--headresolves.findings_fail_on_never_passes_a_review_that_has_not_finished: without--waitthe run exits 2; with--waitit exits 3 once the review completes.README.md: one paragraph next toreview --fail-on.How I verified it
cargo fmt --checkpasses.cargo clippy --locked --all-targets -- -D warningspasses.cargo test --locked: every suite passes. That includes 68 unit tests and 41 inhttp.src/lib.rschange and both new or extended tests fail, so they exercise the feature.cargo deny check: advisories ok, bans ok, licenses ok, sources ok.