You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate Changelog Entries for Merged Branches #510
Somehow I end up with duplicate changelog entries after merging a MR.
E.g.
## v0.1.2 (2022-05-02)### Fix-**release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
-**release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
-**release**: try to not escape $CI_DEFAULT_BRANCH default value
-**release**: do not run run bump_version/dry_run in tag pipeline
Steps to reproduce
Use gitlab and add some commits to a new branch.
Open a MR and merge it.
Run commitizen on the main branch and get a changelog with duplicated entries.
Current behavior
Duplicate Changelog Entries:
## v0.1.2 (2022-05-02)### Fix-**release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
-**release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
-**release**: try to not escape $CI_DEFAULT_BRANCH default value
-**release**: do not run run bump_version/dry_run in tag pipeline
Desired behavior
No duplicates from merging a MR:
## v0.1.2 (2022-05-02)### Fix-**release**: do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
-**release**: try to not escape $CI_DEFAULT_BRANCH default value
-**release**: do not run run bump_version/dry_run in tag pipeline
Screenshots
Problem appears to be that commitizen seems to parse the commit body also?!
Git log shows:
Date: Mon May 2 15:28:31 2022 +0200
Merge branch 'fix/improve_release_jobs' into 'master'
fix(release): do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCH
Closes #4
See merge request group/ci_templates!10
Date: Mon May 2 15:12:10 2022 +0200
fix(release): do version bump on $RELEASE_BRANCH (if defined) else on $CI_DEFAULT_BRANCHelse dry run version bump
...
Environment
Commitizen Version: 2.24.0
Python Version: 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
Operating System: Windows
Hey, got the exact same issue here:
Commitizen Version: 2.24.0
Python Version: 3.7.12 && 3.9.1
I tried with pip3 install -U Commitizen==2.20.0 and it did not duplicate.
The versions after this one seem to have the duplication issue. So 2.20.1 duplicates.
Activity
tanguy-a commentedon May 6, 2022
Hey, got the exact same issue here:
Commitizen Version: 2.24.0
Python Version: 3.7.12 && 3.9.1
I tried with
pip3 install -U Commitizen==2.20.0and it did not duplicate.The versions after this one seem to have the duplication issue. So 2.20.1 duplicates.
adam-grant-hendry commentedon May 16, 2022
@lovetheguitar Thanks for submitting this! I think I'll downgrade until a fix is submitted.
@tanguy-a Thanks for the tip!
Lee-W commentedon May 22, 2022
Hi @lovetheguitar could you please provide concrete steps for us to reproduce this issue on our side? Thanks !
woile commentedon May 22, 2022
I think this is related to the fact that we process the body, even though the subject of a commit message may not match conventional commits.
commitizen/commitizen/changelog.py
Lines 116 to 127 in afa0d93
commitizen/commitizen/changelog.py
Lines 129 to 140 in afa0d93
I think if the subject doesn't match, we should skip directly, no?
I see this happening also now because github is adding the commit message in the body.
fix(changelog): skip non-compliant commit subjects when building chan…