GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@shenxianpeng shenxianpeng commented Oct 15, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@shenxianpeng
fix(tag): check the remote tag name a pre-push line creates
be0d0c3
@shenxianpeng
shenxianpeng requested a review from a team as a code owner October 15, 2026 19:37
@shenxianpeng shenxianpeng self-assigned this Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: validating the remote tag name from a pre-push line.
Docstring Coverage Passed 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 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.
✨ 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the bug Something isn't working label Oct 15, 2026
@codecov

codecov Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

  • test_inherit_from_key_is_removed_from_result
  • test_subject_length_validator_min_too_short
  • test_validation_engine_validate_all_fail
  • test_inflected_first_words_are_rejected[fix: updated the docs]
  • test_inflected_first_words_are_rejected[fix: fixed the parser]
  • test_commit_message_validator_custom_pattern_github_issue
  • test_json_format_from_file
  • test_forbid_policy_rejects_ai_commit
  • test_load_config_default_cchk_toml
  • test_forbid_policy_multiple_tools
  • …and 120 more

✅ 645 untouched benchmarks
🆕 2 new benchmarks
⏩ 126 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_tag_validator_pre_push_checks_the_remote_tag_name N/A 376.7 µs N/A
🆕 test_tag_validator_pre_push_local_tag_to_non_tag_ref N/A 377.4 µs N/A

Comparing fix/tag-check-remote-ref (cb8b520) with main (4791607)

Open in CodSpeed

Footnotes

  1. 126 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shenxianpeng
shenxianpeng force-pushed the fix/tag-check-remote-ref branch from 6ac862d to be0d0c3 Compare October 18, 2026 06:02
@shenxianpeng
Merge remote-tracking branch 'origin/main' into fix/tag-check-remote-ref
cb8b520
@sonarqubecloud

sonarqubecloud Bot commented Oct 18, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shenxianpeng
shenxianpeng merged commit aacf8d4 into main Oct 18, 2026
33 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@shenxianpeng
shenxianpeng deleted the fix/tag-check-remote-ref branch October 18, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@shenxianpeng shenxianpeng

Labels

bug Something isn't working

Projects

None yet

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.

1 participant

@shenxianpeng
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.