-
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
[Bug] VersionInBranchNameVersionStrategy only considers the release branch #2693
Closed
Tracked by
#3445
Labels
Milestone
Comments
As long as we don't have any regressions, that sounds like a fine improvement to me. 👍🏼 Do you have a solution in mind that you can submit a PR for? 🙏🏼 |
7 tasks
5 tasks
🎉 This issue has been resolved in version 6.0.0-beta.2 🎉 Your GitReleaseManager bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In order to calculate the next version, GitVersion evaluates the version numbers produced by various candidates and selects the one that yields the highest version number on a give branch. VersionInBranchNameVersionStrategy is one of the candidates and from the name of it, should only look at the current branch. For instance,
hotfix/17.1.0
. However, this strategy seems to be biased and only considers release branches. This approach probably violates the single responsibility principle and can be a source of bugs.Additionally, another strategy uses it and the version detection in the branch name could probably be parameterized.
Expected Behavior
The strategy should consider the version in the current branch, e.g.
hotfix/17.1.0
Actual Behavior
The version in the hotfix branch name has no chance to make it to the list of possible candidates.
Possible Fix
Make strategy branch agnostic.
Context
1.We created a hotfix branch (
hotfix/1.0.1
) from the tagv1.0.0
2. However, the calculated version number was still
1.0.0-something
because we had setprevent-increment-of-merged-branch-version
totrue
.3. In this situation, we would have expected the version number from the hotfix branch name to make it to the list of candidates as well.
Workaround
Set the
prevent-increment-of-merged-branch-version
tofalse
Environment
OS: Windows
GitVersion version: Latest
The text was updated successfully, but these errors were encountered: