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

"feat:" commits causing PATCH instead of MINOR #454

Closed
JVMartin opened this issue Sep 12, 2019 · 5 comments
Closed

"feat:" commits causing PATCH instead of MINOR #454

JVMartin opened this issue Sep 12, 2019 · 5 comments
Assignees
Labels

Comments

@JVMartin
Copy link

JVMartin commented Sep 12, 2019

We are using version 7.0.0.

Expected behavior:
feat: commit messages should result in a MINOR bump.

Actual behavior:
feat: commit messages result in a PATCH bump.

Details:
We have our pipeline set up to release on every commit to master, notice how both fix and feat result in patches:
image

Here is the output from standard-version on a feat: release:

$ npx standard-version --infile docs/CHANGELOG.md
✔ bumping version in package.json from 0.14.6 to 0.14.7
✔ outputting changes to docs/CHANGELOG.md
✔ committing package.json and docs/CHANGELOG.md
✔ tagging release v0.14.7
ℹ Run `git push --follow-tags origin master && npm publish` to publish

Here is the resulting commit:
image

@JVMartin JVMartin changed the title "feat" incorrectly causing patch bump instead of minor bump "feat:" commits causing PATCH instead of MINOR Sep 12, 2019
@jbottigliero jbottigliero self-assigned this Sep 13, 2019
@jbottigliero
Copy link
Member

Hey @JVMartin – as of 7.0.0 this is expected behavior for module versions < 1.0.0.

You can follow the related changeset (and conversation) here: #347

If you don't mind, I'm going to close this as it is expected behavior. If you need to break out of this behavior for a release, consider using the --release-as=minor flag.

@JVMartin
Copy link
Author

JVMartin commented Sep 13, 2019

Hey @jbottigliero , thanks for the details!

IMO, the behavior of standard-version should not be different for pre-1.0.0 versions. Let me explain why...

We run standard-version automatically in a CI script, and we really need a way for it to do both MINORs and PATCHes based on commit messages, even in < 1.0.0. We obviously can't add the --release-as=minor flag to the CI script, because then every release would be MINOR, which is just as bad as every release being PATCH.

So it seems like our only options for pre-1.0.0, is to have every release be a PATCH, or every release be a MINOR, which is not great.

If the functionality for pre-1.0.0 were exactly the same as for post-1.0.0, then both automated and non-automated workflows would be supported completely.

Everyone could do a BREAKING CHANGE: for major, a feat: for minor, and a fix: for patch. And the world would live in perfect harmony, supporting both automated and non-automated workflows, for both pre-1.0.0 and post-1.0.0.

Thoughts?

@JVMartin
Copy link
Author

JVMartin commented Sep 13, 2019

Also, regarding #347...

The title of the PR is feat!: bump minor rather than major, if release is < 1.0.0.

That is, in fact, exactly what we need it to do! Currently this is broken, because feat bumps PATCH rather than MINOR, when it is supposed to bump MINOR, and #347 agrees that it's supposed to bump MINOR...

@JVMartin
Copy link
Author

JVMartin commented Sep 13, 2019

You know what, I think I misunderstood. 😞

We can still get a MINOR to happen in < 1.0.0 by doing a BREAKING CHANGE in the commit notes of a feat.

So actually, we're all set. Thanks much! 😄

@coreyfarrell
Copy link
Contributor

conventional-changelog/conventional-changelog#452 (comment) explains the reasoning for the behavior. The intent is to work well with npm by allowing caret semver ranges to install all non-breaking updates.

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

No branches or pull requests

3 participants