fix: use only version tags in changelog#740
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #740 +/- ##
==========================================
+ Coverage 97.31% 97.41% +0.10%
==========================================
Files 42 42
Lines 2045 2086 +41
==========================================
+ Hits 1990 2032 +42
+ Misses 55 54 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
c349d86 to
5cd12cb
Compare
|
My PR is not passing My code is actually covered through tests, but it doesn't end up in commitizen/.github/workflows/pythonpackage.yml Lines 31 to 32 in 5cd12cb Any suggestion on how to proceed? EDIT: added |
eae6463 to
4fd3439
Compare
|
Hi @sacha-c sorry for the late reply. Both maintainers are a bit overwhelmed these days. I've verified this issue and am now going to take a deeper look at this PR. Thanks for your contribution! |
This commit ensures that the tags used to generate the changelog are all correctly parsed by Version() This fixes two bugs: - The header of the changelog could be a non-version tag - The rev-range computed when running could use a non-version tag as a lower bound
4fd3439 to
87df201
Compare
|
Hi @sacha-c , I tried to resolve the conflict due to the latest merged PRs, but it seems to fail on the windows instance. Could you please take a look at the windows issue? I think we're almost ready to merge this one 💪 |
Thanks for checking this issue! 🙂 I had a look at the error and at first glance it seems unrelated to the changes of this PR. The test failing is test_bump_pre_commit_changelog, and the exception is thrown when installing pre-commit |
|
Yep, you're right. After I reran it, it succeeded. 🙂 |
All tags used to generate the changelog must be version tags.
This PR fixes two issues:
rev-rangecreated when runningcz changelog 3.2.0could use a non-version tag as a lower-bound, resulting in an incomplete changelog if the non-version tag was in the middle of two versions.Description
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
For example, if I have a project with a commit "feat: some change" tagged with a tag "i_am_not_a_version", running
cz changelogwill generate something like:See that the output is
instead of
## Unreleased ...or
## 0.1.0 (2023-05-10) ...Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
The changelog should only contain version tags
Steps to Test This Pull Request
On a project with commitizen setup
git commit -m "feat: some change"git tag a-tag-that-has-nothing-to-do-with-versionscz changelog --dry-runcloses #741