Skip to content

ignored_tag_format not working #1392

Closed
Closed

Description

@fragolinux

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

Activity

  1. noirbizarre commented on May 16, 2025

    @noirbizarre
    Member

    It might have been fixed by #1418, can you try on the version 4.7.1 ?

  2. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    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 the 5.49.x–5.51.6 non-prerelease tags) with the same config:

    [tool.commitizen]
    tag_format = "${version}"
    version_scheme = "semver"
    version_provider = "scm"
    ignored_tag_formats = ["$version.*"]

    Running cz bump --dry-run from 5.51.6:

    bump: version 5.51.6 → 5.52.0
    tag to create: 5.52.0
    increment detected: MINOR
    

    It also works without ignored_tag_formats set, because the underlying fix changed TagRules.is_version_tag from regex.match to regex.fullmatch, so tags like 5.49.0.RC5 are no longer mistakenly treated as legit version tags and never reach extract_version.

    @fragolinux — upgrading to commitizen ≥ 4.7.1 should resolve this. Feel free to close the issue if that works for you.

  3. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Feel free to reopen this issue if that does not work for you, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions