Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(cli): add fail-on-findings option - #469

Open
deepujain wants to merge 1 commit into
NVIDIA:mainfrom
deepujain:feat/448-fail-on-findings
Open

feat(cli): add fail-on-findings option#469
deepujain wants to merge 1 commit into
NVIDIA:mainfrom
deepujain:feat/448-fail-on-findings

Conversation

@deepujain

Copy link
Copy Markdown
Contributor

Summary

  • add an opt-in --fail-on-findings gate for active findings below the aggregate risk threshold
  • apply the gate to single and recursive scans after reports are written
  • cover the low-risk single-scan and recursive cases

Validation

  • ruff format --check src/skillspector/cli.py tests/unit/test_cli.py
  • ruff check src/skillspector/cli.py tests/unit/test_cli.py
  • git diff --check
  • python3 -m py_compile src/skillspector/cli.py tests/unit/test_cli.py
  • focused pytest could not collect locally because the temporary Python environment did not retain package metadata; CI is the remaining test surface

Fixes #448

Signed-off-by: Deepak Jain [email protected]

@deepujain
deepujain force-pushed the feat/448-fail-on-findings branch 3 times, most recently from f568fed to 3b3e81a Compare September 9, 2026 21:54

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SkillSpector Review]

Reviewed current head d4e5942508223db05163b02c1dfc38d6d3bd733f. --fail-on-findings is applied after report output, aggregates recursive child findings, and preserves execution-failure exit-code precedence. The regressions cover both single-scan and recursive low-score modes. I found no required code or test changes.

All hosted required checks pass. The branch is behind main, so it must be updated and revalidated before merging.

@deepujain
deepujain force-pushed the feat/448-fail-on-findings branch 2 times, most recently from 1b64afd to de383ec Compare September 12, 2026 08:23

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SkillSpector Review]

Corrective re-review of current head 768ff663d2fde2813c5501b9fb6f8cbc9df4cfa7 after the force-push/rebase and latest main synchronization. The ordinary single-skill and recursive gates remain correctly placed after report generation and below execution-failure precedence, but the new public flag is silently ignored in the supported MCP Registry scan path. The required correction and regression are detailed inline; please also update the documented stable exit-code contract.

changes, lint, DCO, and docker-smoke pass; test-unit is still running. This is not merge-ready.

Comment thread src/skillspector/cli.py
bool,
typer.Option(
"--fail-on-findings",
help="Exit 1 when the scan reports one or more active findings.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scan accepts --fail-on-findings together with --mcp-registry, but that branch returns at lines 561-588 before either new finding check. scan_registry() exposes a findings list, and a single unpinned package contributes a risk score of 30, so this command exits 0 even though the requested gate has a finding to block. Apply the flag to registry findings or reject this option combination explicitly, and add a below-threshold registry regression. Please also update the README's stable exit-code contract to include the new opt-in exit-1 condition.

@deepujain
deepujain force-pushed the feat/448-fail-on-findings branch from 768ff66 to ca2ce8b Compare September 12, 2026 16:14

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SkillSpector Review]

Re-reviewed current head ca2ce8b8391476dc87ba6ebbf0033859e6d1b121 after the author force-push. The PR-owned cli.py and test_cli.py blobs are byte-identical to previously reviewed head 768ff663d2fde2813c5501b9fb6f8cbc9df4cfa7; the existing inline thread remains unresolved and has no reply. The required correction therefore remains: --fail-on-findings is accepted with --mcp-registry, but that branch returns before applying the gate, so a below-threshold registry finding can still exit 0. Apply the gate or reject the option combination, add the registry regression, and update the README's stable exit-code contract.

All hosted checks pass, but this head is not merge-ready.

@deepujain
deepujain force-pushed the feat/448-fail-on-findings branch from ca2ce8b to 3a6de37 Compare September 13, 2026 18:45
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 Request] An easy method to have skillspector to exit with an error if theres findings

2 participants