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
Changelog can be generated with non-version tags as a header #741
Changelogs should be generated only with version tags as headers. Tags are indeed being checked that they are version tags when generating the changelog here, but this logic is missing for the latest commit's tag.
This means that changelogs can be generated with an incorrect tag for the latest version
I've already opened a PR to fix this issue here, I hope that's okay and is useful! 🙂
I'm open to suggestions if you see anything to improve there of course
Steps to reproduce
On a project with commitizen setup
touch some-change
git commit -m "feat: some change"
git tag a-tag-that-has-nothing-to-do-with-versions
cz changelog --dry-run
See that the output is
## a-tag-that-has-nothing-to-do-with-versions (2023-05-10)### Feat
- some change
instead of
## Unreleased
...
or
## 0.1.0 (2023-05-10)
...
Current behavior
Non-version tags can appear as the latest version header of the changelog
Desired behavior
Only version tags should ever appear in the changelog, for the latest change & subsequent changes
Screenshots
No response
Environment
Commitizen Version: 3.2.1
Python Version: 3.10.8 (main, Dec 27 2022, 10:58:47) [Clang 14.0.0 (clang-1400.0.29.202)]
Operating System: Darwin
Upon further research, I noticed that generating the changelog for specific versions, like so: cz changelog --dry-run 3.2.0
Also gets incorrect results if there are non-version tags in the history. Basically the rev-range that is created from the initial tag stops at the next tag (in get_smart_tag_range), which isn't necessarily the next version tag.
I'll investigate a little more and add changes to my PR if I find a good way to fix this as well
Activity
sacha-c commentedon May 16, 2023
Upon further research, I noticed that generating the changelog for specific versions, like so:
cz changelog --dry-run 3.2.0Also gets incorrect results if there are non-version tags in the history. Basically the
rev-rangethat is created from the initial tag stops at the next tag (inget_smart_tag_range), which isn't necessarily the next version tag.I'll investigate a little more and add changes to my PR if I find a good way to fix this as well
sacha-c commentedon Jun 12, 2023
I have updated my PR to include a fix for the above as well