Version bump only seems to happen on first branch/commit #4199
-
I'm new to GitVersion and am trying to implement SemVer versioning of my NuGet package in Azure Pipelines. At this point, I haven't received permission from my org to install the GitTools utility -- so I'm doing thing a bit more manually. I've tried the following:
Steps 1 - 8 all seem to be what I would expect from all the documentation and examples. However, steps 9 - 11 are where I get confused. In my mind, semver in step 11 should be 1.3.0-ImplementSubtract.1 or at least 1.2.0-ImplementSubtract.1. IOW, The minor version should be incremented. Here is the output of the GitVersion variables from the build in step 11: Again, I'm new to GitVersion so maybe I'm not fully understanding how to use it. Could someone help me determine if I'm doing something wrong or if GitVersion just is not working correctly in my environment? Update Based on other answers (and the fact that I use GitHubFlow, I changed my gitversion.yaml to the following (unfortunately, I get the same results). new gitversion.yaml
original gitversion.yaml
azure-pipelines.yaml
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 26 replies
-
The mainline version strategy is a new algorithm but can be seen as a equivalent to the previous Mainline mode: workflow: GitHubFlow/v1
strategies:
- ConfiguredNextVersion
- Mainline
Why should it? GitVersion aggregates the minor and patch bump message to just minor. |
Beta Was this translation helpful? Give feedback.
-
@HHobeck , The discussion link you provided was helpful -- thank you. I added the strategies that you listed above directly to the main branch and commited with +semver:major. As expected, my build now used semver of 2.0.0 (was 1.1.0). However, I then branched from master (feature-ImplementMultiply), made a change and commited with +semver:minor. When I push the branch, the build kicks off and GitVersion shows the semver as 2.0.0. Based on my the GitHubFlow defaults and the discussion thread you pointed me to, I would've expected 2.1.0. Am I looking at this wrong? |
Beta Was this translation helpful? Give feedback.
-
@HHobeck So it looks like it works for you, but you can see my GitVersion variables are clearly not the same as what you're showing. So I'm trying to figure out why it doesn't work in my scenario. My configuration is VERY minimal -- mostly using GitHubFlow defaults so I can't understand why my minor version is not incrementing. My git tree/commits looks almost identical: This is my entire gitversion.yml file:
One difference I see is your feature branches are created as |
Beta Was this translation helpful? Give feedback.
-
@HHobeck Not doubting you -- that may be part of the problem I'm having. However, I just committed directly to Also, if I don't Squash my commits, would the PR message still be necessary since each commit with its bump message is being directly committed to the main branch when I merge my PR? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@HHobeck were you able to re-create the issue I'm having given my "most recent steps" post from last week? I'm just wondering if you might have any more ideas as to why this is not working for me? Are there other things that I can try? Should I open an issue for this? Thanks |
Beta Was this translation helpful? Give feedback.
Please use version 6.*