Skip to content
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

[ISSUE]: develop does not increment on release branch creation or rc tag #4285

Open
2 tasks done
ian-twana opened this issue Nov 6, 2024 · 4 comments
Open
2 tasks done

Comments

@ian-twana
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.0.4

Operating system

macOS

What are you seeing?

We are experiencing an issue where our develop branch version is not being bumped as expected when a release branch is created. Specifically, when we create a release branch (e.g., release/8.5.0), we expect the develop branch to be bumped to 8.6.0-alpha.0. However, instead, it remains as 8.5.0-alpha.173.

Additionally, adding a tag like v8.5.0-rc.1 on the release commit does not result in any change to the develop branch version, which remains incorrect.

Configuration
Our GitVersion.yml configuration is very basic:

workflow: GitFlow/v1

What is expected?

  • When a release branch (release/8.5.0) is created, the version on the develop branch should be bumped to 8.6.0-alpha.0.
  • After tagging a release commit (e.g., v8.5.0-rc.1), the develop branch should adjust accordingly.

Steps to Reproduce

  1. Create a new release branch from develop, named release/8.5.0.
  2. Check the version on the develop branch. Expected: 8.6.0-alpha.0, Actual: 8.5.0-alpha.173.
  3. On the release/8.5.0 branch, add a tag such as v8.5.0-rc.1 to the latest commit.
  4. Check the version on the develop branch again. Expected: Some change or bump, Actual: No change (still 8.5.0-alpha.173).

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

@HHobeck
Copy link
Contributor

HHobeck commented Nov 6, 2024

Your scenario is ensured via the following integration test:

https://github.com/GitTools/GitVersion/blob/main/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs#L133

I think you need to analyze your use case and ensure e.g. that your repository is setup probably.

@ian-twana
Copy link
Author

@HHobeck thank you for the swift response, yeah it's odd for this was working when we were on an older version of GitVersion then bumped to the latest version. I will test it out with a fresh repository and see how I go.

@cadull
Copy link

cadull commented Dec 24, 2024

I'm trying to debug this situation too. Unfortunately, our commit history is not as clean as the test scenario. We have a hotfix (8.8.6) merged to the release branch (8.9), the release branch merged to dev (8.10) and dev merged back to release. This is causing build number issues in GitVersion 5.12, but the version is ok otherwise. GitVersion 6.1 is picking up the version from the hotfix (8.8.6) to release merge, giving 8.8.6 instead of 8.9 for release (ignoring the version in the branch name) and 8.9 instead of 8.10 for dev.

Edit: In creating test scenarios, GitVersion 6.1 seems to be particular with the version format. A tag of 1.0.0 is handled better than 1.0. Similarly, a release branch named release/1.0.0 works better than release/1.0.

Edit: So for us, adding a 8.8.0 tag in master fixes the release branch version and naming the release branch release/8.9.0 instead of release/8.9 fixes the dev branch version.

Ideally, it shouldn't matter if the trailing 0 version components are omitted, especially as one of the configuration regex allows for this.

@cadull
Copy link

cadull commented Dec 25, 2024

Since the OP used strict SemVer, I'll just leave with this note: that the breaking changes don't make it clear that short version numbers require the loose semantic version format. Although, it does make sense semver.org.

    [Test]
    public void TagsAndReleasesWithShortVersions()
    {
        // Loose semantic version format required for short version numbers
        var config = GitFlowConfigurationBuilder.New
            .WithSemanticVersionFormat(SemanticVersionFormat.Loose)
            .Build();

        // Create repository and tag version 1.0
        using var fixture = new EmptyRepositoryFixture();
        fixture.MakeATaggedCommit("1.0");
        fixture.AssertFullSemver("1.0.0", config);

        // Create dev
        fixture.BranchTo("develop");
        fixture.MakeACommit();
        fixture.AssertFullSemver("1.1.0-alpha.1", config);

        // Create release 1.1
        fixture.BranchTo("release/1.1");
        fixture.AssertFullSemver("1.1.0-beta.1+1", config);

        // Check dev version
        fixture.Checkout("develop");
        fixture.AssertFullSemver("1.2.0-alpha.0", config);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants