question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bump minor/patch version only when major version is 0

See original GitHub issue

Description

Quote from Specification Item 4, Semantic Versioning 2.0.0:

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

So it is reasonable to remain major version with zero even if there is a breaking change commit, i.e. bump version at minor level (0.y+1.z).

Use cases

I have a new project with major version of zero. The API may change before I release it to public. I want to use python-semantic-release to help me to tag and release to internal team, with a major version of zero to indicate it is in development stage.

Without the requested feature, if I change API, I have to remove BREAKING CHANGE warning in commit message (this is bad), or have to remember adding --minor flag when firing semantic-release command (this is not reliable).

With the requested feature, I only use --major flag manually to bump the version to 1.0.0 when I decide the project is stable enough to release to the public. All the other semantic-release publish commands will bump at the correct level automatically.

Possible implementation

Modify evaluate_version_bump function to return "minor" instead if current_version has major version of zero and the calculated bump have a value of "major".

I’d like to contribute a pull request if this is acceptable.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
danthcommented, Dec 5, 2020

@wyardley I’d write major_on_zero to match the existing option patch_without_tag.

Maybe a name like zero_is_unstable would be easier to understand?

2reactions
danthcommented, Dec 4, 2020

Although it fits the specification, I don’t think we can enable this by default because users may rely on the previous behaviour. Therefore a configuration option will be needed.

I’d also suggest having a way to trigger the bump to v1.0.0 using a commit message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Versioning 2.0.0 | Semantic Versioning
Semantic Versioning 2.0.0. Summary. Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes ...
Read more >
When do you change your major/minor/patch version number?
minor.release.build or some other scheme. I'm asking at what point in the release cycle do you change the number to 3.2.0? When ...
Read more >
Optional minor and patch versions #237 - semver ... - GitHub
use MAJOR.MINOR.PATCH versions ( 1.2.0 ) if you want to reference a specific (semver valid) version.
Read more >
How/When should I update the version number?
Yes, you should reset the patch number when you bump the minor version, and you should reset the patch and minor number when...
Read more >
Semver doesn't mean major.minor.patch, it means fails ...
I've been broken by every level of version bump. I've seen APIs that went from 1.0 -> 2.0 and really were only backwards...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found