GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

[Bug] When merging to master, sematic never increments. This also causes develop branch to go back to start of patch, but never increments and keep making previous build versions

Open mdg215199 opened this issue 3 years ago • 3 comments

Describe the bug Updated to latest semantic versioning, and scripts taht worked in v4 and start of v5 is now broken. Have tried my own scripts, as several other ones I have found that had previous worked (and also tried several from documentation that also seem to not work)

Example scripts: Also, same issue if i try this:

next-version: 9.0.1
mode: ContinuousDelivery
branches:
  master:
    regex: main
    mode: ContinuousDelivery
    tag:
    increment: Main
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
  feature:
    regex: feature(s)?[/-]
    mode: ContinuousDeployment
  develop:
    regex: dev(elop)?(ment)?$
    mode: ContinuousDeployment
    tag: alpha
  hotfix:
    regex: hotfix(es)?[/-]
    mode: ContinuousDeployment
    tag: beta
  release:
    regex: release(s)?[/-]
    mode: ContinuousDeployment
    tag: rc
ignore:
  sha: []

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: {}

With the continousDeployment, develop branch is fine, but it never increments when merging to master. In the mainline, when I merge to master, it never increments, and develop branch never increments, and goes back to it's original patch version, which I am then building versions that had already been built before.

Expected Behavior

Was hoping I could do an auto-increment on either "minor" and/or "patch" when trying to merge to master. Neither seem to work. I might be doing something wrong... though, these worked fine in start of 5.0 (and also in v4)

Actual Behavior

No matter how I merge, master is always 9.0.1. Develop, if in continuous, at least increments. If in mainline, it then starts to make build with versions that had previous been built

Possible Fix

? not sure. Maybe i'm doing something wrong?

Steps to Reproduce

Try to run the scripts above, then try to merge. Unable to increment minor/patch when merging/pr.

  • Version Used: 5.8.2
  • Operating System and version (Windows 10, Ubuntu 18.04): Ubuntu 18.04
  • Link to your CI build (if appropriate): Above, I also tried several other examples. Hopefully, I can laugh at my stupidity, and move on.

Thanks for all help, and let me know if you need anything else.

mdg215199 avatar Feb 24 '22 03:02 mdg215199

What happens if you remove the next-version key from GitVersion.yml?

asbjornu avatar Mar 02 '22 23:03 asbjornu

@mdg215199 Maybe this is broken in the specific GitVersion you're using. I was experiencing some odd versioning issues as well which seem to be fixed in 5.10.1.

mycroes avatar May 02 '22 12:05 mycroes

It is not clear for me what you are actually doing, Could you please give us some steps to reproduce? Or even create a integration test with your expectation?

    [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 17:09 HHobeck

I'm going to close this issue because of missing steps to reproduce. Please provide more information and re-open the bug if you like or create a new one. Thank you very much.

HHobeck avatar Mar 20 '23 10:03 HHobeck