Skip to content

Add --fail-on CI gating with exit code 2 - #166

Merged
vertti merged 1 commit into
mainfrom
feat/fail-on-gating
Jul 15, 2026
Merged

Add --fail-on CI gating with exit code 2#166
vertti merged 1 commit into
mainfrom
feat/fail-on-gating

Conversation

@vertti

@vertti vertti commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Fixes ROADMAP U6 — completes the U (CLI & output UX) section.

ci-snitch analyze --fail-on regression,failure-rate>25 makes the tool usable as a CI gate:

  • exit 2 when any condition matches a finding — distinct from 1 (operational error), so pipelines can distinguish "the data tripped the gate" from "the tool broke"
  • one fail-on: <reason> line per tripped finding on stderr, printed even with -q (telling CI why is the point)
  • conditions validated before any network call (--fail-on bogus errors instantly)
  • supported: regression (post-BH-correction regression category) and failure-rate>N

Tests: parse table (valid/invalid specs, threshold bounds), evaluator (trips/doesn't/speedup-isn't-regression), exit-code error contract. New-code contract tests rather than red-first (no prior behavior to break).

Live: cli/cli --fail-on regression exits 2 with three named regressions; failure-rate>90 exits 0; --fail-on bogus errors before fetching.

--fail-on regression,failure-rate>N turns ci-snitch into a CI gate:
exit 2 when conditions match findings (distinct from 1 = operational
error so pipelines can tell 'the data tripped the gate' from 'the tool
broke'), with one fail-on: reason per tripped finding on stderr —
printed even in quiet mode, since telling CI why is the whole point.
Conditions are validated before any network call.

Completes the U section. (ROADMAP U6)
@vertti
vertti enabled auto-merge July 15, 2026 14:06
@vertti
vertti merged commit d0fb106 into main Jul 15, 2026
1 check passed
@vertti
vertti deleted the feat/fail-on-gating branch July 15, 2026 14:08
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.

1 participant