From 921d024039d0466f37ae194dc0d9c85619627956 Mon Sep 17 00:00:00 2001 From: Janek Suchocki Date: Mon, 17 Apr 2023 16:21:43 +0200 Subject: [PATCH] Rename back "tag-pre-release-weight" and "tag-prefix" --- BREAKING_CHANGES.md | 2 +- docs/input/docs/reference/configuration.md | 10 +++--- docs/input/docs/usage/cli/arguments.md | 14 ++++---- docs/input/docs/usage/cli/assembly-patch.md | 4 +-- schemas/6.0/GitVersion.configuration.json | 22 ++++++------ .../ArgumentParserTests.cs | 26 +++++++------- .../QuotedStringHelpersTests.cs | 24 ++++++------- ...riteOutEffectiveConfiguration.approved.txt | 4 +-- .../ConfigurationProviderTests.cs | 34 +++++++++---------- .../Core/GitVersionExecutorTests.cs | 2 +- .../Helpers/TestEffectiveConfiguration.cs | 4 +-- .../IntegrationTests/MainScenarios.cs | 6 ++-- .../IntegrationTests/VersionInTagScenarios.cs | 8 ++--- .../MergeMessageTests.cs | 2 +- .../SemanticVersionTests.cs | 8 ++--- .../VariableProviderTests.cs | 8 ++--- .../Configuration/ConfigurationBuilderBase.cs | 20 +++++------ .../Configuration/ConfigurationConstants.cs | 2 +- .../Configuration/EffectiveConfiguration.cs | 20 +++++------ .../GitFlowConfigurationBuilder.cs | 4 +-- .../GitHubFlowConfigurationBuilder.cs | 4 +-- .../Configuration/GitVersionConfiguration.cs | 10 +++--- .../Configuration/IGitVersionConfiguration.cs | 4 +-- .../SupportedWorkflows/GitFlow/v1.yml | 4 +-- .../SupportedWorkflows/GitHubFlow/v1.yml | 4 +-- .../Core/Abstractions/IRepositoryStore.cs | 6 ++-- .../Core/GitVersionContextFactory.cs | 2 +- src/GitVersion.Core/Core/RepositoryStore.cs | 20 +++++------ src/GitVersion.Core/Git/ReferenceName.cs | 4 +-- src/GitVersion.Core/MergeMessage.cs | 6 ++-- src/GitVersion.Core/PublicAPI.Unshipped.txt | 18 +++++----- .../ConfigNextVersionVersionStrategy.cs | 2 +- .../TaggedCommitVersionStrategy.cs | 2 +- .../VersionInBranchNameVersionStrategy.cs | 2 +- .../NonTrunkBasedVersionCalculatorBase.cs | 2 +- .../SemanticVersionFormatValues.cs | 2 +- .../Output/AssemblyInfoFileUpdaterTests.cs | 12 +++---- .../Output/ProjectFileUpdaterTests.cs | 8 ++--- 38 files changed, 168 insertions(+), 168 deletions(-) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index dd29e45ea8..70422b9f5f 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,5 +1,5 @@ ## Unreleased -* The configuration properties tag-* or *-tag were renamed to label-* or *-label (tag-pre-release-weight, tag-prefix, continuous-delivery-fallback-tag, tag-number-pattern, tag) +* The configuration properties `continuous-delivery-fallback-tag`, `tag-number-pattern`, and `tag` were renamed to `continuous-delivery-fallback-label`, `label-number-pattern`, and `label` respectively. `tag-pre-release-weight` and `tag-prefix` remained as they were as they are referring to a Git tag. * When using a commit message that matches **both** `*-version-bump-message` and `no-bump-message`, there is no increment for that commit. In other words, `no-bump-message` now takes precedence over `*-version-bump-message`. * The fallback version strategy now returns `0.0.0` and is flagged with `ShouldIncrement` equal to `true`. This yields the version `0.1.0` on the `develop` branch (`IncrementStrategy.Minor` by default) and `0.0.1` on the `main` branch (`IncremetnStrategy.Patch` by default). * The current branch (child) inherits its configuration from the source (parent) branch if the `increment` strategy is set to `Inherit`. This makes branch configuration recursive, simpler, more intuitive, more flexible, and more robust. diff --git a/docs/input/docs/reference/configuration.md b/docs/input/docs/reference/configuration.md index 296612439d..67aac71547 100644 --- a/docs/input/docs/reference/configuration.md +++ b/docs/input/docs/reference/configuration.md @@ -42,13 +42,13 @@ The global configuration looks like this: ```yaml assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch -label-prefix: '[vV]?' +tag-prefix: '[vV]?' version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' patch-version-bump-message: '\+semver:\s?(fix|patch)' no-bump-message: '\+semver:\s?(none|skip)' -label-pre-release-weight: 60000 +tag-pre-release-weight: 60000 commit-date-format: yyyy-MM-dd merge-message-formats: {} update-build-number: true @@ -268,9 +268,9 @@ for [increment](#increment), [prevent-increment-of-merged-branch-version](#prevent-increment-of-merged-branch-version) and [tracks-release-branches](#tracks-release-branches). -### label-prefix +### tag-prefix -A regular expression which is used to trim Git tags before processing (e.g., +A regular expression which is used to trim Git tags before processing (e.g., v1.0.0). The default value is `[vV]`. ### version-in-branch-pattern @@ -307,7 +307,7 @@ none` and `+semver: skip` When a commit matches **both** the `no-bump-message` **and** any combination of the `version-bump-message`, `no-bump-message` takes precedence and no increment is applied. -### label-pre-release-weight +### tag-pre-release-weight The pre-release weight in case of tagged commits. If the value is not set in the configuration, a default weight of 60000 is used instead. If the diff --git a/docs/input/docs/usage/cli/arguments.md b/docs/input/docs/usage/cli/arguments.md index d6e3c94a04..68497e8068 100644 --- a/docs/input/docs/usage/cli/arguments.md +++ b/docs/input/docs/usage/cli/arguments.md @@ -47,8 +47,8 @@ GitVersion [path] from GitVersion.yml or GitVersion.yaml) in yaml format /overrideconfig Overrides GitVersion config values inline (semicolon- separated key value pairs e.g. /overrideconfig - label-prefix=Foo) - Currently supported config overrides: label-prefix + tag-prefix=Foo) + Currently supported config overrides: tag-prefix /nocache Bypasses the cache, result will not be written to the cache. /nonormalize Disables normalize step on a build server. /verbosity Specifies the amount of information to be displayed. @@ -129,17 +129,17 @@ Following options are supported: 16. `next-version` 17. `no-bump-message` 18. `patch-version-bump-message` -19. `label-prefix` -20. `label-pre-release-weight` +19. `tag-prefix` +20. `tag-pre-release-weight` 21. `update-build-number` Read more about [Configuration](/docs/reference/configuration). Using `override-config` on the command line will not change the contents of the config file `GitVersion.yml` or `GitVersion.yaml`. -### Example: How to override configuration option 'label-prefix' to use prefix 'custom' +### Example: How to override configuration option 'tag-prefix' to use prefix 'custom' -`GitVersion.exe /output json /overrideconfig label-prefix=custom` +`GitVersion.exe /output json /overrideconfig tag-prefix=custom` ### Example: How to override configuration option 'assembly-versioning-format' @@ -155,7 +155,7 @@ Will use only major and minor version numbers for assembly version. Assembly bui ### Example: How to override multiple configuration options -`GitVersion.exe /output json /overrideconfig label-prefix=custom /overrideconfig assembly-versioning-scheme=MajorMinor` +`GitVersion.exe /output json /overrideconfig tag-prefix=custom /overrideconfig assembly-versioning-scheme=MajorMinor` ### Example: How to override configuration option 'update-build-number' diff --git a/docs/input/docs/usage/cli/assembly-patch.md b/docs/input/docs/usage/cli/assembly-patch.md index e3190e6d0a..704044e0fd 100644 --- a/docs/input/docs/usage/cli/assembly-patch.md +++ b/docs/input/docs/usage/cli/assembly-patch.md @@ -69,9 +69,9 @@ Will result in command line argument error Will iterate through each file and update known attributes (`AssemblyVersion`, `AssemblyFileVersion`, `AssemblyInformationalVersion`). -## Example: How to override configuration option 'label-prefix' to use prefix 'custom' +## Example: How to override configuration option 'tag-prefix' to use prefix 'custom' -`GitVersion.exe /output json /overrideconfig label-prefix=custom` +`GitVersion.exe /output json /overrideconfig tag-prefix=custom` ## Writing version metadata in WiX format diff --git a/schemas/6.0/GitVersion.configuration.json b/schemas/6.0/GitVersion.configuration.json index 3bcbfb44f5..85a8f8d99a 100644 --- a/schemas/6.0/GitVersion.configuration.json +++ b/schemas/6.0/GitVersion.configuration.json @@ -83,17 +83,6 @@ "label-number-pattern": { "$ref": "#/$defs/string1" }, - "label-prefix": { - "description": "A regular expression which is used to trim Git tags before processing. Defaults to [vV]?", - "type": "string" - }, - "label-pre-release-weight": { - "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", - "type": [ - "integer", - "null" - ] - }, "major-version-bump-message": { "format": "regex", "pattern": "\u0027\\\u002Bsemver:\\s?(breaking|major)\u0027", @@ -148,6 +137,17 @@ "source-branches": { "$ref": "#/$defs/array1" }, + "tag-prefix": { + "description": "A regular expression which is used to trim Git tags before processing. Defaults to [vV]?", + "type": "string" + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, "track-merge-message": { "$ref": "#/$defs/Nullable\u006015" }, diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index 656e8b33df..30ce1cb28b 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -384,9 +384,9 @@ public string OverrideconfigWithInvalidOption(string options) private static IEnumerable OverrideconfigWithInvalidOptionTestData() { - yield return new TestCaseData("label-prefix=sample=asdf") + yield return new TestCaseData("tag-prefix=sample=asdf") { - ExpectedResult = "Could not parse /overrideconfig option: label-prefix=sample=asdf. Ensure it is in format 'key=value'." + ExpectedResult = "Could not parse /overrideconfig option: tag-prefix=sample=asdf. Ensure it is in format 'key=value'." }; yield return new TestCaseData("unknown-option=25") { @@ -448,10 +448,10 @@ private static IEnumerable OverrideConfigWithSingleOptionTestData( } ); yield return new TestCaseData( - "label-prefix=sample", + "tag-prefix=sample", new GitVersionConfiguration { - LabelPrefix = "sample" + TagPrefix = "sample" } ); yield return new TestCaseData( @@ -497,10 +497,10 @@ private static IEnumerable OverrideConfigWithSingleOptionTestData( } ); yield return new TestCaseData( - "label-pre-release-weight=2", + "tag-pre-release-weight=2", new GitVersionConfiguration { - LabelPreReleaseWeight = 2 + TagPreReleaseWeight = 2 } ); yield return new TestCaseData( @@ -544,31 +544,31 @@ public void OverrideConfigWithMultipleOptions(string options, IGitVersionConfigu private static IEnumerable OverrideConfigWithMultipleOptionsTestData() { yield return new TestCaseData( - "/overrideconfig label-prefix=sample /overrideconfig assembly-versioning-scheme=MajorMinor", + "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-scheme=MajorMinor", new GitVersionConfiguration { - LabelPrefix = "sample", + TagPrefix = "sample", AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor } ); yield return new TestCaseData( - "/overrideconfig label-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", + "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", new GitVersionConfiguration { - LabelPrefix = "sample", + TagPrefix = "sample", AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}" } ); yield return new TestCaseData( - "/overrideconfig label-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\" /overrideconfig update-build-number=true /overrideconfig assembly-versioning-scheme=MajorMinorPatchTag /overrideconfig mode=ContinuousDelivery /overrideconfig label-pre-release-weight=4", + "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\" /overrideconfig update-build-number=true /overrideconfig assembly-versioning-scheme=MajorMinorPatchTag /overrideconfig mode=ContinuousDelivery /overrideconfig tag-pre-release-weight=4", new GitVersionConfiguration { - LabelPrefix = "sample", + TagPrefix = "sample", AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}", UpdateBuildNumber = true, AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, VersioningMode = VersioningMode.ContinuousDelivery, - LabelPreReleaseWeight = 4 + TagPreReleaseWeight = 4 } ); } diff --git a/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs b/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs index 07054ca600..e615754a2b 100644 --- a/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs +++ b/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs @@ -26,52 +26,52 @@ private static IEnumerable SplitUnquotedTestData() { ExpectedResult = new[] { "one", "\"two three" } }; - yield return new TestCaseData("/overrideconfig label-prefix=Sample", ' ') + yield return new TestCaseData("/overrideconfig tag-prefix=Sample", ' ') { ExpectedResult = new[] { "/overrideconfig", - "label-prefix=Sample" + "tag-prefix=Sample" } }; - yield return new TestCaseData("/overrideconfig label-prefix=Sample 2", ' ') + yield return new TestCaseData("/overrideconfig tag-prefix=Sample 2", ' ') { ExpectedResult = new[] { "/overrideconfig", - "label-prefix=Sample", + "tag-prefix=Sample", "2" } }; - yield return new TestCaseData("/overrideconfig label-prefix=\"Sample 2\"", ' ') + yield return new TestCaseData("/overrideconfig tag-prefix=\"Sample 2\"", ' ') { ExpectedResult = new[] { "/overrideconfig", - "label-prefix=\"Sample 2\"" + "tag-prefix=\"Sample 2\"" } }; - yield return new TestCaseData("/overrideconfig label-prefix=\"Sample \\\"quoted\\\"\"", ' ') + yield return new TestCaseData("/overrideconfig tag-prefix=\"Sample \\\"quoted\\\"\"", ' ') { ExpectedResult = new[] { "/overrideconfig", - "label-prefix=\"Sample \\\"quoted\\\"\"" + "tag-prefix=\"Sample \\\"quoted\\\"\"" } }; - yield return new TestCaseData("/overrideconfig label-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ' ') + yield return new TestCaseData("/overrideconfig tag-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ' ') { ExpectedResult = new[] { "/overrideconfig", - "label-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"" + "tag-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"" } }; - yield return new TestCaseData("label-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ';') + yield return new TestCaseData("tag-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ';') { ExpectedResult = new[] { - "label-prefix=sample", + "tag-prefix=sample", "assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"" } }; diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt index 4b4fe87762..b6527c90b1 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -1,12 +1,12 @@ assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch -label-prefix: '[vV]?' +tag-prefix: '[vV]?' version-in-branch-pattern: (?[vV]?\d+(\.\d+)?(\.\d+)?).* major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' patch-version-bump-message: '\+semver:\s?(fix|patch)' no-bump-message: '\+semver:\s?(none|skip)' -label-pre-release-weight: 60000 +tag-pre-release-weight: 60000 commit-date-format: yyyy-MM-dd merge-message-formats: {} update-build-number: true diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs index 22c7de9253..c976db4826 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs @@ -234,7 +234,7 @@ public void CanReadDefaultDocument() configuration.AssemblyInformationalFormat.ShouldBe(null); configuration.Branches["develop"].Label.ShouldBe("alpha"); configuration.Branches["release"].Label.ShouldBe("beta"); - configuration.LabelPrefix.ShouldBe(ConfigurationConstants.DefaultLabelPrefix); + configuration.TagPrefix.ShouldBe(ConfigurationConstants.DefaultTagPrefix); configuration.NextVersion.ShouldBe(null); } @@ -352,12 +352,12 @@ public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty() { const string text = @" next-version: 1.2.3 -label-prefix: custom-label-prefix-from-yml"; +tag-prefix: custom-tag-prefix-from-yml"; SetupConfigFileContent(text); var expectedConfig = GitFlowConfigurationBuilder.New .WithNextVersion("1.2.3") - .WithLabelPrefix("custom-label-prefix-from-yml") + .WithTagPrefix("custom-tag-prefix-from-yml") .Build(); var overridenConfig = this.configurationProvider.ProvideForDirectory(this.repoPath); @@ -366,13 +366,13 @@ public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty() overridenConfig.AssemblyInformationalFormat.ShouldBe(expectedConfig.AssemblyInformationalFormat); overridenConfig.AssemblyVersioningFormat.ShouldBe(expectedConfig.AssemblyVersioningFormat); overridenConfig.AssemblyFileVersioningFormat.ShouldBe(expectedConfig.AssemblyFileVersioningFormat); - overridenConfig.LabelPrefix.ShouldBe(expectedConfig.LabelPrefix); + overridenConfig.TagPrefix.ShouldBe(expectedConfig.TagPrefix); overridenConfig.NextVersion.ShouldBe(expectedConfig.NextVersion); overridenConfig.MajorVersionBumpMessage.ShouldBe(expectedConfig.MajorVersionBumpMessage); overridenConfig.MinorVersionBumpMessage.ShouldBe(expectedConfig.MinorVersionBumpMessage); overridenConfig.PatchVersionBumpMessage.ShouldBe(expectedConfig.PatchVersionBumpMessage); overridenConfig.NoBumpMessage.ShouldBe(expectedConfig.NoBumpMessage); - overridenConfig.LabelPreReleaseWeight.ShouldBe(expectedConfig.LabelPreReleaseWeight); + overridenConfig.TagPreReleaseWeight.ShouldBe(expectedConfig.TagPreReleaseWeight); overridenConfig.CommitDateFormat.ShouldBe(expectedConfig.CommitDateFormat); overridenConfig.MergeMessageFormats.ShouldBe(expectedConfig.MergeMessageFormats); overridenConfig.UpdateBuildNumber.ShouldBe(expectedConfig.UpdateBuildNumber); @@ -394,31 +394,31 @@ public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile() SetupConfigFileContent(text); var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); - configuration.LabelPrefix.ShouldBe(ConfigurationConstants.DefaultLabelPrefix); + configuration.TagPrefix.ShouldBe(ConfigurationConstants.DefaultTagPrefix); } [Test] public void ShouldUseTagPrefixFromConfigFileWhenProvided() { - const string text = "label-prefix: custom-label-prefix-from-yml"; + const string text = "tag-prefix: custom-tag-prefix-from-yml"; SetupConfigFileContent(text); var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath); - configuration.LabelPrefix.ShouldBe("custom-label-prefix-from-yml"); + configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-yml"); } [Test] public void ShouldOverrideTagPrefixWithOverrideConfigValue([Values] bool tagPrefixSetAtYmlFile) { - var text = tagPrefixSetAtYmlFile ? "label-prefix: custom-label-prefix-from-yml" : ""; + var text = tagPrefixSetAtYmlFile ? "tag-prefix: custom-tag-prefix-from-yml" : ""; SetupConfigFileContent(text); var overrideConfiguration = new Dictionary() { - { "label-prefix", "label-prefix-from-override-configuration" } + { "tag-prefix", "tag-prefix-from-override-configuration" } }; var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); - configuration.LabelPrefix.ShouldBe("label-prefix-from-override-configuration"); + configuration.TagPrefix.ShouldBe("tag-prefix-from-override-configuration"); } [Test] @@ -433,13 +433,13 @@ public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig() var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); - configuration.LabelPrefix.ShouldBe(ConfigurationConstants.DefaultLabelPrefix); + configuration.TagPrefix.ShouldBe(ConfigurationConstants.DefaultTagPrefix); } [Test] public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig() { - const string text = "label-prefix: custom-label-prefix-from-yml"; + const string text = "tag-prefix: custom-tag-prefix-from-yml"; SetupConfigFileContent(text); var overrideConfiguration = new Dictionary() { @@ -447,20 +447,20 @@ public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig() }; var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); - configuration.LabelPrefix.ShouldBe("custom-label-prefix-from-yml"); + configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-yml"); } [Test] public void ShouldOverrideTagPrefixFromConfigFileWhenSetInOverrideConfig() { - const string text = "label-prefix: custom-label-prefix-from-yml"; + const string text = "tag-prefix: custom-tag-prefix-from-yml"; SetupConfigFileContent(text); var overrideConfiguration = new Dictionary() { - { "label-prefix", "custom-label-prefix-from-console" } + { "tag-prefix", "custom-tag-prefix-from-console" } }; var configuration = this.configurationProvider.ProvideForDirectory(this.repoPath, overrideConfiguration); - configuration.LabelPrefix.ShouldBe("custom-label-prefix-from-console"); + configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-console"); } } diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index bfb8cad0ba..653cf88ca6 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -195,7 +195,7 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn var cacheDirectoryTimestamp = this.fileSystem.GetLastDirectoryWrite(cacheDirectory); - var configuration = GitFlowConfigurationBuilder.New.WithLabelPrefix("prefix").Build(); + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefix("prefix").Build(); var overrideConfiguration = new ConfigurationHelper(configuration).Dictionary; gitVersionOptions = new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, ConfigurationInfo = { OverrideConfiguration = overrideConfiguration } }; diff --git a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs index efb2ebe568..8044845739 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs @@ -13,7 +13,7 @@ public TestEffectiveConfiguration( string? assemblyFileVersioningFormat = null, string? assemblyInformationalFormat = null, VersioningMode versioningMode = VersioningMode.ContinuousDelivery, - string labelPrefix = ConfigurationConstants.DefaultLabelPrefix, + string tagPrefix = ConfigurationConstants.DefaultTagPrefix, string label = "ci", string? nextVersion = null, string branchPrefixToTrim = "", @@ -37,7 +37,7 @@ public TestEffectiveConfiguration( assemblyVersioningFormat, assemblyFileVersioningFormat, versioningMode, - labelPrefix, + tagPrefix, label, nextVersion, IncrementStrategy.Patch, diff --git a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs index 38d3ebe169..ef558645af 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs @@ -194,14 +194,14 @@ public void CanSpecifyTagPrefixes() fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - var configuration = GitFlowConfigurationBuilder.New.WithLabelPrefix("version-").Build(); + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefix("version-").Build(); fixture.AssertFullSemver("1.0.4-5", configuration); } [Test] public void CanSpecifyTagPrefixesAsRegex() { - var configuration = GitFlowConfigurationBuilder.New.WithLabelPrefix($"version-|{ConfigurationConstants.DefaultLabelPrefix}").Build(); + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefix($"version-|{ConfigurationConstants.DefaultTagPrefix}").Build(); using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "v1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); @@ -219,7 +219,7 @@ public void CanSpecifyTagPrefixesAsRegex() [Test] public void AreTagsNotAdheringToTagPrefixIgnored() { - var configuration = GitFlowConfigurationBuilder.New.WithLabelPrefix("").Build(); + var configuration = GitFlowConfigurationBuilder.New.WithTagPrefix("").Build(); using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "version-1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs index 09dd5e13ba..616bf506c1 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs @@ -24,12 +24,12 @@ public void TagPreReleaseWeightIsNotConfigured_HeadIsATaggedCommit_WeightedPreRe } [Test] - public void LabelPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreReleaseNumberShouldBeTheSameAsTheLabelPreReleaseWeight() + public void TagPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreReleaseNumberShouldBeTheSameAsTheTagPreReleaseWeight() { // Arrange var configuration = GitFlowConfigurationBuilder.New .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") - .WithLabelPreReleaseWeight(65535) + .WithTagPreReleaseWeight(65535) .Build(); // Act @@ -42,12 +42,12 @@ public void LabelPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreRel } [Test] - public void LabelPreReleaseWeightIsConfigured_GitFlowReleaseIsFinished_WeightedPreReleaseNumberShouldBeTheSameAsTheLabelPreReleaseWeight() + public void TagPreReleaseWeightIsConfigured_GitFlowReleaseIsFinished_WeightedPreReleaseNumberShouldBeTheSameAsTheTagPreReleaseWeight() { // Arrange var configuration = GitFlowConfigurationBuilder.New .WithAssemblyFileVersioningFormat("{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}") - .WithLabelPreReleaseWeight(65535) + .WithTagPreReleaseWeight(65535) .Build(); // Act diff --git a/src/GitVersion.Core.Tests/MergeMessageTests.cs b/src/GitVersion.Core.Tests/MergeMessageTests.cs index 0e93c7f16d..8f5d73f66e 100644 --- a/src/GitVersion.Core.Tests/MergeMessageTests.cs +++ b/src/GitVersion.Core.Tests/MergeMessageTests.cs @@ -35,7 +35,7 @@ public void EmptyTagPrefix(string prefix) { // Arrange const string message = "Updated some code."; - var conf = new GitVersionConfiguration { LabelPrefix = prefix }; + var conf = new GitVersionConfiguration { TagPrefix = prefix }; // Act var sut = new MergeMessage(message, conf); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs index a0cdef1d3d..a8ff2909cb 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs @@ -23,9 +23,9 @@ public class SemanticVersionTests : TestBase [TestCase("1.2.3+4.Branch.Foo", 1, 2, 3, "", null, 4, "Foo", null, null, null, null, SemanticVersionFormat.Strict)] [TestCase("1.2.3+randomMetaData", 1, 2, 3, "", null, null, null, null, "randomMetaData", null, null, SemanticVersionFormat.Strict)] [TestCase("1.2.3-beta.1+4.Sha.12234.Othershiz", 1, 2, 3, "beta", 1, 4, null, "12234", "Othershiz", null, null, SemanticVersionFormat.Strict)] - [TestCase("1.2.3", 1, 2, 3, "", null, null, null, null, null, null, ConfigurationConstants.DefaultLabelPrefix, SemanticVersionFormat.Strict)] - [TestCase("v1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", ConfigurationConstants.DefaultLabelPrefix, SemanticVersionFormat.Strict)] - [TestCase("V1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", ConfigurationConstants.DefaultLabelPrefix, SemanticVersionFormat.Strict)] + [TestCase("1.2.3", 1, 2, 3, "", null, null, null, null, null, null, ConfigurationConstants.DefaultTagPrefix, SemanticVersionFormat.Strict)] + [TestCase("v1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", ConfigurationConstants.DefaultTagPrefix, SemanticVersionFormat.Strict)] + [TestCase("V1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", ConfigurationConstants.DefaultTagPrefix, SemanticVersionFormat.Strict)] [TestCase("version-1.2.3", 1, 2, 3, "", null, null, null, null, null, "1.2.3", "version-", SemanticVersionFormat.Strict)] [TestCase("1.0.0-develop-20201007113711", 1, 0, 0, "develop-20201007113711", null, null, null, null, null, "1.0.0-develop-20201007113711", null, SemanticVersionFormat.Strict)] [TestCase("20201007113711.658165168461351.64136516984163213-develop-20201007113711.98848747823+65416321321", 20201007113711, 658165168461351, 64136516984163213, "develop-20201007113711", 98848747823, 65416321321, null, null, null, "20201007113711.658165168461351.64136516984163213-develop-20201007113711.98848747823+65416321321", null, SemanticVersionFormat.Strict)] @@ -63,7 +63,7 @@ public void ValidateVersionParsing( [TestCase("someText")] [TestCase("some-T-ext")] - [TestCase("v.1.2.3", ConfigurationConstants.DefaultLabelPrefix)] + [TestCase("v.1.2.3", ConfigurationConstants.DefaultTagPrefix)] public void ValidateInvalidVersionParsing(string versionString, string? tagPrefixRegex = null) => Assert.That(SemanticVersion.TryParse(versionString, tagPrefixRegex, out _), Is.False, "TryParse Result"); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs index db282ca23d..325bf51de3 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs @@ -97,7 +97,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable() } }; - var configuration = GitFlowConfigurationBuilder.New.WithLabelPreReleaseWeight(0).Build() + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0).Build() .GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")); var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, null); @@ -149,7 +149,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommi } }; - var configuration = GitFlowConfigurationBuilder.New.WithLabelPreReleaseWeight(0).Build() + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0).Build() .GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")); var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, SemanticVersion.Empty); @@ -224,7 +224,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch() } }; - var configuration = GitFlowConfigurationBuilder.New.WithLabelPreReleaseWeight(0).Build() + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0).Build() .GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")); var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, null); @@ -249,7 +249,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomA } }; - var configuration = GitFlowConfigurationBuilder.New.WithLabelPreReleaseWeight(0) + var configuration = GitFlowConfigurationBuilder.New.WithTagPreReleaseWeight(0) .WithAssemblyInformationalFormat("{Major}.{Minor}.{Patch}+{CommitsSinceVersionSource}.Branch.{BranchName}.Sha.{ShortSha}") .Build().GetEffectiveConfiguration(ReferenceName.FromBranchName("develop")); var variables = this.variableProvider.GetVariablesFor(semanticVersion, configuration, null); diff --git a/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs b/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs index 994c8bf080..085fc5aa30 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs @@ -11,14 +11,14 @@ internal abstract class ConfigurationBuilderBase : IConfi private string? assemblyInformationalFormat; private string? assemblyVersioningFormat; private string? assemblyFileVersioningFormat; - private string? labelPrefix; + private string? tagPrefix; private string? versionInBranchPattern; private string? nextVersion; private string? majorVersionBumpMessage; private string? minorVersionBumpMessage; private string? patchVersionBumpMessage; private string? noBumpMessage; - private int? labelPreReleaseWeight; + private int? tagPreReleaseWeight; private IgnoreConfiguration ignore; private string? commitDateFormat; private bool updateBuildNumber; @@ -126,9 +126,9 @@ public virtual TConfigurationBuilder WithAssemblyFileVersioningFormat(string? va return (TConfigurationBuilder)this; } - public virtual TConfigurationBuilder WithLabelPrefix(string? value) + public virtual TConfigurationBuilder WithTagPrefix(string? value) { - this.labelPrefix = value; + this.tagPrefix = value; return (TConfigurationBuilder)this; } @@ -168,9 +168,9 @@ public virtual TConfigurationBuilder WithNoBumpMessage(string? value) return (TConfigurationBuilder)this; } - public virtual TConfigurationBuilder WithLabelPreReleaseWeight(int? value) + public virtual TConfigurationBuilder WithTagPreReleaseWeight(int? value) { - this.labelPreReleaseWeight = value; + this.tagPreReleaseWeight = value; return (TConfigurationBuilder)this; } @@ -308,14 +308,14 @@ public virtual TConfigurationBuilder WithConfiguration(IGitVersionConfiguration WithAssemblyInformationalFormat(value.AssemblyInformationalFormat); WithAssemblyVersioningFormat(value.AssemblyVersioningFormat); WithAssemblyFileVersioningFormat(value.AssemblyFileVersioningFormat); - WithLabelPrefix(value.LabelPrefix); + WithTagPrefix(value.TagPrefix); WithVersionInBranchPattern(value.VersionInBranchPattern); WithNextVersion(value.NextVersion); WithMajorVersionBumpMessage(value.MajorVersionBumpMessage); WithMinorVersionBumpMessage(value.MinorVersionBumpMessage); WithPatchVersionBumpMessage(value.PatchVersionBumpMessage); WithNoBumpMessage(value.NoBumpMessage); - WithLabelPreReleaseWeight(value.LabelPreReleaseWeight); + WithTagPreReleaseWeight(value.TagPreReleaseWeight); WithIgnoreConfiguration(value.Ignore); WithCommitDateFormat(value.CommitDateFormat); WithUpdateBuildNumber(value.UpdateBuildNumber); @@ -364,14 +364,14 @@ public virtual IGitVersionConfiguration Build() AssemblyInformationalFormat = this.assemblyInformationalFormat, AssemblyVersioningFormat = this.assemblyVersioningFormat, AssemblyFileVersioningFormat = this.assemblyFileVersioningFormat, - LabelPrefix = this.labelPrefix, + TagPrefix = this.tagPrefix, VersionInBranchPattern = this.versionInBranchPattern, NextVersion = this.nextVersion, MajorVersionBumpMessage = this.majorVersionBumpMessage, MinorVersionBumpMessage = this.minorVersionBumpMessage, PatchVersionBumpMessage = this.patchVersionBumpMessage, NoBumpMessage = this.noBumpMessage, - LabelPreReleaseWeight = this.labelPreReleaseWeight, + TagPreReleaseWeight = this.tagPreReleaseWeight, Ignore = this.ignore, CommitDateFormat = this.commitDateFormat, UpdateBuildNumber = this.updateBuildNumber, diff --git a/src/GitVersion.Core/Configuration/ConfigurationConstants.cs b/src/GitVersion.Core/Configuration/ConfigurationConstants.cs index 7e862ab4e7..63b505534d 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationConstants.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationConstants.cs @@ -2,7 +2,7 @@ namespace GitVersion.Configuration; internal static class ConfigurationConstants { - public const string DefaultLabelPrefix = "[vV]?"; + public const string DefaultTagPrefix = "[vV]?"; public const string DefaultVersionInBranchPattern = @"(?[vV]?\d+(\.\d+)?(\.\d+)?).*"; public const string BranchNamePlaceholder = "{BranchName}"; diff --git a/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs b/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs index eef699cb3e..1b43340e22 100644 --- a/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs +++ b/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs @@ -30,8 +30,8 @@ public EffectiveConfiguration(IGitVersionConfiguration configuration, IBranchCon if (!branchConfiguration.CommitMessageIncrementing.HasValue) throw new Exception("Configuration value for 'CommitMessageIncrementing' has no value. (this should not happen, please report an issue)"); - if (!configuration.LabelPreReleaseWeight.HasValue) - throw new Exception("Configuration value for 'LabelPreReleaseWeight' has no value. (this should not happen, please report an issue)"); + if (!configuration.TagPreReleaseWeight.HasValue) + throw new Exception("Configuration value for 'TagPreReleaseWeight' has no value. (this should not happen, please report an issue)"); AssemblyVersioningScheme = configuration.AssemblyVersioningScheme.Value; AssemblyFileVersioningScheme = configuration.AssemblyFileVersioningScheme.Value; @@ -39,7 +39,7 @@ public EffectiveConfiguration(IGitVersionConfiguration configuration, IBranchCon AssemblyVersioningFormat = configuration.AssemblyVersioningFormat; AssemblyFileVersioningFormat = configuration.AssemblyFileVersioningFormat; VersioningMode = branchConfiguration.VersioningMode.Value; - LabelPrefix = configuration.LabelPrefix; + TagPrefix = configuration.TagPrefix; VersionInBranchRegex = configuration.VersionInBranchRegex; Label = branchConfiguration.Label; NextVersion = configuration.NextVersion; @@ -62,7 +62,7 @@ public EffectiveConfiguration(IGitVersionConfiguration configuration, IBranchCon UpdateBuildNumber = configuration.UpdateBuildNumber; SemanticVersionFormat = configuration.SemanticVersionFormat; PreReleaseWeight = branchConfiguration.PreReleaseWeight ?? 0; - LabelPreReleaseWeight = configuration.LabelPreReleaseWeight.Value; + TagPreReleaseWeight = configuration.TagPreReleaseWeight.Value; } protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningScheme, @@ -71,7 +71,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche string? assemblyVersioningFormat, string? assemblyFileVersioningFormat, VersioningMode versioningMode, - string? labelPrefix, + string? tagPrefix, string label, string? nextVersion, IncrementStrategy increment, @@ -92,7 +92,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche bool updateBuildNumber, SemanticVersionFormat semanticVersionFormat, int preReleaseWeight, - int labelPreReleaseWeight) + int tagPreReleaseWeight) { AssemblyVersioningScheme = assemblyVersioningScheme; AssemblyFileVersioningScheme = assemblyFileVersioningScheme; @@ -100,7 +100,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche AssemblyVersioningFormat = assemblyVersioningFormat; AssemblyFileVersioningFormat = assemblyFileVersioningFormat; VersioningMode = versioningMode; - LabelPrefix = labelPrefix; + TagPrefix = tagPrefix; Label = label; NextVersion = nextVersion; Increment = increment; @@ -121,7 +121,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche UpdateBuildNumber = updateBuildNumber; SemanticVersionFormat = semanticVersionFormat; PreReleaseWeight = preReleaseWeight; - LabelPreReleaseWeight = labelPreReleaseWeight; + TagPreReleaseWeight = tagPreReleaseWeight; } public bool TracksReleaseBranches { get; } @@ -137,7 +137,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche /// /// Git tag prefix /// - public string? LabelPrefix { get; } + public string? TagPrefix { get; } public Regex VersionInBranchRegex { get; } @@ -180,5 +180,5 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche public int PreReleaseWeight { get; } - public int LabelPreReleaseWeight { get; } + public int TagPreReleaseWeight { get; } } diff --git a/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs index 620f79c14d..732b0053d0 100644 --- a/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs @@ -19,9 +19,9 @@ private GitFlowConfigurationBuilder() NoBumpMessage = IncrementStrategyFinder.DefaultNoBumpPattern, PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern, SemanticVersionFormat = SemanticVersionFormat.Strict, - LabelPrefix = ConfigurationConstants.DefaultLabelPrefix, + TagPrefix = ConfigurationConstants.DefaultTagPrefix, VersionInBranchPattern = ConfigurationConstants.DefaultVersionInBranchPattern, - LabelPreReleaseWeight = 60000, + TagPreReleaseWeight = 60000, UpdateBuildNumber = true, VersioningMode = VersioningMode.ContinuousDeployment, RegularExpression = string.Empty, diff --git a/src/GitVersion.Core/Configuration/GitHubFlowConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/GitHubFlowConfigurationBuilder.cs index 65c426f350..b27b95a1f9 100644 --- a/src/GitVersion.Core/Configuration/GitHubFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core/Configuration/GitHubFlowConfigurationBuilder.cs @@ -19,9 +19,9 @@ private GitHubFlowConfigurationBuilder() NoBumpMessage = IncrementStrategyFinder.DefaultNoBumpPattern, PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern, SemanticVersionFormat = SemanticVersionFormat.Strict, - LabelPrefix = ConfigurationConstants.DefaultLabelPrefix, + TagPrefix = ConfigurationConstants.DefaultTagPrefix, VersionInBranchPattern = ConfigurationConstants.DefaultVersionInBranchPattern, - LabelPreReleaseWeight = 60000, + TagPreReleaseWeight = 60000, UpdateBuildNumber = true, VersioningMode = VersioningMode.ContinuousDeployment, RegularExpression = string.Empty, diff --git a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs index 7a858076f8..3d27c0decc 100644 --- a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs +++ b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs @@ -31,9 +31,9 @@ internal sealed record GitVersionConfiguration : BranchConfiguration, IGitVersio [JsonPropertyDescription("Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.")] public string? AssemblyFileVersioningFormat { get; internal set; } - [JsonPropertyName("label-prefix")] - [JsonPropertyDescription($"A regular expression which is used to trim Git tags before processing. Defaults to {ConfigurationConstants.DefaultLabelPrefix}")] - public string? LabelPrefix { get; internal set; } + [JsonPropertyName("tag-prefix")] + [JsonPropertyDescription($"A regular expression which is used to trim Git tags before processing. Defaults to {ConfigurationConstants.DefaultTagPrefix}")] + public string? TagPrefix { get; internal set; } [JsonPropertyName("version-in-branch-pattern")] [JsonPropertyDescription($"A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). The default value is '{ConfigurationConstants.DefaultVersionInBranchPattern}'.")] @@ -82,9 +82,9 @@ public string? NextVersion [JsonPropertyPattern(@"'\+semver:\s?(none|skip)'")] public string? NoBumpMessage { get; internal set; } - [JsonPropertyName("label-pre-release-weight")] + [JsonPropertyName("tag-pre-release-weight")] [JsonPropertyDescription("The pre-release weight in case of tagged commits. Defaults to 60000.")] - public int? LabelPreReleaseWeight { get; internal set; } + public int? TagPreReleaseWeight { get; internal set; } [JsonPropertyName("commit-date-format")] [JsonPropertyDescription("The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'.")] diff --git a/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs b/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs index 5d22600642..37d7bf8ce9 100644 --- a/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs +++ b/src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs @@ -17,7 +17,7 @@ public interface IGitVersionConfiguration : IBranchConfiguration string? AssemblyFileVersioningFormat { get; } - string? LabelPrefix { get; } + string? TagPrefix { get; } string? VersionInBranchPattern { get; } @@ -33,7 +33,7 @@ public interface IGitVersionConfiguration : IBranchConfiguration string? NoBumpMessage { get; } - int? LabelPreReleaseWeight { get; } + int? TagPreReleaseWeight { get; } string? CommitDateFormat { get; } diff --git a/src/GitVersion.Core/Configuration/SupportedWorkflows/GitFlow/v1.yml b/src/GitVersion.Core/Configuration/SupportedWorkflows/GitFlow/v1.yml index 31e89185aa..4d417a05d6 100644 --- a/src/GitVersion.Core/Configuration/SupportedWorkflows/GitFlow/v1.yml +++ b/src/GitVersion.Core/Configuration/SupportedWorkflows/GitFlow/v1.yml @@ -1,11 +1,11 @@ assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch -label-prefix: '[vV]?' +tag-prefix: '[vV]?' major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' patch-version-bump-message: '\+semver:\s?(fix|patch)' no-bump-message: '\+semver:\s?(none|skip)' -label-pre-release-weight: 60000 +tag-pre-release-weight: 60000 commit-date-format: yyyy-MM-dd merge-message-formats: {} update-build-number: true diff --git a/src/GitVersion.Core/Configuration/SupportedWorkflows/GitHubFlow/v1.yml b/src/GitVersion.Core/Configuration/SupportedWorkflows/GitHubFlow/v1.yml index 4fe9f3a9e4..f5c7e83848 100644 --- a/src/GitVersion.Core/Configuration/SupportedWorkflows/GitHubFlow/v1.yml +++ b/src/GitVersion.Core/Configuration/SupportedWorkflows/GitHubFlow/v1.yml @@ -1,11 +1,11 @@ assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch -label-prefix: '[vV]?' +tag-prefix: '[vV]?' major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' patch-version-bump-message: '\+semver:\s?(fix|patch)' no-bump-message: '\+semver:\s?(none|skip)' -label-pre-release-weight: 60000 +tag-pre-release-weight: 60000 commit-date-format: yyyy-MM-dd merge-message-formats: {} update-build-number: true diff --git a/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs b/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs index 480bd3d2c1..65397c4a08 100644 --- a/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs +++ b/src/GitVersion.Core/Core/Abstractions/IRepositoryStore.cs @@ -41,11 +41,11 @@ public interface IRepositoryStore SemanticVersion? GetCurrentCommitTaggedVersion(ICommit? commit, string? tagPrefix, SemanticVersionFormat format, bool handleDetachedBranch); - IEnumerable GetVersionTagsOnBranch(IBranch branch, string? labelPrefix, SemanticVersionFormat format); + IEnumerable GetVersionTagsOnBranch(IBranch branch, string? tagPrefix, SemanticVersionFormat format); - IReadOnlyList GetTaggedSemanticVersions(string? labelPrefix, SemanticVersionFormat format); + IReadOnlyList GetTaggedSemanticVersions(string? tagPrefix, SemanticVersionFormat format); - IReadOnlyList GetTaggedSemanticVersionsOnBranch(IBranch branch, string? labelPrefix, SemanticVersionFormat format); + IReadOnlyList GetTaggedSemanticVersionsOnBranch(IBranch branch, string? tagPrefix, SemanticVersionFormat format); bool IsCommitOnBranch(ICommit? baseVersionSource, IBranch branch, ICommit firstMatchingCommit); diff --git a/src/GitVersion.Core/Core/GitVersionContextFactory.cs b/src/GitVersion.Core/Core/GitVersionContextFactory.cs index 7048214846..42c61c704d 100644 --- a/src/GitVersion.Core/Core/GitVersionContextFactory.cs +++ b/src/GitVersion.Core/Core/GitVersionContextFactory.cs @@ -31,7 +31,7 @@ public GitVersionContext Create(GitVersionOptions gitVersionOptions) currentBranch = branchForCommit ?? currentBranch; } - var currentCommitTaggedVersion = this.repositoryStore.GetCurrentCommitTaggedVersion(currentCommit, configuration.LabelPrefix, configuration.SemanticVersionFormat, handleDetachedBranch: currentBranch.IsDetachedHead); + var currentCommitTaggedVersion = this.repositoryStore.GetCurrentCommitTaggedVersion(currentCommit, configuration.TagPrefix, configuration.SemanticVersionFormat, handleDetachedBranch: currentBranch.IsDetachedHead); var numberOfUncommittedChanges = this.repositoryStore.GetNumberOfUncommittedChanges(); return new GitVersionContext(currentBranch, currentCommit, configuration, currentCommitTaggedVersion, numberOfUncommittedChanges); diff --git a/src/GitVersion.Core/Core/RepositoryStore.cs b/src/GitVersion.Core/Core/RepositoryStore.cs index e958147d78..a859a80764 100644 --- a/src/GitVersion.Core/Core/RepositoryStore.cs +++ b/src/GitVersion.Core/Core/RepositoryStore.cs @@ -252,7 +252,7 @@ public IEnumerable FindCommitBranchesWasBranchedFrom(IBranch branc .SelectMany(tag => GetCurrentCommitSemanticVersions(commit, tagPrefix, tag, format, handleDetachedBranch)) .Max(); - public IEnumerable GetVersionTagsOnBranch(IBranch branch, string? labelPrefix, SemanticVersionFormat format) + public IEnumerable GetVersionTagsOnBranch(IBranch branch, string? tagPrefix, SemanticVersionFormat format) { branch = branch.NotNull(); @@ -264,7 +264,7 @@ public IEnumerable GetVersionTagsOnBranch(IBranch branch, strin using (this.log.IndentLog($"Getting version tags from branch '{branch.Name.Canonical}'.")) { - var semanticVersions = GetTaggedSemanticVersions(labelPrefix, format); + var semanticVersions = GetTaggedSemanticVersions(tagPrefix, format); var tagsBySha = semanticVersions.Where(t => t.Tag.TargetSha != null).ToLookup(t => t.Tag.TargetSha, t => t); var versionTags = (branch.Commits?.SelectMany(c => tagsBySha[c.Sha].Select(t => t)) @@ -275,15 +275,15 @@ public IEnumerable GetVersionTagsOnBranch(IBranch branch, strin } } - public IReadOnlyList GetTaggedSemanticVersions(string? labelPrefix, SemanticVersionFormat format) + public IReadOnlyList GetTaggedSemanticVersions(string? tagPrefix, SemanticVersionFormat format) { if (this.taggedSemanticVersionsCache != null) { - this.log.Debug($"Returning cached tagged semantic versions. LabelPrefix: {labelPrefix} and Format: {format}"); + this.log.Debug($"Returning cached tagged semantic versions. TagPrefix: {tagPrefix} and Format: {format}"); return this.taggedSemanticVersionsCache; } - using (this.log.IndentLog($"Getting tagged semantic versions. LabelPrefix: {labelPrefix} and Format: {format}")) + using (this.log.IndentLog($"Getting tagged semantic versions. TagPrefix: {tagPrefix} and Format: {format}")) { this.taggedSemanticVersionsCache = GetTaggedSemanticVersionsInternal().ToList(); return this.taggedSemanticVersionsCache; @@ -293,7 +293,7 @@ IEnumerable GetTaggedSemanticVersionsInternal() { foreach (var tag in this.repository.Tags) { - if (SemanticVersion.TryParse(tag.Name.Friendly, labelPrefix, out var semanticVersion, format)) + if (SemanticVersion.TryParse(tag.Name.Friendly, tagPrefix, out var semanticVersion, format)) { yield return new SemanticVersionWithTag(semanticVersion, tag); } @@ -302,19 +302,19 @@ IEnumerable GetTaggedSemanticVersionsInternal() } public IReadOnlyList GetTaggedSemanticVersionsOnBranch( - IBranch branch, string? labelPrefix, SemanticVersionFormat format) + IBranch branch, string? tagPrefix, SemanticVersionFormat format) { branch = branch.NotNull(); if (this.taggedSemanticVersionsOnBranchCache.TryGetValue(branch, out var onBranch)) { - this.log.Debug($"Returning cached tagged semantic versions from '{branch.Name.Canonical}'. LabelPrefix: {labelPrefix} and Format: {format}"); + this.log.Debug($"Returning cached tagged semantic versions from '{branch.Name.Canonical}'. TagPrefix: {tagPrefix} and Format: {format}"); return onBranch; } - using (this.log.IndentLog($"Getting tagged semantic versions from '{branch.Name.Canonical}'. LabelPrefix: {labelPrefix} and Format: {format}")) + using (this.log.IndentLog($"Getting tagged semantic versions from '{branch.Name.Canonical}'. TagPrefix: {tagPrefix} and Format: {format}")) { - var semanticVersions = GetTaggedSemanticVersions(labelPrefix, format); + var semanticVersions = GetTaggedSemanticVersions(tagPrefix, format); var tagsBySha = semanticVersions.Where(t => t.Tag.TargetSha != null).ToLookup(t => t.Tag.TargetSha, t => t); var versionTags = (branch.Commits?.SelectMany(c => tagsBySha[c.Sha].Select(t => t)) diff --git a/src/GitVersion.Core/Git/ReferenceName.cs b/src/GitVersion.Core/Git/ReferenceName.cs index 960df6de18..7db8b78a00 100644 --- a/src/GitVersion.Core/Git/ReferenceName.cs +++ b/src/GitVersion.Core/Git/ReferenceName.cs @@ -80,7 +80,7 @@ public static ReferenceName FromBranchName(string branchName) public bool TryGetSemanticVersion([NotNullWhen(true)] out (SemanticVersion Value, string? Name) result, Regex versionPatternRegex, - string? labelPrefix, + string? tagPrefix, SemanticVersionFormat format) { result = default; @@ -96,7 +96,7 @@ public bool TryGetSemanticVersion([NotNullWhen(true)] out (SemanticVersion Value if (match.Success) { var versionPart = match.Groups["version"].Value; - if (SemanticVersion.TryParse(versionPart, labelPrefix, out var semanticVersion, format)) + if (SemanticVersion.TryParse(versionPart, tagPrefix, out var semanticVersion, format)) { length += versionPart.Length; var name = WithoutOrigin[length..].Trim('-'); diff --git a/src/GitVersion.Core/MergeMessage.cs b/src/GitVersion.Core/MergeMessage.cs index 133bac3194..da61df9131 100644 --- a/src/GitVersion.Core/MergeMessage.cs +++ b/src/GitVersion.Core/MergeMessage.cs @@ -49,7 +49,7 @@ public MergeMessage(string mergeMessage, IGitVersionConfiguration configuration) } Version = ParseVersion( - configuration.VersionInBranchRegex, configuration.LabelPrefix, configuration.SemanticVersionFormat + configuration.VersionInBranchRegex, configuration.TagPrefix, configuration.SemanticVersionFormat ); break; @@ -64,9 +64,9 @@ public MergeMessage(string mergeMessage, IGitVersionConfiguration configuration) public int? PullRequestNumber { get; } public SemanticVersion? Version { get; } - private SemanticVersion? ParseVersion(Regex versionInBranchRegex, string? labelPrefix, SemanticVersionFormat format) + private SemanticVersion? ParseVersion(Regex versionInBranchRegex, string? tagPrefix, SemanticVersionFormat format) { - if (MergedBranch?.TryGetSemanticVersion(out var result, versionInBranchRegex, labelPrefix, format) == true) + if (MergedBranch?.TryGetSemanticVersion(out var result, versionInBranchRegex, tagPrefix, format) == true) return result.Value; return null; } diff --git a/src/GitVersion.Core/PublicAPI.Unshipped.txt b/src/GitVersion.Core/PublicAPI.Unshipped.txt index 62f0097a29..7c0d531d89 100644 --- a/src/GitVersion.Core/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Core/PublicAPI.Unshipped.txt @@ -83,10 +83,10 @@ GitVersion.Common.IRepositoryStore.GetNumberOfUncommittedChanges() -> int GitVersion.Common.IRepositoryStore.GetReleaseBranches(System.Collections.Generic.IEnumerable>! releaseBranchConfig) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetTaggedSemanticVersions(string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! -GitVersion.Common.IRepositoryStore.GetTaggedSemanticVersionsOnBranch(GitVersion.IBranch! branch, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! +GitVersion.Common.IRepositoryStore.GetTaggedSemanticVersions(string? tagPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! +GitVersion.Common.IRepositoryStore.GetTaggedSemanticVersionsOnBranch(GitVersion.IBranch! branch, string? tagPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! GitVersion.Common.IRepositoryStore.GetTargetBranch(string? targetBranchName) -> GitVersion.IBranch! -GitVersion.Common.IRepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? tagPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.IsCommitOnBranch(GitVersion.ICommit? baseVersionSource, GitVersion.IBranch! branch, GitVersion.ICommit! firstMatchingCommit) -> bool GitVersion.Configuration.ConfigurationException GitVersion.Configuration.ConfigurationException.ConfigurationException() -> void @@ -112,14 +112,14 @@ GitVersion.Configuration.EffectiveConfiguration.BranchPrefixToTrim.get -> string GitVersion.Configuration.EffectiveConfiguration.CommitDateFormat.get -> string? GitVersion.Configuration.EffectiveConfiguration.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.Configuration.IBranchConfiguration! branchConfiguration) -> void -GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Extensions.AssemblyVersioningScheme assemblyVersioningScheme, GitVersion.Extensions.AssemblyFileVersioningScheme assemblyFileVersioningScheme, string? assemblyInformationalFormat, string? assemblyVersioningFormat, string? assemblyFileVersioningFormat, GitVersion.VersionCalculation.VersioningMode versioningMode, string? labelPrefix, string! label, string? nextVersion, GitVersion.IncrementStrategy increment, string? branchPrefixToTrim, bool preventIncrementOfMergedBranchVersion, string? labelNumberPattern, bool trackMergeTarget, string? majorVersionBumpMessage, string? minorVersionBumpMessage, string? patchVersionBumpMessage, string? noBumpMessage, GitVersion.VersionCalculation.CommitMessageIncrementMode commitMessageIncrementing, System.Collections.Generic.IEnumerable! versionFilters, bool tracksReleaseBranches, bool isReleaseBranch, bool isMainline, string? commitDateFormat, bool updateBuildNumber, GitVersion.SemanticVersionFormat semanticVersionFormat, int preReleaseWeight, int labelPreReleaseWeight) -> void +GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Extensions.AssemblyVersioningScheme assemblyVersioningScheme, GitVersion.Extensions.AssemblyFileVersioningScheme assemblyFileVersioningScheme, string? assemblyInformationalFormat, string? assemblyVersioningFormat, string? assemblyFileVersioningFormat, GitVersion.VersionCalculation.VersioningMode versioningMode, string? tagPrefix, string! label, string? nextVersion, GitVersion.IncrementStrategy increment, string? branchPrefixToTrim, bool preventIncrementOfMergedBranchVersion, string? labelNumberPattern, bool trackMergeTarget, string? majorVersionBumpMessage, string? minorVersionBumpMessage, string? patchVersionBumpMessage, string? noBumpMessage, GitVersion.VersionCalculation.CommitMessageIncrementMode commitMessageIncrementing, System.Collections.Generic.IEnumerable! versionFilters, bool tracksReleaseBranches, bool isReleaseBranch, bool isMainline, string? commitDateFormat, bool updateBuildNumber, GitVersion.SemanticVersionFormat semanticVersionFormat, int preReleaseWeight, int tagPreReleaseWeight) -> void GitVersion.Configuration.EffectiveConfiguration.Increment.get -> GitVersion.IncrementStrategy GitVersion.Configuration.EffectiveConfiguration.IsMainline.get -> bool GitVersion.Configuration.EffectiveConfiguration.IsReleaseBranch.get -> bool GitVersion.Configuration.EffectiveConfiguration.Label.get -> string? GitVersion.Configuration.EffectiveConfiguration.LabelNumberPattern.get -> string? -GitVersion.Configuration.EffectiveConfiguration.LabelPreReleaseWeight.get -> int -GitVersion.Configuration.EffectiveConfiguration.LabelPrefix.get -> string? +GitVersion.Configuration.EffectiveConfiguration.TagPreReleaseWeight.get -> int +GitVersion.Configuration.EffectiveConfiguration.TagPrefix.get -> string? GitVersion.Configuration.EffectiveConfiguration.MajorVersionBumpMessage.get -> string? GitVersion.Configuration.EffectiveConfiguration.MinorVersionBumpMessage.get -> string? GitVersion.Configuration.EffectiveConfiguration.NextVersion.get -> string? @@ -171,8 +171,8 @@ GitVersion.Configuration.IGitVersionConfiguration.AssemblyVersioningScheme.get - GitVersion.Configuration.IGitVersionConfiguration.Branches.get -> System.Collections.Generic.IReadOnlyDictionary! GitVersion.Configuration.IGitVersionConfiguration.CommitDateFormat.get -> string? GitVersion.Configuration.IGitVersionConfiguration.Ignore.get -> GitVersion.Configuration.IIgnoreConfiguration! -GitVersion.Configuration.IGitVersionConfiguration.LabelPreReleaseWeight.get -> int? -GitVersion.Configuration.IGitVersionConfiguration.LabelPrefix.get -> string? +GitVersion.Configuration.IGitVersionConfiguration.TagPreReleaseWeight.get -> int? +GitVersion.Configuration.IGitVersionConfiguration.TagPrefix.get -> string? GitVersion.Configuration.IGitVersionConfiguration.MajorVersionBumpMessage.get -> string? GitVersion.Configuration.IGitVersionConfiguration.MergeMessageFormats.get -> System.Collections.Generic.IReadOnlyDictionary! GitVersion.Configuration.IGitVersionConfiguration.MinorVersionBumpMessage.get -> string? @@ -559,7 +559,7 @@ GitVersion.OutputVariables.VersionVariablesJsonModel.WeightedPreReleaseNumber.ge GitVersion.OutputVariables.VersionVariablesJsonModel.WeightedPreReleaseNumber.set -> void GitVersion.OutputVariables.VersionVariablesJsonStringConverter GitVersion.OutputVariables.VersionVariablesJsonStringConverter.VersionVariablesJsonStringConverter() -> void -GitVersion.ReferenceName.TryGetSemanticVersion(out (GitVersion.SemanticVersion! Value, string? Name) result, System.Text.RegularExpressions.Regex! versionPatternRegex, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> bool +GitVersion.ReferenceName.TryGetSemanticVersion(out (GitVersion.SemanticVersion! Value, string? Name) result, System.Text.RegularExpressions.Regex! versionPatternRegex, string? tagPrefix, GitVersion.SemanticVersionFormat format) -> bool GitVersion.RefSpecDirection GitVersion.RefSpecDirection.Fetch = 0 -> GitVersion.RefSpecDirection GitVersion.RefSpecDirection.Push = 1 -> GitVersion.RefSpecDirection diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs index 17643930e3..13c3de01ae 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs @@ -20,7 +20,7 @@ public override IEnumerable GetBaseVersions(EffectiveBranchConfigur var nextVersion = contextConfiguration.NextVersion; if (!nextVersion.IsNullOrEmpty() && !Context.IsCurrentCommitTagged) { - var semanticVersion = SemanticVersion.Parse(nextVersion, contextConfiguration.LabelPrefix, contextConfiguration.SemanticVersionFormat); + var semanticVersion = SemanticVersion.Parse(nextVersion, contextConfiguration.TagPrefix, contextConfiguration.SemanticVersionFormat); yield return new BaseVersion("NextVersion in GitVersion configuration file", false, semanticVersion, null, null); } } diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs index 87dca264cf..48cc0b89f0 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs @@ -28,7 +28,7 @@ private IEnumerable GetSemanticVersions(EffectiveBranchC var label = configuration.Value.GetBranchSpecificLabel(Context.CurrentBranch.Name, null); var semanticVersions = this.repositoryStore.GetTaggedSemanticVersions( - Context.Configuration.LabelPrefix, Context.Configuration.SemanticVersionFormat + Context.Configuration.TagPrefix, Context.Configuration.SemanticVersionFormat ).ToList(); ILookup semanticVersionsByCommit = semanticVersions.ToLookup(element => element.Tag.Commit.Id.Sha); diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs index 55e7a1e021..d5e0997ad5 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs @@ -35,7 +35,7 @@ private bool TryGetBaseVersion([NotNullWhen(true)] out BaseVersion? baseVersion, foreach (var branch in new[] { Context.CurrentBranch, configuration.Branch }) { if (branch.Name.TryGetSemanticVersion(out var result, configuration.Value.VersionInBranchRegex, - configuration.Value.LabelPrefix, configuration.Value.SemanticVersionFormat)) + configuration.Value.TagPrefix, configuration.Value.SemanticVersionFormat)) { string? branchNameOverride = null; if (!result.Name.IsNullOrEmpty() && (Context.CurrentBranch.Name.Equals(branch.Name) diff --git a/src/GitVersion.Core/VersionCalculation/NonTrunkBasedVersionCalculatorBase.cs b/src/GitVersion.Core/VersionCalculation/NonTrunkBasedVersionCalculatorBase.cs index c13931abe0..84c64fbf46 100644 --- a/src/GitVersion.Core/VersionCalculation/NonTrunkBasedVersionCalculatorBase.cs +++ b/src/GitVersion.Core/VersionCalculation/NonTrunkBasedVersionCalculatorBase.cs @@ -39,7 +39,7 @@ protected SemanticVersion CalculateIncrementedVersion(NextVersion nextVersion) //// // TODO: We need to consider somehow the IGitVersionConfiguration::Ignore property here!! var semanticVersionWithTag = this.repositoryStore.GetTaggedSemanticVersionsOnBranch( - nextVersion.Branch, Context.Configuration.LabelPrefix, Context.Configuration.SemanticVersionFormat + nextVersion.Branch, Context.Configuration.TagPrefix, Context.Configuration.SemanticVersionFormat ).FirstOrDefault(element => Context.CurrentCommit is null || element.Tag.Commit.When <= Context.CurrentCommit.When); // diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs index 007997d925..4df43c5afa 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs @@ -71,7 +71,7 @@ private string GetWeightedPreReleaseNumber() this.semver.PreReleaseTag.HasTag() ? (this.semver.PreReleaseTag.Number + this.configuration.PreReleaseWeight).ToString() : null; return weightedPreReleaseNumber.IsNullOrEmpty() - ? $"{this.configuration.LabelPreReleaseWeight}" + ? $"{this.configuration.TagPreReleaseWeight}" : weightedPreReleaseNumber; } } diff --git a/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs index 91f7cbd564..464bdfc3e7 100644 --- a/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs @@ -38,7 +38,7 @@ public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(strin var workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -55,7 +55,7 @@ public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo var assemblyInfoFile = PathHelper.Combine("src", "Project", "Properties", $"VersionAssemblyInfo.{fileExtension}"); var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); var variables = this.variableProvider.GetVariablesFor( - SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null + SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); @@ -75,7 +75,7 @@ public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInf "AssemblyInfo." + fileExtension, PathHelper.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) }; - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFiles.ToArray())); @@ -96,7 +96,7 @@ public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); var variables = this.variableProvider.GetVariablesFor( - SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null + SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); @@ -113,7 +113,7 @@ public void ShouldNotCreateAssemblyInfoFileForUnknownSourceCodeAndEnsureAssembly const string assemblyInfoFile = "VersionAssemblyInfo.js"; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); var variables = this.variableProvider.GetVariablesFor( - SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null + SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); @@ -129,7 +129,7 @@ public void ShouldStartSearchFromWorkingDirectory() var workingDir = Path.GetTempPath(); var assemblyInfoFiles = Array.Empty(); var variables = this.variableProvider.GetVariablesFor( - SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null + SemanticVersion.Parse("1.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null ); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); diff --git a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs index 047b1b1e6a..fe56c05f89 100644 --- a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs @@ -141,7 +141,7 @@ public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string xml) { var variables = this.variableProvider.GetVariablesFor( - SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null + SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null ); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); @@ -169,7 +169,7 @@ public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string x )] public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -199,7 +199,7 @@ public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string )] public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLastElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -230,7 +230,7 @@ public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLas )] public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsModified(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultLabelPrefix), new TestEffectiveConfiguration(), null); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", ConfigurationConstants.DefaultTagPrefix), new TestEffectiveConfiguration(), null); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer);