Title: Changelog can be generated with non-version tags as a header · Issue #741 · commitizen-tools/commitizen · GitHub
Open Graph Title: Changelog can be generated with non-version tags as a header · Issue #741 · commitizen-tools/commitizen
X Title: Changelog can be generated with non-version tags as a header · Issue #741 · commitizen-tools/commitizen
Description: 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 ...
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/741
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Changelog can be generated with non-version tags as a header","articleBody":"### Description\r\n\r\nChangelogs should be generated only with version tags as headers. Tags are indeed being checked that they are version tags when generating the changelog [here](https://github.com/commitizen-tools/commitizen/blob/v3.2.1/commitizen/changelog.py#L58), but this logic is missing for the _latest_ commit's tag.\r\n\r\nThis means that changelogs can be generated with an incorrect tag for the latest version\r\n\r\nI've already opened a PR to fix this issue [here](https://github.com/commitizen-tools/commitizen/pull/740), I hope that's okay and is useful! 🙂 \r\nI'm open to suggestions if you see anything to improve there of course\r\n\r\n### Steps to reproduce\r\n\r\nOn a project with commitizen setup\r\n\r\n1. touch some-change\r\n2. `git commit -m \"feat: some change\"`\r\n3. `git tag a-tag-that-has-nothing-to-do-with-versions`\r\n4. `cz changelog --dry-run`\r\n\r\nSee that the output is\r\n```sh\r\n## a-tag-that-has-nothing-to-do-with-versions (2023-05-10)\r\n\r\n### Feat\r\n\r\n- some change\r\n```\r\n\r\ninstead of \r\n```sh\r\n## Unreleased\r\n...\r\n```\r\nor\r\n```sh\r\n## 0.1.0 (2023-05-10)\r\n...\r\n```\r\n\r\n### Current behavior\r\n\r\nNon-version tags can appear as the `latest` version header of the changelog\r\n\r\n### Desired behavior\r\n\r\nOnly version tags should ever appear in the changelog, for the latest change \u0026 subsequent changes\r\n\r\n### Screenshots\r\n\r\n_No response_\r\n\r\n### Environment\r\n\r\nCommitizen Version: 3.2.1\r\nPython Version: 3.10.8 (main, Dec 27 2022, 10:58:47) [Clang 14.0.0 (clang-1400.0.29.202)]\r\nOperating System: Darwin","author":{"url":"https://github.com/sacha-c","@type":"Person","name":"sacha-c"},"datePublished":"2023-05-10T19:59:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/741/commitizen/issues/741"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:57485ebc-4aab-475b-694a-6ce959986b11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E88A:22B172:8211A5:BB595C:6A4FB2F2 |
| html-safe-nonce | 08d2e834b7b703ff2254868d163f65df163bdaa34b182f208900fb850d0ec472 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODhBOjIyQjE3Mjo4MjExQTU6QkI1OTVDOjZBNEZCMkYyIiwidmlzaXRvcl9pZCI6IjcxNzc2NDMzNTEzNjA5MTAwNjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7138799c6476d6a1120d7acdad07df4e1f65c50c5077b79e8746bc3baebc0bad |
| hovercard-subject-tag | issue:1704551150 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/741/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee7721e929076f89f09e59f7273074a4baefc3fc587eb06b32511b46c350aeb6/commitizen-tools/commitizen/issues/741 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee7721e929076f89f09e59f7273074a4baefc3fc587eb06b32511b46c350aeb6/commitizen-tools/commitizen/issues/741 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sacha-c |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width