Skip to content

review: add severity exit threshold - #39

Open
efegokdemir wants to merge 1 commit into
NVIDIA:mainfrom
efegokdemir:codex/issue-9-fail-on
Open

efegokdemir wants to merge 1 commit into
NVIDIA:mainfrom
efegokdemir:codex/issue-9-fail-on

Conversation

@efegokdemir

Copy link
Copy Markdown

Summary

Fixes #9 by adding an opt-in severity gate to boro review while preserving the existing default exit behavior. The JSON output already carries schema_version: 1; this PR documents that contract alongside the new CI/pre-send integration option.

Changes

  • Add review --fail-on=critical|high|medium|low.
  • Return exit status 1 when surviving findings meet or exceed the selected threshold.
  • Evaluate validated_findings when available, otherwise use final findings.
  • Document severity gating and the versioned JSON contract.
  • Add CLI parsing and threshold-selection tests.

Testing

  • cargo fmt -- --check — passed.
  • cargo test cli_tests — 20 passed.
  • cargo test — 451 unit tests passed; integration tests had 4 passed and 1 pre-existing failure in apply_message_id_handles_one_patch due to its existing quoted-path expectation.
  • cargo test --test apply_range_cli apply_single_commit_keeps_schema_v1 — passed.
  • cargo clippy --all-targets --all-features -- -D warnings — blocked by 19 pre-existing warnings in unrelated files; no warning was reported for the changed code.

Notes

The threshold is intentionally opt-in and applies after final validation, so it does not change existing review results or default exit codes. --json output is still emitted before the non-zero exit status, making the result suitable for CI artifact capture.

This contribution was prepared with AI assistance and manually checked against the repository's source, tests, and command output.

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
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.

Feature: --fail-on severity exit code and versioned JSON schema

1 participant