-
Notifications
You must be signed in to change notification settings - Fork 651
[Bug] 'Increment: Minor' config does not work. Patch is only ever incremented #2870
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
Comments
So turns out the increment: minor config line at the global level indeed doesn't seem to have any impact. I pushed that setting down into a branch specific block and then started working. I can't confirm if this is a bug or intended behaviour so will leave this open. |
This does feel like a bug to me. However, changing the behaviour could be seen as a breaking change, although one that should be easy enough to remedy (remove the global |
After updating, when I merge my develop branch to master, my develop branch goes back to the same version every time now. Example:
next-version: 9.0.1
mode: Mainline
branches:
master:
regex: master
increment: minor
develop:
tag: 'pre-release'
regex: develop
increment: patch
ignore:
sha: []
merge-message-formats: {} Patch increments when committed in develop, but once I merge from develop -> master, develop clears patch back to beginning, but doesnt increment the minor, so I get stuck in 9.0.1-pre-relase.1. |
@mdg215199, Try deleting the |
The branch workaround works: branches:
main:
regex: .*
source-branches: [main]
increment: minor
But the real fix should be to change this line:
for something that would use the something like (I'm not good in C#) return ToVersionField(IncrementStrategy ?? IncrementStrategy.Patch); Sorry, I'm not set to develop in C# right now, so I don't think I will open a pr. |
Folks, please take a look on my my post here Bottom like I'm struggling with auto incrementing 'Minor' version on the Mainline when feature branch gets merged into Master. Thanks! |
I have executed the following integration test succesfully on the current main branch: [Test]
public void JustATestFor2870()
{
var configuration = GitFlowConfigurationBuilder.New
.WithBranch("main", _ => _.WithIncrement(IncrementStrategy.Minor))
.Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeATaggedCommit("1.1.30");
fixture.MakeACommit();
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("1.2.0+2", configuration);
} On the root configuration layer we have some branch related properties which are only applying as a fallback. In the breaking change documentation the behavior is explained as following:
|
Describe the bug
I'm struggling to control the behaviour of GitVersion with respect to incrementing different parts of the version number. It appears to me that the configuration option named
increment
does not do anything. I'm wondering if I am using GitVersion entirely wrongly, would appreciate some feedback on the below.Expected Behavior
I expect every commit to main will increment minor.
Actual Behavior
Every commit to main increments patch
Steps to Reproduce
GitVersion.yml
Context
Flow is in essence each contributor opens a branch off main, creates commits. opens PR. PR is squashed merged into main. the new build of that new commit in main should be built incrementing minor unless the major bump message is included.
Lets say I have this under
git log --oneline
GitVersion wants the version of Commit 2 to be 0.1.1. I don't understand why when my config is set to increment minor.
Each commit on main should increment
minor
as this is a continuos deployment repo for a NuGet library.patch
increments are controlled through hotfix branches andmajor
increments are controlled through commit messages. So the default increment isminor
. I've been banging my head against the wall struggling to find how to use GitVersion?Your Environment
This can be reproduced on any environment. My test environment is just a sample empty git repo for testing GitVersion out for now.
The text was updated successfully, but these errors were encountered: