GitVersion
GitVersion copied to clipboard
Version is not incrementing on develop after creating the release branch
Hi,
Describe the bug I'm facing an issue with GitVersion, I'm following the GitFlow strategy, this is my GitVersion file:
next-version: 3.0.0
update-build-number: true
assembly-informational-format: '{SemVer}'
branches:
develop:
tag: beta
feature:
mode: ContinuousDeployment
release:
tag: rc
increment: Minor
track-merge-target: true
main:
track-merge-target: true
hotfix:
tag: rc
The meta data was incrementing until I created the release branch: From the release branch I have the right versions (3.0.0-rc1, 3.0.0-rc2 ....), but from develop GitVersion continue using the 3.0.0-beta.x, without incrementing the minor. The stable package (merge release into master) is not created yet. The release name does not include the version (the name is : Releases/R2207), I'm taging the release branch after each build.
Expected Behavior
On develop I expect versions: 3.1.0-beta.1
Actual Behavior
3.0.0-beta.1
Your Environment
Azure Devops GitVersion 5.10.3
- Version Used:
- Operating System and version : Ubuntu 20.04.4
Remove next-version, add a git tag 3.0.0 on an appropriate commit and try again, please.
Could you please create an integration test and specify your actual scenario so we are knowing what your would like to achieve?
[Test]
public void __Just_A_Test__()
{
string yaml = @"...";
var configuration = ConfigSerializer.Read(new StringReader(yaml));
using var fixture = new EmptyRepositoryFixture();
fixture.MakeATaggedCommit("2.0.0");
// ✅ succeeds as expected
fixture.AssertFullSemver("2.0.0", configuration);
// ❌ expected: ...
fixture.AssertFullSemver("...", configuration);
}
Here the test with what I expect :
[Test]
public void TestMethod1()
{
var yaml = @"branches:
develop:
tag: beta
release:
tag: rc
hotfix:
tag: rc";
var configuration = ConfigurationSerializer.Read(new StringReader(yaml));
using var fixture = new EmptyRepositoryFixture();
fixture.MakeACommit("one");
fixture.BranchTo("releases/R2301");
fixture.MakeATaggedCommit("1.0.0-RC.1");
//fixture.Checkout("main"); <============= it works if I uncomment this 2 lines
//fixture.ApplyTag("1.0.0");
fixture.BranchTo("develop");
fixture.MakeACommit("two");
fixture.AssertFullSemver("1.1.0-beta.1", configuration);
}
I would like to switch to the version 1.1 in develop event if the release is not merged yet into master.
Hi @mouradchama. Thank you for providing the integration test. What would be your expectation on the develop branch if the releases/R2301 branch has not been merged to develop? To name your branch like release/1.0.0 is not an option for you? Please take a look to the following documentation: https://gitversion.net/docs/learn/branching-strategies/gitflow/examples#minor-release-branches.
I think this issue is related to https://github.com/GitTools/GitVersion/issues/2973.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.