-
Notifications
You must be signed in to change notification settings - Fork 652
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
Provide a way to translate the PreReleaseLabel (alpha, beta etc) to a numeric value to avoid version collisions #1433
Provide a way to translate the PreReleaseLabel (alpha, beta etc) to a numeric value to avoid version collisions #1433
Conversation
What do you (and @BCSharp, @JakeGinnivan, @asbjornu) think about providing default values for the pre-release weight supporting the standard alpha->beta->final scheme? This PR offers a clean solution for those who know the problem, but it always requires additional configuration. I think the default configuration should be usable already, giving a consistent picture with the rest of the default configuration. Now the question what to use as default weights. On Windows we have a 16-bit constraint we cannot do anything against. In addition, I'd like to have the weights as nice numbers in base-10, which allows easy back-mapping for humans. Next, I expect the majority of builds to come with alpha-labes, so I want to reserve roughly the half of the available number space for them. The other half can then be used for beta, (rc, as needed) and the final build. So here comes by proposal:
For special requirements there is enough room to fit release candidates after the beta, allow more then one "final build" or even to assign a non-zero offset for alpha-builds to make them "heavier" then CI-builds from feature branches. However, such things go far beyond an easy to understand default config. |
@jbaehr I agree that providing a branch specific default |
I have mixed thoughts about providing default non-zero values in this PS. On one hand, it is nice to have a reasonable behaviour offered out-of-the box that the suggested defaults would provide. In the end, I would not do it in this PR. The PR as is now is more likely to be accepted by the maintainers, (since it does not change anything on the current behaviour unless explicitly configured) and having it merged is way more important than sensible defaults. |
@BCSharp My proposal about sensible defaults for the branch-specific I'm explicitly not proposing |
@jbaehr Yes, indeed. So in this case, it makes more sense to have reasonable defaults right from the beginning. |
@ruhullahshah, sorry for my late input on this, but I agree with @jbaehr and @BCSharp in that reasonable defaults make a lot of sense. If you could add that and rebase this PR, I'd love to merge it and have it shipped as part of GitVersion 5. |
@asbjornu I have updated the the PR with the requested changes. |
@ruhullahshah, awesome, thanks! @jbaehr and @BCSharp, do you agree with the defaults provided in the PR? If so, this is good to be merged as soon as the tests turn green. |
My proposal for defaults ("alpha":0, "beta":30_000, "<non, aka final>":60_000) was based on the assumption that the prerelease number is reset whenever the next label is reached. This holds true for "beta", but recently I've observed that the final build (without a label) has a value of all commits since the last final in it's prerelease number. Given this fact, 60_000 would overflow the 16-bit if we have more then good 5000 commits since the last release. |
I suggest we decrease the defaults for <non, aka final> from 60,000 to 55,000 for now and then open a new PR for the observation reported by @jbaehr, if required. Also these are merely the defaults and can be tuned using the |
@ruhullahshah, sounds good. Can you implement the decrease and do a rebase on |
2515f40
to
49e3650
Compare
@asbjornu Done |
Excellent, @ruhullahshah. But can you please repeat the rebase due to the merge of #1599? 😅 |
…igs and leverage the same using a new GitVersion variable WeightedPreReleaseNumber
… check for default value on the release branch, updated the approved file
49e3650
to
db30469
Compare
@asbjornu Done :D |
🙏 |
Provides a way to translate the
PreReleaseLabel
to a numeric value in order to avoid version collisions across different branches. For example, a release branch created after "1.2.3-alpha.55" results in "1.2.3-beta.1" and thus e.g. "1.2.3-alpha.4" and "1.2.3-beta.4" would have the same file version: "1.2.3.4".Related Issues 1145, 1366