marcocesarato / php-conventional-changelog

A PHP tool built to generate a changelog from a project's commit messages and metadata following the conventionalcommits.org and automate versioning with semver.org.
GNU General Public License v3.0
230 stars 31 forks source link

BREAKING CHANGE footer not being used #37

Closed patrickhoogkamer closed 2 years ago

patrickhoogkamer commented 2 years ago

Sometimes a BREAKING CHANGE footer is required to properly describe what actually is the breaking change that was needed to develop a feature. It seems this package ignores that and always puts the commit message as a breaking change instead of a feature. If I remove the exclamation mark it seems to ignore that it is a BREAKING CHANGE alltogether.

Am I doing something wrong or is this a known issue (or even a choice)?

marcocesarato commented 2 years ago

Hi, the package does not differ between escalation flag and BREAKING CHANGE footer as conventional commit says:

BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type

The package should include all commits (features, fixes etc ...) in the BREAKING CHANGE sections, like other conventional commit packages.

Do you mean that it doesn't work that way or the message on the BREAKING CHANGE section generated is different from what you expect? Can you give an example?

patrickhoogkamer commented 2 years ago

Thanks for your quick response.

What happened to me is that the BREAKING CHANGE section was ignored when I tried to implement this package yesterday.

I tried a commit message that looks like this (contents redacted):

feat: some feature

BREAKING CHANGE: thing that is now not supported anymore

This doesn't trigger a MAJOR bump in my case, but just does a MINOR bump and lists 'some feature' under 'features'.

I also tried a commit message that looks like this:

feat!: some feature

BREAKING CHANGE: thing that is now not supported anymore

This does trigger a MAJOR bump, which is correct. But it doesn't list the contents of the breaking change footer. Instead it lists 'some feature' in the breaking changes section and no features section.

I'm wondering if that's the intended behaviour or not or if my commits are somehow not correct.

marcocesarato commented 2 years ago

Thanks for your quick response.

What happened to me is that the BREAKING CHANGE section was ignored when I tried to implement this package yesterday.

I tried a commit message that looks like this (contents redacted):

feat: some feature

BREAKING CHANGE: thing that is now not supported anymore

This doesn't trigger a MAJOR bump in my case, but just does a MINOR bump and lists 'some feature' under 'features'.

I also tried a commit message that looks like this:

feat!: some feature

BREAKING CHANGE: thing that is now not supported anymore

This does trigger a MAJOR bump, which is correct. But it doesn't list the contents of the breaking change footer. Instead it lists 'some feature' in the breaking changes section and no features section.

I'm wondering if that's the intended behaviour or not or if my commits are somehow not correct.

This is how it should work, I'll check what changed on the code about this.

marcocesarato commented 2 years ago

Hi, the issue what that was detected as BREAKING CHANGES only with the S (so plural) and not BREAKING CHANGE. Let me know if not it works on release 1.14.1.

patrickhoogkamer commented 2 years ago

Awesome, I will check and let you know.

patrickhoogkamer commented 2 years ago

Works a lot better now. For reference:

feat!: some feature

BREAKING CHANGE: removed X

This adds both 'some feature' and 'removed X' to breaking changes. In this specific case I would like it if 'some feature' gets listed under features, but that makes the whole thing a bit more complex and if I omit the exclamation mark it works like I would want it. So that's great, thanks. I will implement your package in our CI 🙂