Repository navigation
ignored_tag_format not working #1392
Copy link
Copy link
Closed
Description
Description
hi, we have a bunch of tags in the format $version.RC* which should not be considered when a bump is requested... this is our .cz.yaml file:
---
commitizen:
changelog_incremental: true
changelog_start_rev: 5.49.0
name: cz_custom
pre_bump_hooks:
- '"${WORKSPACE}/bump_script.sh" || exit 1'
tag_format: "${version}"
update_changelog_on_bump: true
use_shortcuts: true
version_files:
- automation_conf.yaml:release_version
- infrastructure/helm/Chart.yaml:version
- infrastructure/helm/Chart.yaml:appVersion
version_type: semver
version_provider: scm
ignored_tag_formats:
- "$version.*"
we are trying to bump from 5.51.6 to 5.52.0, these are the actual tags:
5.49.0.RC5
5.49.1
5.49.10
5.49.11
5.49.2
5.49.3
5.49.4
5.49.5
5.49.6
5.49.7
5.49.8
5.49.9
5.50.0
5.50.0.RC1
5.50.1
5.50.2
5.50.3
5.50.4
5.51.0
5.51.1
5.51.2
5.51.3
5.51.4
5.51.5
5.51.6
Steps to reproduce
cz bump
Current behavior
and this is the stack trace of a test run:
traceback (most recent call last):
File "/usr/local/python/current/bin/cz", line 8, in <module>
sys.exit(main())
~~~~^^
File "/usr/local/python/3.13.2/lib/python3.13/site-packages/commitizen/cli.py", line 656, in main
args.func(conf, arguments)()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/python/3.13.2/lib/python3.13/site-packages/commitizen/commands/bump.py", line 147, in __call__
current_version = self.scheme(provider.get_version())
~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/python/3.13.2/lib/python3.13/site-packages/commitizen/providers/scm_provider.py", line 21, in get_version
versions = sorted(rules.extract_version(t) for t in version_tags)
File "/usr/local/python/3.13.2/lib/python3.13/site-packages/commitizen/providers/scm_provider.py", line 21, in <genexpr>
versions = sorted(rules.extract_version(t) for t in version_tags)
~~~~~~~~~~~~~~~~~~~~~^^^
File "/usr/local/python/3.13.2/lib/python3.13/site-packages/commitizen/tags.py", line 149, in extract_version
raise InvalidVersion(
f"Invalid version tag: '{tag.name}' does not match any configured tag format"
)
packaging.version.InvalidVersion: Invalid version tag: '5.49.0.RC5' does not match any configured tag format
Desired behavior
bump to 5.52.0
Screenshots
No response
Environment
cz version --report
Commitizen Version: 4.6.0
Python Version: 3.13.2 (main, Apr 17 2025, 12:48:27) [GCC 12.2.0]
Operating System: Linux
Reactions are currently unavailable
Activity
noirbizarre commentedon May 16, 2025
It might have been fixed by #1418, can you try on the version 4.7.1 ?
bearomorphism commentedon May 9, 2026
I verified this on
master(commitizen 4.15.1) and the issue is fixed by #1418 (released in 4.7.1), as @noirbizarre suggested.Reproduction setup — same tags from the report (
5.49.0.RC5,5.50.0.RC1, plus the5.49.x–5.51.6non-prerelease tags) with the same config:Running
cz bump --dry-runfrom5.51.6:It also works without
ignored_tag_formatsset, because the underlying fix changedTagRules.is_version_tagfromregex.matchtoregex.fullmatch, so tags like5.49.0.RC5are no longer mistakenly treated as legit version tags and never reachextract_version.@fragolinux — upgrading to commitizen ≥ 4.7.1 should resolve this. Feel free to close the issue if that works for you.
bearomorphism commentedon May 9, 2026
Feel free to reopen this issue if that does not work for you, thanks!