-
My first experiment had gone well. I had simulated a release cycle and got a 1.1.0 release, and then the develop branch started reporting 1.2.0 based version numbers, which was good. I then started simulating a second release cycle, and that's where things have gone awry. The git status is as follows: The tags have been added by the CI/CD process based on what gitversion reports. The master, develop and release/* branches get tagged. The latest build of the "release/1.2" branch however is now reporting a version of 1.2.0-alpha.2. This is presumably because this is an explicit tag on this commit, despite that tag being added "to the develop branch" (added as a tag from a build of that branch). My GitVersion.yaml file is empty, so config is standard. The output from gitversion is:
This seems to suggest that at least automatically applying tags to the "develop" build is a bad idea, or at least does an unexpected thing. Any suggestions on how I modify my usage, configuration, or CI/CD workflow to produce a more expected output? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 21 replies
-
What would you consider "a more expected output" in the given scenario? |
Beta Was this translation helpful? Give feedback.
-
Actually I notice that I got the same |
Beta Was this translation helpful? Give feedback.
-
The title of this discussion is: Could you please focus on this question and mark it as answered if it has been answered. |
Beta Was this translation helpful? Give feedback.
-
May I ask you: Why do you expect the semantic version of a tag to be ignored just because the pre-release label is different on the branch? See [Bug] Consider pre-release tags only when they matching with the label name on branch #3438. [Test]
public void Just_A_Test()
{
var configuration = GitFlowConfigurationBuilder.New.Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.0.1-1", configuration);
fixture.BranchTo("develop");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"0.1.0-alpha.2", configuration);
fixture.ApplyTag($"1.0.0-alpha.2");
// ✅ succeeds as expected
fixture.AssertFullSemver($"1.0.0-alpha.2", configuration);
fixture.BranchTo("release/next");
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver($"1.0.0-beta.1+3", configuration);
} |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
The feature branch in the gitflow workflow has a increment strategy set to inherit. Thus in your scenario it inherits from develop and release branch. I would recommend you to use the beta release: https://github.com/GitTools/GitVersion/releases/tag/6.0.0-beta.2