GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

Version is not incrementing on develop after creating the release branch

Open mouradchama opened this issue 3 years ago • 7 comments

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

mouradchama avatar Jul 06 '22 11:07 mouradchama

Remove next-version, add a git tag 3.0.0 on an appropriate commit and try again, please.

asbjornu avatar Jul 19 '22 21:07 asbjornu

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);
    }

HHobeck avatar Sep 21 '22 16:09 HHobeck

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.

mouradchama avatar Dec 14 '22 18:12 mouradchama

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.

HHobeck avatar Mar 03 '23 06:03 HHobeck

I think this issue is related to https://github.com/GitTools/GitVersion/issues/2973.

HHobeck avatar Mar 18 '23 15:03 HHobeck

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.

github-actions[bot] avatar Jun 27 '23 11:06 github-actions[bot]

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.

github-actions[bot] avatar Sep 29 '23 11:09 github-actions[bot]