-
Notifications
You must be signed in to change notification settings - Fork 651
Implement when PreleaseLabel is empty, the PreleaseTag is generated correctly #3447
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
Implement when PreleaseLabel is empty, the PreleaseTag is generated correctly #3447
Conversation
5f11137
to
45ea2c0
Compare
I'm done please review and merge to main. |
Is there any reason to have 4 new interfaces If we take in consideration your suggestion regarding public enum VersioningMode
{
ManuallyDeployment, // previously ContinuousDelivery
ContinuousDelivery, // previously ContinuousDeployment
ContinuousDeployment, // new
Trunkbased // previously Mainline??
} I would rather have a |
Yep good point. At this moment I have separated the behavior which not aligns with the Do you have something like this in mind? public interface IVersionCalculator
{
VersioningMode VersioningMode { get; }
SemanticVersion Calculate(NextVersion nextVersion);
}
public IVersionCalculator GetSpecificVersionCalculator(VersioningMode versioningMode)
{
return _serviceProvider.GetServices<IVersionCalculator>().Single(
element => element.VersioningMode == versioningMode
);
} |
Exactly, in this case we don't need that many interfaces for the all the modes, and we have only the implementations and one interface |
So what do you think @HHobeck should we make those changes to the VersionMode, or put that change into another PR? |
Agreed. |
I think it is better to do this in a separate PR. You mentioned already to do this after the beta.2 release. Which is fine with me. |
45ea2c0
to
263eb78
Compare
Also we need to discuss the naming. IMO the naming of VersioningMode is missleading. Maybe a better name might be DeploymentMode. What do you think? In addition what do you like more Trunkbased or Mainline? public enum DeploymentMode
{
ManuallyDeployment, // previously ContinuousDelivery
ContinuousDelivery, // previously ContinuousDeployment
ContinuousDeployment, // new
Trunkbased // previously Mainline??
} |
263eb78
to
2ef39cd
Compare
@asbjornu do you agree with this PR to be merged? |
6d0edc6
to
ae9cec8
Compare
15a0970
to
7f7163c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great stuff. The only thing I'm a bit wary about is the change from 1.0.1+46
to 1.0.1-46
unless label
is set to null
. Not because the change doesn't make sense, I think it's a good default, but because it's a breaking change. However, I think we should test this change out in the community and see what feedback we get.
src/GitVersion.Core/VersionCalculation/Abstractions/IContinuousDeliveryVersionCalculator.cs
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ContinuousDeliveryVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ContinuousDeploymentVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ContinuousDeploymentVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ManualDeploymentVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ManualDeploymentVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/NonTrunkBasedVersionCalculatorBase.cs
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/NonTrunkBasedVersionCalculatorBase.cs
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/TrunkBasedVersionCalculator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of typos, then I think this is good.
src/GitVersion.Core/VersionCalculation/ContinuousDeliveryVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ContinuousDeploymentVersionCalculator.cs
Outdated
Show resolved
Hide resolved
src/GitVersion.Core/VersionCalculation/ContinuousDeploymentVersionCalculator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superb! 👏🏼
Thank you @HHobeck for your contribution! |
@asbjornu I've been trying to make it so it doesn't output a prerelease number on my side, but setting "label" to null under GitVersion.yml doesn't work. This markdown file is also mentioning a similar solution, but still I can't figure it out: https://github.com/GitTools/GitVersion/blob/main/BREAKING_CHANGES.md.
When removing the label, I got that: Would it be possible to help me so that I have for the variable FullSemVer, the value '1.0.0+37' instead of '1.0.0-37'? Thanks in advance! |
Thank you @HHobeck for your contribution! |
Fix [Bug] When PreleaseLabel is empty, the PreleaseTag is not correctly generated #2347
Close #2347
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Checklist: