Semantic Versioning – Handling Bugfixes and New Features in Same Release

release-managementsemantic-versioningversioning

After reading a lot about semantic versioning I got a basic understanding of the concept but I'm not sure what's the best way to increment the version number in the following case:

Let's pretend that the last release was version 1.0.0. Now, I've a bunch of pull requests. Some of them are fixing bugs, others add new features.

The semver spec states that the MINOR version should be increment for new features (that don't break anything) and the PATCH version for bug fixes.

My plan is to release the bug fixes and new features in the same release.

With this in mind, how would you version the next release with semver?

Best Answer

Assuming that the new features are backward compatible, you should increment the MINOR version number, an reset the PATCH level, .

Rationale:

semver 2.0.0 makes this crystal clear in clause 7:

  1. Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version is incremented.

The patch level is incremented only if the major and minor version doesn't change (i.e. no new functionality), but it is necessary to release a version that only corrects bugs.