fix: report a fully skipped run as skip, add warnings, require commit-check 2.17 - #34
Conversation
…-check 2.17
Every validation tool reduced its per-check statuses with its own copy of
`"fail" if any failed else "pass"`, so a run in which every check skipped
(the author is on `ignore_authors`, for example) came back as `pass`. An
agent reading that took a bypassed policy for an enforced one.
The four copies are replaced by one `_summarize` helper built on
commit-check's own `overall_status` and `count_warnings`, so the MCP result
now matches the CLI's `--format json`: `status` is `skip` when nothing was
validated, a `warn` check leaves `status` at `pass`, and a top-level
`warnings` field counts them.
Both helpers exist since commit-check 2.17.0, which becomes the floor;
`uv.lock` is regenerated accordingly. The `fix` key has been part of every
release the floor allows, so the `setdefault("fix", "")` shim for older
engines and its test are removed, along with the README caveat about them.
The README documents the `skip` and `warn` statuses and the `warnings`
field.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018xYa7m3qup5wyN5MaXFgf6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
- Coverage 99.13% 99.13% -0.01%
==========================================
Files 2 2
Lines 232 230 -2
==========================================
- Hits 230 228 -2
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe server now centralizes validation result summarization. It reports warning counts and supports ChangesValidation summary behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Validation responses now consistently report skipped runs and warning totals while preserving failure behavior. The updated behavior is covered across validation paths and is ready to merge. Sequence Diagram(s)sequenceDiagram
participant ValidationTool
participant ValidationEngine
participant _summarize
participant ValidationResponse
ValidationTool->>ValidationEngine: run checks
ValidationEngine-->>ValidationTool: CheckOutcome results
ValidationTool->>_summarize: pass check dictionaries
_summarize->>_summarize: derive overall_status and count_warnings
_summarize-->>ValidationResponse: return status, warnings, and checks
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 56.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
A run that validated nothing is no longer a
passEvery validation tool reduced its per-check statuses with its own copy of
"fail" if any(...) else "pass", in four places. Anything that was not a failure became a pass, so a run in which every check skipped (author onignore_authors, nothing to check) came back asstatus: "pass". An agent reading that took a bypassed policy for an enforced one.The four copies are replaced by one
_summarizehelper built on commit-check's ownoverall_statusandcount_warnings, so the MCP result now matches the CLI's--format json:ignore_authors{"status": "pass", "checks": [all skip]}{"status": "skip", "warnings": 0, "checks": [all skip]}"not conventional"withwarn = ["message"]{"status": "pass", ...}{"status": "pass", "warnings": 1, ...}skipneeds every check to have skipped; one real verdict makes the resultpassorfailas before. Onlyfailis a rejection.commit-check>=2.17.0Both helpers exist since commit-check 2.17.0, which becomes the dependency floor (
pyproject.toml,uv.lockregenerated). Thefixkey has been part of every release the floor allows, so thesetdefault("fix", "")shim for older engines, its test, and the README caveat about them are removed.Docs
The README result shape now shows
status: "pass|fail|skip", a top-levelwarnings, and per-checkpass|fail|warn|skip, with a paragraph on whatskipandwarnmean.Compatibility
checks[]is unchanged.statusgains one new value,skip, only for runs that previously reportedpasswhile validating nothing. Consumers checkingstatus == "fail"are unaffected.Testing
pytest),ruff checkclean._run_checks→skip; one real verdict outweighs skips; a real-enginewarnrun countswarnings: 1and stayspass; a failure still fails; the combined tools (validate_commit_context,validate_author_infowith both inputs) reduce with the same rule and carrywarnings.commit-check-mcpfrom the released 0.1.10 and from this branch, callingvalidate_commit_messagewith awarnconfig andvalidate_repository_stateon a repo whose author is ignored. Results as in the table above.🤖 Generated with Claude Code
https://claude.ai/code/session_018xYa7m3qup5wyN5MaXFgf6
Generated by Claude Code
Summary by CodeRabbit
New Features
Documentation