Commits with breaking change footers are not reflected in the generated changelog
TobTheRock opened this issue · comments
Bug description
Slightly related to #687, as conventional commits may contain a breaking change footer.
We have a git-cliff.toml which specifically displays breaking changes in the change log.
When running git-cliff
directly the changelog is generated as desired, but not when using release-plz update
- Would you like to work on a fix? [y/n]
-y
I tracked down the core issue, the problem is that commits are filtered here before they are passed togit-cliff-core
. As a result the footers are not evaluated. Removing the filter already fixes the issue. Was there any particular reason to filter the commits here?
To Reproduce
Steps to reproduce the behavior:
- Have a commit containing a breaking change footer, e.g.
feat: new awesome stuff
BREAKING CHANGE: breaks everything
- have a
git-cliff
config, which has special handling for breaking changes, e.g.
...
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% if commit.breaking %} \n {{ commit.breaking_description }}{% endif %}\
{% endfor %}
...
{% endfor %}\n
- Run
release-plz update
Expected behavior
Breaking change marked in the change log, e.g.
[0.3.0] - 2023-10-28
Features
- [breaking] new awesome stuff breaks everything
...
Environment
- OS: Arch Linux
- release-plz version: master
Was there any particular reason to filter the commits here?
We filter the commits so that only the commit title goes into the changelog. But maybe this is not needed? 🤔 Does git-cliff have a different behavior? 🤔
I guess they take the whole commit message, as when I run the git-cliff
cli tool I got a different output.
What I got from the git-cliff
code it is intended to have the "message including title, description and summary"
Appears that the message is internally splitted into a conv commit here then.
I also played around with release-plz
, commenting out the filtering. Works both with my git-cliff config and the default from release-plz
as inteded (only the commit title appears in the change log).
Great, than we can remove that filter. Do you want to raise a PR? Than I will test it :)
Sure, here it is: #1104
Thanks 👍
fixed by #1104
Thanks 🙏