Repository navigation
chore: raise test coverage and stop persisting checkout credentials - #39
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches📝 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #39 +/- ##
===========================================
+ Coverage 98.20% 100.00% +1.79%
===========================================
Files 2 2
Lines 279 279
===========================================
+ Hits 274 279 +5
+ Misses 5 0 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Set persist-credentials: false on the checkouts in the test and build jobs and in both publish jobs, as the lint job already does. None of them uses the token after checking out, so it no longer stays in .git/config for the rest of the job.
commit-check 2.18.2 reports the force-push check as skipped when there is nothing to compare, where earlier releases reported a pass. CI installs the newest release the range allows (2.18.2 today), so on main this test fails with "assert 'skip' == 'pass'", while uv.lock still pins 2.18.0, where it passes. Expect each release's result, chosen by the installed version, so the suite passes on both ends of commit-check>=2.18.0,<3.
Brings the server to 100% line and branch coverage without changing it: - git missing from PATH, when checking for a repository and when resolving push_refs, run with an empty PATH rather than a mock; - push_refs lines a pre-push hook can receive (abbreviated and upper-case SHAs, a blank line between refs, a deletion, a revision as local ref); - the upstream fallback against a real upstream on a local bare remote: a branch ahead of it passes, a rewritten one fails; - an inline warn list reported with the default config sections; - test_stdio.py starts the server as a client does, a subprocess on stdin/stdout, and checks the handshake, the eight tools, structured pass and fail results, and a tool error flagged as an error.
18dade1 to
1880012
Compare
Summary
This PR contains only three kinds of change:
@main.persist-credentials: falseon the four checkouts that lacked it:main.yml: the test and build jobspublish.yml: the build and MCP Registry jobssrc/is unchanged.Coverage
Measured with pytest-cov on
src/commit_check_mcp, against the unmodified source:mainTests
PATH, both when checking for a repository and when resolvingpush_refs. These run with an emptyPATHrather than a mock.push_refslines a pre-push hook can receive: abbreviated and upper-case SHAs, a blank line, a deletion, and a revision as the local ref.warnlist reported alongside the default config sections.tests/test_stdio.py: starts the server the way a client does, as a subprocess on stdio.test_repository_state_include_push_is_unaffectednow expects whichever result the installed commit-check gives for a branch without an upstream:skipfrom 2.18.2 on. CI installs 2.18.2 today, so this test currently fails onmain.passbefore that, as with the 2.18.0 pinned inuv.lock.Verification
src/unmodified: 121 passed with-W error, at 100% line and branch coverage, in both environments:uv.lock(commit-check 2.18.0, mcp 2.0.0)pip install -e .[dev](commit-check 2.18.2, mcp 2.2.0)actionlinton the changed workflows: clean.git ls-remote.