Skip to content

changelog is not able to recognize tags for incremental changelog #1149

Description

@nos86

Description

When I try to produce the incremental changelog, I receive this error:

> cz changelog
InvalidVersion GitTag('utility/v0.1.3', 'a6ffd4da2c7db27a792b00fefdbca5e7de6f1f60', '2024-05-17')
InvalidVersion GitTag('utility/v0.1.2', 'cb887f77eaca3ae2af4360a9451d18ec5414bdb6', '2024-05-16')

Commitizen is configured to work with poetry. See below the configuration:

[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "utility/v$version"
version_scheme = "semver2"
version_provider = "poetry"
update_changelog_on_bump = true
changelog_incremental = true
major_version_zero = true

If I run the bump command:

> cz bump --dry-run
bump: version 0.1.3 → 0.2.0  
tag to create: utility/v0.2.0
increment detected: MINOR

InvalidVersion GitTag('utility/v0.1.3', 'a6ffd4da2c7db27a792b00fefdbca5e7de6f1f60', '2024-05-17')
InvalidVersion GitTag('utility/v0.1.2', 'cb887f77eaca3ae2af4360a9451d18ec5414bdb6', '2024-05-16')
No tag found to do an incremental changelog

It looks like, it recognize current release version but it is not able to match the correct tag to generate incremental changelog

Steps to reproduce

cz changelog

Current behavior

> cz changelog
InvalidVersion GitTag('utility/v0.1.3', 'a6ffd4da2c7db27a792b00fefdbca5e7de6f1f60', '2024-05-17')
InvalidVersion GitTag('utility/v0.1.2', 'cb887f77eaca3ae2af4360a9451d18ec5414bdb6', '2024-05-16')

Desired behavior

Tag is recognized and changelog is generated correctly

Screenshots

No response

Environment

> cz version
3.25.0
> python --version
Python 3.11.9
> python3 -c"import platform; print(platform.system())"
Windows
> cz version --report
Commitizen Version: 3.25.0
Python Version: 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
Operating System: Windows

Activity

  1. Lee-W commented on Aug 11, 2024

    @Lee-W
    Member

    Thanks for reporting this issue. I just verified this.

  2. Lee-W commented on Aug 11, 2024

    @Lee-W
    Member

    I dug into it a bit. This happens in

    def get_version_tags(scheme: type[BaseVersion], tags: list[GitTag]) -> list[GitTag]:
    which should pass version into scheme instead of tag

  3. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Triage from #1964: Looks fixed on master (4.15.1) — same fix as #845. commitizen/tags.py's TagRules correctly matches custom tag_format = "utility/v$version". Could anyone confirm a fresh repro? If so, closing recommended.

  4. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Verification update (re #1964)

    I reproduced this against current master (4.15.1):

    pyproject.toml with the exact config from this issue (tag_format = "utility/v$version", version_scheme = "semver2", version_provider = "poetry", changelog_incremental = true, major_version_zero = true).

    After two bumps, git tag --list:

    utility/v0.2.0
    utility/v0.2.1
    

    cz changelog exits 0 with no InvalidVersion warnings, and the CHANGELOG.md correctly groups all releases:

    ## Unreleased
    
    ### Feat
    
    - another feature
    
    ## utility/v0.2.1 (2026-05-09)
    
    ### Fix
    
    - bug fix
    
    ## utility/v0.2.0 (2026-05-09)
    
    ### Feat
    
    - initial commit

    Verdict: FIXED — TagRules (in commitizen/tags.py) now correctly handles custom tag_format prefixes. Closing-eligible.

  5. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Feel free to reopen is this issue still persists, 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