Repository navigation
Add a required-environment check to ci review - #141
Open
Stig-Johnny wants to merge 6 commits into
Open
Stig-Johnny wants to merge 6 commits into
Stig-Johnny wants to merge 6 commits into
Conversation
Stig-Johnny
force-pushed
the
feature/require-environment
branch
from
December 2, 2026 10:51
b86af05 to
722810f
Compare
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 a required-environment check to ci review
A pull-request review can finish with staging checked and production skipped.
proofline ci review --require-environment productionlets a CI job require the final review to report that exact environment key asCHECKED.This brings the required-environment use case from sdk-python#74 to the CLI. It reads the existing response and adds no API request.
The option matches the external key, never the display name. The command exits 2 with an explanation if evidence is missing, malformed, duplicated or unchecked. A
CHECKEDentry cannot satisfy the requirement if its other fields say the environment was not checked. Without the option, behaviour is unchanged.Who uses the check?
The webshop has a test shop called
stagingand a live shop calledproduction. A release engineer configures CI once to require evidence that the review checked production. Developers see the result on each checkout pull request.--- config: htmlLabels: false --- flowchart LR accTitle: Who uses the production review requirement? accDescr: The release engineer configures the requirement, CI checks the review for production coverage, and the checkout developer reads the result on the pull request. engineer["Release engineer"] ci["Webshop CI"] developer["Developer"] subgraph workflow["Checkout pull request"] policy(["Require production"]) verify(["Check coverage"]) result(["Read CI result"]) end engineer --- policy ci --- verify developer --- result classDef actor fill:#19384d,color:#ffffff,stroke:#7796ab classDef goal fill:#e7f2fa,color:#183247,stroke:#88aabf class engineer,ci,developer actor class policy,verify,result goalWhat happens on a checkout pull request?
CI reads the completed review for this commit. With
--fail-on serious, the CLI uses the server’s count of open serious findings.sequenceDiagram accTitle: A checkout pull request with production required accDescr: CI reads the completed Proofline review. If the review skipped production, the job exits 2. If production was checked, the open serious findings determine the result. actor Dev as Checkout developer participant CI as Webshop CI participant CLI as Proofline CLI participant API as Proofline API Dev->>CI: Open a checkout PR CI->>CLI: Run the configured review step CLI->>API: Read the PR review for this commit API-->>CLI: Final review and recorded results alt Only the test shop was checked CLI-->>CI: Stop (exit 2), production check missing else Live shop checked, no open serious findings CLI-->>CI: Pass (exit 0) else Live shop checked, open serious findings CLI-->>CI: Stop (exit 3) else Live shop checked, finding counts unavailable CLI-->>CI: Stop (exit 4) end CI-->>Dev: Show the check result on the PRThe environment requirement is evaluated after review completeness and before
--fail-on. Raw JSON and the completenessoutcomestay unchanged, so JSON consumers must read the process exit code. This requires the server to report the target as checked; it does not independently correlate a target with an assessment ID or verify a deployment.Verification
The staging-only regression test initially failed because the command accepted the flag but returned exit 0 instead of 2. It passes with enforcement in place. Tests also cover code-only reviews, duplicate keys, unknown states, malformed evidence, contradictory metadata, final-poll changes, identity and threshold precedence, text/JSON output and terminal sanitisation.
All 19 new tests pass. The final full suite on macOS had 184 passed, two failures and one ignored test. Both failures also occur on the unchanged base commit
b022c3eand concern macOS path assertions inagent_install; the ignored test requires optional pre-commit. Formatting and Clippy pass with Rust 1.96.1. The repository pins Rust 1.100.0, which was not used locally; pinned-toolchain and other-platform checks remain for CI.