-
Notifications
You must be signed in to change notification settings - Fork 652
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
[Bug] Incrementing steps does not occur when I expect them #2285
Comments
The second case actually behaves properly, as stated (https://gitversion.net/docs/more-info/how-it-works):
Regarding the first issue, I can assume it works properly as well but in my opinion, it's not mentioned the "Incrementing per commit" approach overrides the increment rules when tagging. Once more, I found a pretty clear statement but I cannot be 100% sure it matches my usage (https://gitversion.net/docs/reference/versioning-modes/continuous-deployment):
Regards. |
I'm sorry, but I'm having a hard time understanding exactly what it is you expect. Would it be possible for you to submit a pull request with a |
I would be glad to reproduce my issue but how should I proceed ? I don't know what a RepositoryFixture test is. My expectations are based on my own understanding of GitVersion docs. They are not what I would like or how it should behave. Let me try to put my words in a different way. The patch/minor increment done after a tag is described as a general behaviour, not something specific to the continuous delivery mode: (https://gitversion.net/docs/configuration)
(https://gitversion.net/docs/more-info/version-increments)
Therefore I was/am expecting that, when choosing the continuous deployment mode, each commit will increment the pre-release tag but once a (git) tag is applied (whatever the tag format is i.e. either "M.m.p-ciCommitsSinceVersionSourcePadded" for instance 1.1.0-ci0003, either "M.m.p" for instance 1.2.0), then the bump process explained in the quotes overrides the pre-release tag increment.
The actual behaviour of the second statement suits me well but also disturbs me because, according to me, documentation does not explain what happens when a git tag contains a pre-release tag (which is the case when using a build server that automatically tags successful builds). As of today, I think my expected behaviour is wrong and some examples in the doc can argue that the actual behaviour is the proper expected one: (https://gitversion.net/docs/more-info/how-it-works) Is it a bit more understandable ? Sorry if my words are not very clear. |
When you created this very bug report, it contained the following information:
Please read this information. If we get a |
Is this in any way related to #2340, perhaps? |
Two remarks/questions from my side:
|
If I take your first scenario and execute the following integration test on the main branch then the behavior of GitVersion is like I would expecting it. Why would you expect to increase the minor number after a pre-release? It makes no sense. Please see also the bug fix #3438. [Test]
public void Scenario1()
{
var configuration = GitFlowConfigurationBuilder.New
.WithVersioningMode(VersioningMode.ContinuousDeployment)
.WithBranch("main", builder => builder
.WithIncrement(IncrementStrategy.Minor).WithLabel("ci")
).Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeACommit();
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.1.0-ci.2", configuration);
fixture.MakeATaggedCommit("0.1.0-ci.3");
// ✅ succeeds as expected
fixture.AssertFullSemver("0.1.0-ci.3", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.1.0-ci.4", configuration);
fixture.ApplyTag("0.1.0");
// ✅ succeeds as expected
fixture.AssertFullSemver("0.1.0", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0-ci.1", configuration);
} |
The behavior in your second scenario is also correct. Please see the following integration test: [Test]
public void Scenario2()
{
var configuration = GitFlowConfigurationBuilder.New
.WithVersioningMode(VersioningMode.ContinuousDeployment)
.WithNextVersion("0.2.1")
.WithBranch("main", builder => builder
.WithIncrement(IncrementStrategy.Minor).WithLabel("ci")
)
.Build();
using var fixture = new EmptyRepositoryFixture("main");
fixture.MakeATaggedCommit("0.2.0");
// ✅ succeeds as expected
fixture.AssertFullSemver("0.2.0", configuration);
fixture.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("0.3.0-ci.1", configuration);
} To understand in which business use case the next-version might be good for I would like to point you to #3177 (comment):
Cheers |
🎉 This issue has been resolved in version 6.0.0-beta.2 🎉 Your GitReleaseManager bot 📦🚀 |
Dear all,
First of all, I would like to apologize if the following description comes from a misunderstanding.
Describe the bug
Using the below yml configuration (with the continuous deployment mode), no increment is applied after tagging when tag has format "M.m.p-ciCommitsSinceVersionSourcePadded" (this behaviour suits my needs but I don't want to take advantage of it if this really a bug).
If I add a bump message (excepted the major bump message) or/and a next-version value in the configuration file, it's not applied (+semver: patch in the below image).
next-version: 1.2.1
Expected Behavior
Since the
HighestTagBaseVersionStrategy
strategy is used,ShouldIncrement
is true and I expect that GitVersion returns 1.3.0-ci0001 (becauseincrement: Minor
for the master branch).At least, I would expect next-version to be prior to the increment field (or somehow it overrides it) so that the next GitVersion output would be 1.2.1-ci0001.
Does GitVersion select the highest tag among all the strategies ?
Actual Behavior
GitVersion returns 1.2.0-ci0002 (it's fine for me because I would like automated tagging from the build server but I'm a bit puzzled).
GitVersion returns 1.3.0-ci0001.
Steps to Reproduce
Context
We are a small team of three persons working on a railway simulator using Unity3D.
Because Unity introduced packages (npm-like) recently, we think it's time to have a modular approach to ease maintenance and progress. Going a bit further, thoses packages will use .Net Standard libraries (assemblies) for multiple reasons: cross-platform, decoupling logic from UI (graphical engine) and so on...
Based on this vision and on our small number (each one almost responsible for a dedicated task during a given period), I consider that using the centralized Git flow (a single branch, the most basic one) is still applicable for most cases (for now).
Because GitVersion is popular and still maintained regarding MSBuild (from my short experience, many MSBuild tasks projects are not maintained anymore and do not work properly those days ; therefore I'm planning to use Nuke but I like thinking in a standard way as well for fallback purposes).
As a result, I'm trying to find out a proper GitVersion strategy/configuration for a centralized workflow.
I wish to use a build server in a way that successful builds would lead to a new tag. Is this approach still valuable today? What else could I do to get a similar result?
So far, in my opinion, documentation gives freedom to interpretation regarding the way GitVersion should handle the build number coming from a build server (and that's pretty normal).
From my perspective, section Incrementing per commit and its linked blog post are the most valuable info for people looking for automated continuous building (whatever it's continuous integration/delivery/deployment). That's why I chose the continuous deployment mode even if we will only do continuous integration for starters (as result, I get the impression mode names are not appropriate and a mode is not picked up according to the adopted continuous approach)
Environment
Windows 10
GitVersion.Portable v5.3.4
GitVersion.yml:
Test project history (local Git repo):
Tags with format "M.m.p-ciCommitsSinceVersionSourcePadded" would be tags automatically created by the build server in case of success while building (& testing). It uses the NugetVersionV2 GitVersion output.
Tags with format "M.m.p" are tags manually created (corresponding to actual releases).
The text was updated successfully, but these errors were encountered: