-
Notifications
You must be signed in to change notification settings - Fork 639
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
Increment 'Minor' number when merging feature branch in master in Mainline mode #1221
Comments
I would like to clarify what I want to achieve with GitVersion. We are working in GitHubFlow mode. We have a master branch that we push to production everytime that a pull request is accepted in the master branch. We don't accept direct push in the master branch. Everything has to go through a pull request. When a developer starts to work on something, he knows if he is working on a bug fix or a new feature. He therefore pulls the master branch to have the latest version and creates a branch from master. For a feature branch, he has to start the branch name by At this point, here is how we expect GitVersion to behave for the numbering of the master branch:
We therefore don't want to use +semver:minor and +semver:patch commit messages to manage how the master branch number is incremented. This would duplicate information since we already decided how to increment the number when we decided how to name our branch. Furthermore, commit message are often forgotten or used too often. We therefore don't want to rely on them and rely on something more simple: the branch name. This is a little similar to GitFlow where the name of the branch influences how the number of the master branch is incremented. For example, a branch starting with So, am I off track and GitVersion does not handle this desired behavior? If it is possible, how can it be done? |
Which version of GitVersion are you using? |
It was done yesterday with the latest version available on nuget.org. Since the version was updated yesterday on nuget.org, it was either 4.0.0-beta0012 or 4.0.0-beta0011. I don't have access to the machine where I did these tests currently. But i am sure it was beta11 or beta12. Do you think that beta 12 makes a difference? |
It's worth a shot! 😄 |
I confirm that I was using GitVersion 4.0.0-beta.12+1315.Branch.master.Sha.9c70946f68973b3b31b2861913c247fbe6c3f0ec. |
Oh, bummer. How do you feel like submitting a pull request with a failing test? Just have a look at the existing |
Note that you can see the problem in the following repository: https://github.com/mabead/GitVersion.MainlineMode. I could for sure submit a failing test. But before doing so, can you confirm that it is a bug in GitVersion and not that I am simply doing it wrong? |
Test has been added here: #1223 Good job for the tests by the way. They are very easy to read and augment. |
@mabead: Thanks for the test. I'm not sure whether this is a bug yet, but a failing test is the absolute best way to inspect it and fix it if it is. 😃 👍 |
@JakeGinnivan Thanks for the fix! Do you know when a new NuGet package will be made available? |
@asbjornu Do you plan to include this in a new NuGet package in the near future? |
@mabead: It will be released as a part of the next beta of v4, which I hope @JakeGinnivan will have time to do soon. |
@asbjornu @JakeGinnivan Any ETA on a nuget package that will contain this fix? I convinced people at my company to switch from an internal tool to GitVersion and now GitVersion losses credibility with everyday that goes by without a fix ;) |
So, is it possible now or not? Can someone confirm if GitVersion can be configured to auto-increment 'Minor' version when merge happens from feature to main line? Sample of the config would be fantastic. |
yes it is possible: |
I have a GitVersion.yml that contains the following
So my intent is:
Note that if I don't set the mode to
ContinousDeployment
for my feature branches, then GitVersion does not increment the Minor version. It always increment the patch number. I don't understand why but that's not the point...Then, look at the following operations:
To summarize:
What am I doing wrong? What do I have to do for master to jump to 1.4.0 as requested by the feature branch that just got merged?
The text was updated successfully, but these errors were encountered: