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

Option to increment minor or major version instead of patch #212

Closed
adamralph opened this issue Mar 3, 2019 · 10 comments · Fixed by #216
Closed

Option to increment minor or major version instead of patch #212

adamralph opened this issue Mar 3, 2019 · 10 comments · Fixed by #216
Labels
enhancement New feature or request
Milestone

Comments

@adamralph
Copy link
Owner

When the latest tag is an RTM, and is on an older commit, the patch version is incremented. E.g. if the latest tag is 1.0.0 at a height of 3 commits, the current commit version is 1.0.1-alpha.0.3.

Some projects do not use the patch version, so it would make more sense for the version to be 1.1.0-alpha.0.3. Some projects may even not use the minor version, which means the version should be 2.0.0-alpha.0.3.

This could be configurable via a new option.

@adamralph adamralph added the enhancement New feature or request label Mar 3, 2019
@adamralph adamralph added this to the 1.1.0 milestone Mar 3, 2019
@enzian
Copy link
Contributor

enzian commented Apr 4, 2019

hey, need help on that?

@adamralph
Copy link
Owner Author

Hey @enzian, sure thing! I guess, from the user's perspective, this would result in a new property. Something like:

<MinVerAutoIncrement>major|minor|patch(default)</MinVerAutoIncrement>

I'm not wild about the name MinVerAutoIncrement. Any better idea? /cc @leastprivilege

@enzian
Copy link
Contributor

enzian commented Apr 4, 2019

I preliminarily introduced the --increment-segment option in the CLI, but I don't have a strong opinion about the naming either!

@adamralph
Copy link
Owner Author

@enzian thanks for the PR!

But also apologies, because I was not clear in my previous comment:

<MinVerAutoIncrement>major|minor|patch(default)</MinVerAutoIncrement>

I was using | to mean "or". That is, the default (implicit) value would be:

<MinVerAutoIncrement>patch</MinVerAutoIncrement>

And that could be changed to:

<MinVerAutoIncrement>minor</MinVerAutoIncrement>

or:

<MinVerAutoIncrement>major</MinVerAutoIncrement>

I can't think of a valid use case to auto-increment more than one part of the version.

@enzian
Copy link
Contributor

enzian commented Apr 5, 2019

@adamralph : I've seen (just once...) that a company did not release versions like 2.0.0. The first version they would release was 2.1.0 (for what reason is unclear to me...)! Should I switch to a single value?

@adamralph
Copy link
Owner Author

That sounds like a bizarre versioning scheme and not one I really want to encourage. 😉

I think, for now, let's stick to a single value for simplicity. We can always extend it to multiple values later, but I hope noone asks for that. 😉

@enzian
Copy link
Contributor

enzian commented Apr 5, 2019

@adamralph maybe it was also a case of over engineering is underrated ;-) I patched it!

@adamralph adamralph changed the title Option to increment minor version instead of patch Option to increment minor or major version instead of patch Apr 5, 2019
adamralph pushed a commit that referenced this issue Apr 5, 2019
The when applying minver, a user should be able to override the default
behavior of how versions are incremented. The current behavior is, that
whenever minver is run on a commit, that does not carry a minver tag and
is at a height > 0 from the last minver tag, the patch version will be
incremented and the height added. For example: When the latest tag is
1.2.3 and the commit is at a height of 1 from this tag, the resolved
version will be 1.2.4-alpha.0.1.

This behavior should be customizable by setting a property that defines
what segments of the version (major, minor, patch) should be
incremented.

addresses: #212
adamralph pushed a commit that referenced this issue Apr 5, 2019
For msbuild, the -i parametere has been switched to single-value
parameter that accepts a comma separated list of version segments to
increment.

The msbuild target was extended to support the new MinVerAutoIncrement
property. It's default value is set to `patch` but can be set to
`major`, `major, minor` or `major, minor, patch`. Order is not relevant.
It also possible to increment combinations like `major, patch` or
`minor, patch`.

addresses: #212
adamralph pushed a commit that referenced this issue Apr 5, 2019
There is new documentation on the various combinations of
autoincrementation of versions. These samples should correspond to the
testcases and be validated.

addresses: #212
adamralph pushed a commit that referenced this issue Apr 5, 2019
Until now it was possible to increment multiple segments of a version
when autoincrementation happened. This behavior is not backed by a
sensible use case has been removed.

addresses: #212
@adamralph
Copy link
Owner Author

Released in 1.1.0-beta.1.

@leastprivilege would you like to give it a try? Just add a property:

<MinVerAutoIncrement>minor</MinVerAutoIncrement>

@adamralph adamralph mentioned this issue Apr 12, 2019
12 tasks
@leastprivilege
Copy link

sorry - swamped right now...

@adamralph
Copy link
Owner Author

@leastprivilege FYI I just pushed 1.1.0-rc.1.

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

Successfully merging a pull request may close this issue.

3 participants