Skip to content

Commit 97f2019

Browse files
committed
Review remarks integrated
1 parent 7f7163c commit 97f2019

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

BREAKING_CHANGES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* The process of increasing the version with bump message when `CommitMessageIncrementing` is enabled and increment strategy is `None` has been changed.
2828
* A new configuration property with name `version-in-branch-pattern` has been introduced. This setting only applies on branches where the option `is-release-branch` is set to `true`. Please notice that the branch name needs to be defined after the version number by default (instead of `support/lts-2.0.0` please name the branch like `support/2.0.0-lts`).
2929
* The `is-release-branch` property of the `hotfix` branch setting has been changed from `false` to `true`. If present the hotfix number will be considered now by default.
30-
* In the git hub and the git flow workflow the `label` property is by default set to an empty string on the `main` branch. This yields to a pre-release version on `main` with an empty tag. Instead of for instance `1.0.1+46` git-version generates the full semantic version `1.0.1-46` instead. This behavior can be changed to generate only main versions (no pre-release version) with setting the label to `null` (Please keep in mind that the `label` property on root needs to be set to `null` as well otherwise the fallback applies). This change is caused by issue #2347.
30+
* In the GitHub and the Git Flow workflows the `label` property is by default set to an empty string on the `main` branch. This yields to a pre-release version on `main` with an empty tag. Instead of for instance `1.0.1+46` GitVersion generates the full semantic version `1.0.1-46` instead. This behavior can be changed to generate only stable versions (no pre-release version) with setting the label to `null` (Please keep in mind that the `label` property on root needs to be set to `null` as well, otherwise the fallback applies). This change is caused by issue #2347.
3131
3232
## v5.0.0
3333

src/GitVersion.Core/VersionCalculation/ContinuousDeliveryVersionCalculator.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ public ContinuousDeliveryVersionCalculator(ILog log, IRepositoryStore repository
1313

1414
public SemanticVersion Calculate(NextVersion nextVersion)
1515
{
16-
using (this.log.IndentLog("Using continues delivery typology to calculate the incremented version!!"))
16+
using (this.log.IndentLog("Using continuous delivery workflow to calculate the incremented version."))
1717
{
1818
var preReleaseTag = nextVersion.IncrementedVersion.PreReleaseTag;
1919
if (!preReleaseTag.HasTag() || !preReleaseTag.Number.HasValue)
20-
throw new WarningException("--PRE--CONDITION--FAILED--");
20+
{
21+
throw new WarningException("Continues delivery deployment requires a pre-release tag.");
22+
}
2123

2224
return CalculateInternal(nextVersion);
2325
}

src/GitVersion.Core/VersionCalculation/ContinuousDeploymentVersionCalculator.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ public ContinuousDeploymentVersionCalculator(ILog log, IRepositoryStore reposito
1313

1414
public SemanticVersion Calculate(NextVersion nextVersion)
1515
{
16-
using (this.log.IndentLog("Using continues deployment typology to calculate the incremented version!!"))
16+
using (this.log.IndentLog("Using continuous deployment workflow to calculate the incremented version."))
1717
{
18-
if (!nextVersion.Configuration.IsMainline || nextVersion.Configuration.Label is not null)
19-
throw new WarningException("--PRE--CONDITION--FAILED--");
18+
if (nextVersion.Configuration.Label is not null)
19+
{
20+
throw new WarningException("Continues deployment requires no pre-release tag.");
21+
}
22+
if (!nextVersion.Configuration.IsMainline)
23+
{
24+
throw new WarningException("Continues deployment only supported for mainline branches.");
25+
}
2026

2127
return CalculateInternal(nextVersion);
2228
}

src/GitVersion.Core/VersionCalculation/ManualDeploymentVersionCalculator.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ public ManualDeploymentVersionCalculator(ILog log, IRepositoryStore repositorySt
1212

1313
public SemanticVersion Calculate(NextVersion nextVersion)
1414
{
15-
using (this.log.IndentLog("Using manual deployment typology to calculate the incremented version!!"))
15+
using (this.log.IndentLog("Using manual deployment workflow to calculate the incremented version."))
1616
{
1717
var preReleaseTag = nextVersion.IncrementedVersion.PreReleaseTag;
1818
if (!preReleaseTag.HasTag() || !preReleaseTag.Number.HasValue)
19-
throw new WarningException("--PRE--CONDITION--FAILED--");
19+
{
20+
throw new WarningException("Manual deployment requires a pre-release tag.");
21+
}
2022

2123
return CalculateInternal(nextVersion);
2224
}

0 commit comments

Comments
 (0)