Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nos86 opened this issue May 30, 2024 · 2 comments
Open

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

nos86 opened this issue May 30, 2024 · 2 comments
Labels

Comments

@nos86
Copy link

nos86 commented May 30, 2024

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
@Lee-W
Copy link
Member

Lee-W commented Aug 11, 2024

Thanks for reporting this issue. I just verified this.

@Lee-W
Copy link
Member

Lee-W commented Aug 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants