Skip to content

fix: report a fully skipped run as skip, add warnings, require commit-check 2.17 - #34

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/submit-patch-commit-check-42ac3i
Sep 6, 2026
Merged

fix: report a fully skipped run as skip, add warnings, require commit-check 2.17#34
shenxianpeng merged 1 commit into
mainfrom
claude/submit-patch-commit-check-42ac3i

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Sep 6, 2026

Copy link
Copy Markdown
Member

What

A run that validated nothing is no longer a pass

Every 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 on ignore_authors, nothing to check) came back as status: "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:

Before (0.1.10) After
Repo whose author is on ignore_authors {"status": "pass", "checks": [all skip]} {"status": "skip", "warnings": 0, "checks": [all skip]}
"not conventional" with warn = ["message"] {"status": "pass", ...} {"status": "pass", "warnings": 1, ...}

skip needs every check to have skipped; one real verdict makes the result pass or fail as before. Only fail is a rejection.

commit-check>=2.17.0

Both helpers exist since commit-check 2.17.0, which becomes the dependency floor (pyproject.toml, uv.lock regenerated). The fix key has been part of every release the floor allows, so the setdefault("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-level warnings, and per-check pass|fail|warn|skip, with a paragraph on what skip and warn mean.

Compatibility

checks[] is unchanged. status gains one new value, skip, only for runs that previously reported pass while validating nothing. Consumers checking status == "fail" are unaffected.

Testing

  • 96 tests pass (pytest), ruff check clean.
  • New tests: fully skipped _run_checksskip; one real verdict outweighs skips; a real-engine warn run counts warnings: 1 and stays pass; a failure still fails; the combined tools (validate_commit_context, validate_author_info with both inputs) reduce with the same rule and carry warnings.
  • Real stdio self-test: an MCP client spawned commit-check-mcp from the released 0.1.10 and from this branch, calling validate_commit_message with a warn config and validate_repository_state on 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

    • Validation results now include warning counts and distinguish passed, failed, skipped, and warning outcomes.
    • Overall validation status more accurately reflects skipped checks and non-failing findings.
    • Check results consistently include available fix guidance.
  • Documentation

    • Updated the documented validation result format to describe warning counts, skipped checks, warning statuses, overall status behavior, and fix information.

…-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
@github-actions github-actions Bot added the bug Something isn't working label Sep 6, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.13%. Comparing base (1b7621a) to head (51e2aa9).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 00bef97e-79ad-46f0-bc93-79b56e250ca9

📥 Commits

Reviewing files that changed from the base of the PR and between 1b7621a and 51e2aa9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • README.md
  • pyproject.toml
  • src/commit_check_mcp/server.py
  • tests/test_server.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The server now centralizes validation result summarization. It reports warning counts and supports skip and warn statuses. The dependency minimum increased to commit-check 2.17.0. Tests cover status reduction and fix preservation.

Changes

Validation summary behavior

Layer / File(s) Summary
Result contract and version alignment
README.md, pyproject.toml
The documented result shape includes warnings, skip, and warn statuses. The minimum commit-check version is now 2.17.0.
Centralized result reduction
src/commit_check_mcp/server.py
A shared _summarize helper uses overall_status and count_warnings. All validation paths use this helper and preserve engine-provided fix values.
Summary behavior tests
tests/test_server.py
Tests cover skipped checks, mixed statuses, warnings, failures, shared reduction behavior, and fix preservation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 51e2a

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: skipped-run status reporting, warning support, and the raised commit-check dependency requirement.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/submit-patch-commit-check-42ac3i

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shenxianpeng
shenxianpeng merged commit d20bc2c into main Sep 6, 2026
7 checks passed
@shenxianpeng
shenxianpeng deleted the claude/submit-patch-commit-check-42ac3i branch September 6, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants