Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Breaking Change" not triggering major release #139

Closed
simlu opened this issue Aug 17, 2019 · 8 comments
Closed

"Breaking Change" not triggering major release #139

simlu opened this issue Aug 17, 2019 · 8 comments
Labels

Comments

@simlu
Copy link

simlu commented Aug 17, 2019

Current behavior

Using the following .releaserc.json file

{
  "analyzeCommits": {
    "preset": "angular",
    "releaseRules": [
      {"type": "feat", "release": "minor"},
      {"type": "fix", "release": "patch"},
      {"type": "perf", "release": "patch"},
      {"type": "docs", "release": "patch"},
      {"type": "chore", "release": false},
      {"type": "test", "release": false},
      {"type": "refactor", "release": false},
      {"type": "ci", "release": false},
      {"type": "amend", "release": false},
      {"scope": "no-release", "release": false}
    ],
    "parserOpts": {"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]}
  }
}

breaking changes seem to not trigger a major release. Not sure if this is a bug or a configuration issue, please advice.

Expected behavior

Expecting a major release

Environment

@AlexisMasseron
Copy link

I do have the same problem, patch and minor version are triggered correctly but major version is never updated when adding "BREAKING CHANGE" to commit message

@simlu
Copy link
Author

simlu commented Aug 19, 2019

@AlexisMasseron Unlikely that you're have the same issue unless you're using a custom config. I suspect that you're not using the correct syntax instead. Take a look at the docs and check out my previous commit messages that correctly triggered a breaking change.

@pvdlg pvdlg transferred this issue from semantic-release/semantic-release Aug 19, 2019
@pvdlg
Copy link
Member

pvdlg commented Aug 19, 2019

This is due to the way we process rules. For each commit we evaluate evaluate each of your rules, and if we find one that match we use it. IF we don't find then we look at the default rules.

Your commit is a fix and a BREAKING CHANGE. Because you have a rule that match fix and not that match a breaking change we use the fix one which trigger a patch.

In the default rules we have one (at the top) to match braking changes, but it's never evaluated as you have in your custom rule one that match your commit.

This is explained in the documentation: https://github.com/semantic-release/commit-analyzer#releaserules

To solve your problem you have to add {breaking: true, release: 'major'} at the top of your custom rules.

@pvdlg pvdlg closed this as completed Aug 19, 2019
@pvdlg pvdlg added the support label Aug 19, 2019
@simlu
Copy link
Author

simlu commented Aug 20, 2019

Hello @pvdlg ! Thank you very much for the swift reply! It is as always very much appreciated!

Fixed in blackflux/robo-config-plugin#478

Cheers, L~

@CheerlessCloud
Copy link

CheerlessCloud commented Oct 6, 2019

@pvdlg Hi 👋 I think that's very unintuitive behavior. What about in detail describe this case in the readme? Actually, README.md at master for now contains releaseRules without breaking: true but says that emit major release when BREAKING CHANGE exists in the commit message.

@abohannon
Copy link

abohannon commented Sep 2, 2020

I also can't get this to work. I'm not using a custom config and none of the following commit messages cause a major version bump.

BREAKING CHANGE: foo
breaking: foo
feat: this is a BREAKING CHANGE
feat: this is a breaking change

@travi
Copy link
Member

travi commented Sep 2, 2020

@abohannon if you are not using a custom config, your issue is different from what was being asked in this closed issue. in the future, please open a new issue instead.

are you trying to create your commits with only a subject? be sure to instead include the BREAKING CHANGE: in the body of your commit since any type of commit could potentially be breaking for consumers, and is therefore independent of the commit type

@hamzahamidi
Copy link

If you're using Angular preset don't forget to add a Colon : after the keyword BREAKING CHANGE to trigger major release:

BREAKING CHANGE: foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants