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

Switch default preset from angular to conventionalcommits #1652

Open
felipecrs opened this issue Oct 7, 2020 · 7 comments · May be fixed by #1836
Open

Switch default preset from angular to conventionalcommits #1652

felipecrs opened this issue Oct 7, 2020 · 7 comments · May be fixed by #1836

Comments

@felipecrs
Copy link

felipecrs commented Oct 7, 2020

I believe Conventional Commits has grown as a more general pattern enough to now become the default preset for semantic-release plugins, over angular.

@isuftin
Copy link

isuftin commented Oct 8, 2020

While we have this set specifically in all of our projects, I would think that switching the default would catch a LOT of people by surprise, right?

@felipecrs
Copy link
Author

It must be released as a breaking change, so no surprises.

@travi
Copy link
Member

travi commented Oct 20, 2020

thank you for opening this discussion. apologies for the delayed response from our end.

i think this is certainly worth considering and i would be probably be in favor of the change. as you mentioned, other tools (cz-cli, commitlint) that are often used with semantic-release are starting to change their defaults. it would be a more difficult switch to make, if that we're already true.

the angular and conventionalcommits specifications are still similar enough that common usage is probably still mostly compatible, but situations do arise where close isn't close enough.

this would clearly be a breaking change, so would result in a new major version of semantic-release, if we were to move forward with it. it may also be worth considering this against #1260 since that discussion could potentially go in the direction of not defining defaults at all, which would also be a very breaking change.

@felipecrs
Copy link
Author

felipecrs commented Oct 22, 2020

By the way, what's the right way to properly switch the presets without changing the rest of the configuration (such as the plugins list)?

npm install --save-dev conventional-changelog-conventionalcommits
{
  "release": {
    "preset": "conventionalcommits"
  }
} 

This is what I do.

@travi
Copy link
Member

travi commented Oct 23, 2020

without digging deep into the docs, what you mention here seems like it should work. have you confirmed with --dry-run?

i would recommend using dry-run any time you change your configuration, regardless of what should happen. it just gives you the chance to be fully confident in the behavior before actually releasing.

@felipecrs
Copy link
Author

felipecrs commented Oct 23, 2020

Ok, it seems that it works as expected:

$ npx semantic-release --dry-run --debug
[5:35:19 PM] [semantic-release] › ℹ  Running semantic-release version 15.14.0
  semantic-release:config load config from: /home/codespace/workspace/cz-cli/package.json +0ms
  semantic-release:config options values: {
  semantic-release:config   branch: 'master',
  semantic-release:config   repositoryUrl: 'https://github.com/commitizen/cz-cli.git',
  semantic-release:config   tagFormat: 'v${version}',
  semantic-release:config   plugins: [
  semantic-release:config     '@semantic-release/commit-analyzer',
  semantic-release:config     '@semantic-release/release-notes-generator',
  semantic-release:config     '@semantic-release/npm',
  semantic-release:config     '@semantic-release/github'
  semantic-release:config   ],
  semantic-release:config   preset: 'conventionalcommits',
  semantic-release:config   _: [],
  semantic-release:config   'dry-run': true,
  semantic-release:config   d: true,
  semantic-release:config   dryRun: true,
  semantic-release:config   debug: true,
  semantic-release:config   '$0': 'node_modules/.bin/semantic-release'
  semantic-release:config } +2ms
  semantic-release:plugins options for @semantic-release/npm/verifyConditions: {} +0ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/github/verifyConditions: {} +2ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {} +0ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
  semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {} +1ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
  semantic-release:plugins options for @semantic-release/npm/prepare: {} +0ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/npm/publish: {} +0ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
  semantic-release:plugins options for @semantic-release/github/publish: {} +1ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/github/success: {} +0ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
  semantic-release:plugins options for @semantic-release/github/fail: {} +0ms
[5:35:20 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[5:35:20 PM] [semantic-release] › ℹ  This test run was triggered on the branch felipecrs/use-cc-preset, while semantic-release is configured to only publish from master, therefore a new version won’t be published.

@travi
Copy link
Member

travi commented Oct 23, 2020

You could also use dry-run in your release branch and it will tell you the version that would be produced. That way you could confirm that it is understanding the new commit convention the way you are expecting it to.

@felipecrs felipecrs linked a pull request Mar 8, 2021 that will close this issue
felipecrs added a commit to felipecrs/semantic-release that referenced this issue Mar 8, 2021
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes.

Closes semantic-release#1652
felipecrs added a commit to felipecrs/semantic-release that referenced this issue Mar 8, 2021
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes. To
restore the previous behavior, use `preset: 'angular'` or the new cli
option, `--preset angular`.

Closes semantic-release#1652
felipecrs added a commit to felipecrs/semantic-release that referenced this issue Mar 8, 2021
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes. To
restore the previous behavior, use `preset: 'angular'` or the new cli
option, `--preset angular`.

Closes semantic-release#1652
felipecrs added a commit to felipecrs/semantic-release that referenced this issue Mar 8, 2021
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral. Also, a new cli option was added:
`--preset`.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes. To
restore the previous behavior, use `preset: 'angular'` or the new cli
option, `--preset angular`.

Closes semantic-release#1652
felipecrs added a commit to felipecrs/semantic-release that referenced this issue Jan 17, 2022
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral. Also, a new cli option was added:
`--preset`.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes. To
restore the previous behavior, use `preset: 'angular'` or the new cli
option, `--preset angular`.

Closes semantic-release#1652
felipecrs added a commit to felipecrs/semantic-release that referenced this issue Jan 17, 2022
Nowadays the `conventionalcommits` is the closest thing we have that
looks like a standard and neutral. Also, a new cli option was added:
`--preset`.

BREAKING CHANGE: Previously, the default preset was `angular`. Despite
the similarities, the new one has some differences, such as accepting
exclamation marks (e.g. `feat!:`) for identifying breaking changes. To
restore the previous behavior, use `preset: 'angular'` or the new cli
option, `--preset angular`.

Closes semantic-release#1652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants