GeezerVison is showing github.com — fix(tag): check the remote tag name a pre-push line creates by shenxianpeng · Pull Request #615 · commit-check/commit-check
Conversation
shenxianpeng
commented
Oct 15, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Before: in a pre-push hook, the tag check validated the local tag name. git push origin v1.0.0:refs/tags/bad-name creates bad-name on the remote, but only v1.0.0 was checked, so the push went through.
After: the name the remote receives (bad-name) is the one checked, and the push is rejected. The local name is still used when the remote side is not a tag, and tag deletions are still skipped as before.
Before / after
$ cat push.txt # the line a pre-push hook gets for: git push origin v1.0.0:refs/tags/bad-name
refs/tags/v1.0.0 702628f75821e82a59705a23c48fc063945a0d3f refs/tags/bad-name 0000000000000000000000000000000000000000
Before (main)
$ cchk -t --no-banner < push.txt; echo "exit=$?"
exit=0
After (this branch)
$ cchk -t --no-banner < push.txt; echo "exit=$?"
CC401 tag check failed ==> bad-name
The tag name does not match the required pattern
Suggest: Use a SemVer tag like v1.2.3, or set a custom pattern via regex in the [tag] config section
Docs: https://commit-check.com/rules/#cc401
exit=1
How
TagValidator._tags_from_stdin now looks at the remote ref first and falls back to the local ref only when the remote ref is not under refs/tags/. Two tests are added where the two names differ: a good local tag pushed under a bad remote name fails and reports the remote name, and a local tag pushed to a non-tag ref is still checked by its local name. All existing tests used the same name on both sides and pass unchanged.
Summary by CodeRabbit
- Bug Fixes
- Tag validation during a push now uses the remote tag name when pushing to a tag, and the local tag name when pushing to a non-tag ref.
- Tests
- Added coverage for both tag-push scenarios.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 57 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
fef2eb83-2c10-4775-b102-17f2a74f377f
📥 Commits
-
Reviewing files that changed from the base of the PR and between be0d0c3 and cb8b520.
📒 Files selected for processing: 2
-
commit_check/engine.py
tests/engine_test.py
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
711fd87d-29fd-43ad-b1f6-c39c0f231916
📥 Commits
-
Reviewing files that changed from the base of the PR and between 4791607 and be0d0c3.
📒 Files selected for processing: 2
-
commit_check/engine.py
tests/engine_test.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
-
TagValidator._tags_from_stdin now checks the remote ref first. If it is not a tag, the validator can use the local tag ref. Tests cover both cases.
Changes: Pre-push tag selection
| Layer / File(s) |
Summary |
Tag ref precedence commit_check/engine.py, tests/engine_test.py |
The validator checks the remote tag name when both refs are tags. If the remote ref is not a tag, it checks the local tag name. Tests cover both cases. |
Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Merge Risk: ⚪ Minimal · up to be0d0
-
Pre-push validation checks the remote name for tag destinations and retains local-name fallback for non-tag destinations. Deletions remain skipped, and no actionable merge risk remains beyond normal checks.
Pre-merge checks: 5
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title clearly and concisely describes the main change: validating the remote tag name from a pre-push line. |
| Docstring Coverage |
 |
Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Oct 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4791607) to head (cb8b520).
Additional details and impacted files
@@ Coverage Diff @@
## main #615 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 2386 2386
=========================================
Hits 2386 2386
☔ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codspeed
Bot
commented
Oct 15, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will not alter performance
⚠️ 130 benchmarks spent significant time in system calls
System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.
Measurement and system calls
✅ 645 untouched benchmarks
🆕 2 new benchmarks
⏩ 126 skipped benchmarks1
Performance Changes
Comparing fix/tag-check-remote-ref (cb8b520) with main (4791607)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Labels
bug
Something isn't working
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|