-
Notifications
You must be signed in to change notification settings - Fork 653
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
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.
@@ -0,0 +1,6 @@ | |||
namespace GitVersion.VersionCalculation; | |||
|
|||
public interface IContinuousDeliveryVersionCalculator |
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.
Didn't we agree to reduce these interfaces down to just one, as they all have the same method signature SematicVersion Calculate(NextVersion nextVersion)
?
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.
Well we discussed about that, but agreed to do the change after beta2, as it will require changing the VersioningMode
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.
Can you please explain why merging these interfaces will require changing VersioningMode
?
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.
Please check this changes
(NextVersionCalculator.cs / CalculateIncrementedVersion)
We currently have 3 VersionMode
s but we have 4 interfaces, and @HHobeck proposed to change the VersionMode
to
public enum VersioningMode
{
ManuallyDeployment, // previously ContinuousDelivery
ContinuousDelivery, // previously ContinuousDeployment
ContinuousDeployment, // new
Trunkbased // previously Mainline??
}
Or
public enum DeploymentMode
{
ManuallyDeployment, // previously ContinuousDelivery
ContinuousDelivery, // previously ContinuousDeployment
ContinuousDeployment, // new
Trunkbased // previously Mainline??
}
Then we have 4 modes and 4 interfaces. In that case if we define a property in a single interface like
public interface IVersionCalculator
{
VersioningMode VersioningMode { get; }
SemanticVersion Calculate(NextVersion nextVersion);
}
each implementation of this interface will set the mode accordingly.
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.
I still don't understand why we can't have one interface with 4 different implementations? I would also prefer discussing renaming and other large changes in separate issues. If we are to keep a mode
for what is basically mainline, I think we can just keep the name Mainline
.
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.
Mainline is confisuing IMO because we have a IsMainline
property as a branch configuration and a Mainline
value on the version mode. If you say the branch needs to be mainline then it's confusing. It was just a proposal from my side because if we are touching this lines of code it's easy to do it right away. But if you don't like it nevermind.
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! |
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: