commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

changelog is not able to recognize tags for incremental changelog

Open nos86 opened this issue 1 year ago • 2 comments

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

nos86 avatar May 30 '24 09:05 nos86

Thanks for reporting this issue. I just verified this.

Lee-W avatar Aug 11 '24 14:08 Lee-W

I dug into it a bit. This happens in https://github.com/commitizen-tools/commitizen/blob/01fd0426677b4db07988103d3a0ebd0d10763886/commitizen/changelog.py#L96 which should pass version into scheme instead of tag

Lee-W avatar Aug 11 '24 14:08 Lee-W