-
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] Hotfix branch name not taken as version source #2336
Comments
What happens if you configure hotfix branches with |
@asbjornu |
I assume this behaviour was changed in #1541, where before, numbers in branch names were accidentally interpreted as version numbers, causing trouble all over the place. Hotfix branches should probably be considered release branches by default, though. Would you be up for submitting a PR with this default configuration change? |
I can take a look and try to make the change. Probably by the end of the week, when I have free time. |
@asbjornu I made the change to default configuration and adjusted/added the test scenarios to the it. |
Great, I'll take a look at the PR. |
This issue is related to #2442 - merging release/hotfix branch to master. |
Would it be possible to submit a PR with a test that demonstrates this problem, if it still exists? |
Has been resolved with PR #2336 without the need of specifing IsRelease to true for Hotfix branches. |
🎉 This issue has been resolved in version 6.0.0-beta.1 🎉 Your GitReleaseManager bot 📦🚀 |
Describe the bug
In documentation: https://gitversion.net/docs/more-info/version-increments, at point Branch name it's mentioned that the version in Hotfix branch name should be taken as version source.
It's not working.
Was behavior changed and not documented?
Expected Behavior
In case there is version in hotfix branch e.g. hotfix/4.21.1, the version 4.21.1 should be taken as version source.
Actual Behavior
The version in branch name is not taken into consideration when calculating version.
Version calculated is lower than expected.
Possible Fix
From what I can see in VersionInBranchNameVersionStrategy class, the version is taken only from Release branches based on is-release-branch flag in GitVersion config.
It could be extended to check if a branch is hotfix with Regex, then try to get version from branch name.
Steps to Reproduce
Submitted Test Case scenario.
#2337
Context
When creating hotfix branch for a bug in a release, I expect to build the branch with same version as release.
As I have read documentation, I could achieve it with including version in a branch name.
Except it doesn't work.
It calculates version lower than the Release version, cause it doesn't take version from branch name.
Your Environment
The text was updated successfully, but these errors were encountered: