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

change log was generated with garbage data #798

Closed
YoniRomm opened this issue Jul 27, 2023 · 5 comments
Closed

change log was generated with garbage data #798

YoniRomm opened this issue Jul 27, 2023 · 5 comments

Comments

@YoniRomm
Copy link

YoniRomm commented Jul 27, 2023

Description

I extended the ConventionalCommitsCz class with my own class that it's whole purpose was to bump patch version for commit with prefix test(bump): <some title>.

my file cz_bumpForTest.py

from commitizen.cz.conventional_commits import ConventionalCommitsCz
from commitizen import defaults

class BumpfortestCz(ConventionalCommitsCz):
    # bump_pattern is the same as defaults.bump_pattern with addition of the test prefix
    bump_pattern = r"^(((BREAKING[\-\ ]CHANGE|feat|fix|refactor|perf|test)(\(.+\))?(!)?)|\w+!):"
    bump_map = ConventionalCommitsCz.bump_map
    bump_map[r"^test\(bump\)"] = defaults.PATCH

and setup.py

from setuptools import setup

setup(
    name="bumpForTest",
    version="0.1.0",
    py_modules=["cz_bumpForTest"],
    license="Not open source",
    long_description="bumps also for test prefix if it of the format test(bump): add new test",
    install_requires=["commitizen"],
    entry_points={"commitizen.plugin": ["cz_bumpForTest = cz_bumpForTest:BumpfortestCz"]},
)

the bump actually works well and it's indeed bumps the patch version for the relevant commit.
but the change log looks like this for all type of commits:

Screenshot 2023-07-27 at 10 19 57

there are other repositories that this list of invalid tags is very long.
how to remove it? is the behavior configurable?

EDIT

after going deeper in the code I found the following pr 8123bcb
which I see now the function get_version_tags generates this kind of messages

is there a way to override it? or disable this warning?
my repositories has tags that are not semver

Steps to reproduce

I am wrapping the cz cli using python code
but eventully I call the command cz ch --dry-run --start-rev <original_tag> --unreleased-version "<new_tag>"

Current behavior

the release notes contains invalid tags messages

Desired behavior

I dont expect it to add all those invalid tags to the release notes

Screenshots

No response

Environment

I am using the latest versions

@melsabagh
Copy link

I am experiencing this as well. I think a quick fix is to write out.warn messages to stderr instead of stdout.

@woile
Copy link
Member

woile commented Sep 18, 2023

Have you tried using git_redirect_stderr ?

@melsabagh
Copy link

@woile, yes, it doesn't seem related. The "InvalidVersion GitTag(...)" warning is printed by cz itself here:

out.warn(f"InvalidVersion {tag}")

@eortega-pjr
Copy link

We see this with our (old) non-semver tags, as well.

Is there a way to specify "ignore tag XYZ" in .cz.toml or otherwise filter this warning out?

Thanks.

@Lee-W
Copy link
Member

Lee-W commented May 20, 2024

Hi all, I just tested with the latest version with cz ch without encountering this issue. It seems to be fixed in 3.18.3 (Thanks @noirbizarre !). I'm going to close this one. But please feel free to reopen it if the issue persists. Thanks! 🙂

@Lee-W Lee-W closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants