diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index cb277452fd..7fc0ba0728 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) * 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 bc16c49f2b..ca4826c8e5 100644 --- a/docs/input/docs/reference/configuration.md +++ b/docs/input/docs/reference/configuration.md @@ -46,13 +46,13 @@ assembly-file-versioning-scheme: MajorMinorPatch assembly-informational-format: '{InformationalVersion}' mode: ContinuousDelivery increment: Inherit -continuous-delivery-fallback-tag: ci -tag-prefix: '[vV]' +continuous-delivery-fallback-label: ci +label-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)' -tag-pre-release-weight: 60000 +label-pre-release-weight: 60000 commit-message-incrementing: Enabled ignore: sha: [] @@ -142,26 +142,26 @@ for [increment](#increment), [prevent-increment-of-merged-branch-version](#prevent-increment-of-merged-branch-version) and [tracks-release-branches](#tracks-release-branches). -### continuous-delivery-fallback-tag +### continuous-delivery-fallback-label When using `mode: ContinuousDeployment`, the value specified in -`continuous-delivery-fallback-tag` will be used as the pre-release tag for +`continuous-delivery-fallback-label` will be used as the pre-release label for branches which do not have one specified. Default set to `ci`. Just to clarify: For a build name without `...-ci-` or in other words without a `PreReleaseTag` (ergo `"PreReleaseTag":""` in GitVersion's JSON output) -at the end you would need to set `continuous-delivery-fallback-tag` to an empty +at the end you would need to set `continuous-delivery-fallback-label` to an empty string (`''`): ```yaml mode: ContinuousDeployment -continuous-delivery-fallback-tag: '' +continuous-delivery-fallback-label: '' ... ``` Doing so can be helpful if you use your `main` branch as a `release` branch. -### tag-prefix +### label-prefix A regex which is used to trim Git tags before processing (e.g., v1.0.0). Default is `[vV]`, although this is just for illustrative purposes as we do a IgnoreCase @@ -194,7 +194,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. -### tag-pre-release-weight +### label-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 @@ -293,7 +293,7 @@ branches: main: regex: ^master$|^main$ mode: ContinuousDelivery - tag: '' + label: '' increment: Patch prevent-increment-of-merged-branch-version: true track-merge-target: false @@ -305,7 +305,7 @@ branches: develop: regex: ^dev(elop)?(ment)?$ mode: ContinuousDeployment - tag: alpha + label: alpha increment: Minor prevent-increment-of-merged-branch-version: false track-merge-target: true @@ -317,7 +317,7 @@ branches: release: regex: ^releases?[/-] mode: ContinuousDelivery - tag: beta + label: beta increment: None prevent-increment-of-merged-branch-version: true track-merge-target: false @@ -329,29 +329,29 @@ branches: feature: regex: ^features?[/-] mode: ContinuousDelivery - tag: '{BranchName}' + label: '{BranchName}' increment: Inherit source-branches: [ 'develop', 'main', 'release', 'feature', 'support', 'hotfix' ] - pre-release-weight: 30000 + pre-release-weight: 30000 pull-request: regex: ^(pull|pull\-requests|pr)[/-] mode: ContinuousDelivery - tag: PullRequest + label: PullRequest increment: Inherit - tag-number-pattern: '[/-](?\d+)[-/]' + label-number-pattern: '[/-](?\d+)[-/]' source-branches: [ 'develop', 'main', 'release', 'feature', 'support', 'hotfix' ] pre-release-weight: 30000 hotfix: regex: ^hotfix(es)?[/-] mode: ContinuousDelivery - tag: beta + label: beta increment: Inherit source-branches: [ 'release', 'main', 'support', 'hotfix' ] pre-release-weight: 30000 support: regex: ^support[/-] mode: ContinuousDelivery - tag: '' + label: '' increment: Patch prevent-increment-of-merged-branch-version: true track-merge-target: false @@ -457,15 +457,15 @@ The header for all the individual branch configuration. Same as for the [global configuration, explained above](#mode). -### tag +### label -The pre release tag to use for this branch. Use the value `useBranchName` to use +The pre release label to use for this branch. Use the value `useBranchName` to use the branch name instead. For example `feature/foo` would become a pre-release -tag of `foo` with this value. Use the value `{BranchName}` as a placeholder to -insert the branch name. For example `feature/foo` would become a pre-release tag +label of `foo` with this value. Use the value `{BranchName}` as a placeholder to +insert the branch name. For example `feature/foo` would become a pre-release label of `alpha.foo` with the value of `alpha.{BranchName}`. -**Note:** To clear a default use an empty string: `tag: ''` +**Note:** To clear a default use an empty string: `label: ''` ### increment @@ -482,15 +482,15 @@ In a GitFlow-based repository, setting this option can have implications on the better version source proposed by the `MergeMessageBaseVersionStrategy`. For more details and an in-depth analysis, please see [the discussion][2506]. -### tag-number-pattern +### label-number-pattern Pull requests require us to extract the pre-release number out of the branch name so `refs/pulls/534/merge` builds as `PullRequest.534`. This is a regex with a named capture group called `number`. If the branch `mode` is set to `ContinuousDeployment`, then the extracted -`number` is appended to the name of the pre-release tag and the number portion -is the number of commits since the last tag. This enables consecutive commits to +`number` is appended to the name of the pre-release label and the number portion +is the number of commits since the last label. This enables consecutive commits to the pull request branch to generate unique full semantic version numbers when the branch is configured to use ContinuousDeployment mode. @@ -500,10 +500,10 @@ the branch is configured to use ContinuousDeployment mode. branches: pull-request: mode: ContinuousDeployment - tag: PullRequest + label: PullRequest increment: Inherit track-merge-target: true - tag-number-pattern: '[/-](?\d+)[-/]' + label-number-pattern: '[/-](?\d+)[-/]' ``` ### track-merge-target diff --git a/docs/input/docs/usage/cli/arguments.md b/docs/input/docs/usage/cli/arguments.md index d48fca32a1..1f809c3698 100644 --- a/docs/input/docs/usage/cli/arguments.md +++ b/docs/input/docs/usage/cli/arguments.md @@ -43,8 +43,8 @@ GitVersion [path] from GitVersion.yml) in yaml format /overrideconfig Overrides GitVersion config values inline (semicolon- separated key value pairs e.g. /overrideconfig - tag-prefix=Foo) - Currently supported config overrides: tag-prefix + label-prefix=Foo) + Currently supported config overrides: label-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. @@ -117,7 +117,7 @@ Following options are supported: 5. `assembly-versioning-scheme` 7. `commit-date-format` 8. `commit-message-incrementing` -10. `continuous-delivery-fallback-tag` +10. `continuous-delivery-fallback-label` 11. `increment` 13. `major-version-bump-message` 14. `minor-version-bump-message` @@ -125,17 +125,17 @@ Following options are supported: 16. `next-version` 17. `no-bump-message` 18. `patch-version-bump-message` -19. `tag-prefix` -20. `tag-pre-release-weight` +19. `label-prefix` +20. `label-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`. -### Example: How to override configuration option 'tag-prefix' to use prefix 'custom' +### Example: How to override configuration option 'label-prefix' to use prefix 'custom' -`GitVersion.exe /output json /overrideconfig tag-prefix=custom` +`GitVersion.exe /output json /overrideconfig label-prefix=custom` ### Example: How to override configuration option 'assembly-versioning-format' @@ -151,7 +151,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 tag-prefix=custom /overrideconfig assembly-versioning-scheme=MajorMinor` +`GitVersion.exe /output json /overrideconfig label-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 704044e0fd..e3190e6d0a 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 'tag-prefix' to use prefix 'custom' +## Example: How to override configuration option 'label-prefix' to use prefix 'custom' -`GitVersion.exe /output json /overrideconfig tag-prefix=custom` +`GitVersion.exe /output json /overrideconfig label-prefix=custom` ## Writing version metadata in WiX format diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index fed0715a6a..67e2943eca 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -381,9 +381,9 @@ public string OverrideconfigWithInvalidOption(string options) private static IEnumerable OverrideconfigWithInvalidOptionTestData() { - yield return new TestCaseData("tag-prefix=sample=asdf") + yield return new TestCaseData("label-prefix=sample=asdf") { - ExpectedResult = "Could not parse /overrideconfig option: tag-prefix=sample=asdf. Ensure it is in format 'key=value'." + ExpectedResult = "Could not parse /overrideconfig option: label-prefix=sample=asdf. Ensure it is in format 'key=value'." }; yield return new TestCaseData("unknown-option=25") { @@ -393,9 +393,9 @@ private static IEnumerable OverrideconfigWithInvalidOptionTestData { ExpectedResult = "Could not parse /overrideconfig option: update-build-number=1. Ensure that 'value' is 'true' or 'false'." }; - yield return new TestCaseData("tag-pre-release-weight=invalid-value") + yield return new TestCaseData("label-pre-release-weight=invalid-value") { - ExpectedResult = "Could not parse /overrideconfig option: tag-pre-release-weight=invalid-value. Ensure that 'value' is valid integer number." + ExpectedResult = "Could not parse /overrideconfig option: label-pre-release-weight=invalid-value. Ensure that 'value' is valid integer number." }; yield return new TestCaseData("assembly-versioning-scheme=WrongEnumValue") { @@ -460,17 +460,17 @@ private static IEnumerable OverrideConfigWithSingleOptionTestData( } ); yield return new TestCaseData( - "tag-prefix=sample", + "label-prefix=sample", new GitVersionConfiguration { - TagPrefix = "sample" + LabelPrefix = "sample" } ); yield return new TestCaseData( - "continuous-delivery-fallback-tag=cd-tag", + "continuous-delivery-fallback-label=cd-label", new GitVersionConfiguration { - ContinuousDeploymentFallbackTag = "cd-tag" + ContinuousDeploymentFallbackLabel = "cd-label" } ); yield return new TestCaseData( @@ -509,10 +509,10 @@ private static IEnumerable OverrideConfigWithSingleOptionTestData( } ); yield return new TestCaseData( - "tag-pre-release-weight=2", + "label-pre-release-weight=2", new GitVersionConfiguration { - TagPreReleaseWeight = 2 + LabelPreReleaseWeight = 2 } ); yield return new TestCaseData( @@ -545,41 +545,41 @@ private static IEnumerable OverrideConfigWithSingleOptionTestData( ); } - [TestCaseSource(nameof(OverrideconfigWithMultipleOptionsTestData))] - public void OverrideconfigWithMultipleOptions(string options, GitVersionConfiguration expected) + [TestCaseSource(nameof(OverrideConfigWithMultipleOptionsTestData))] + public void OverrideConfigWithMultipleOptions(string options, GitVersionConfiguration expected) { var arguments = this.argumentParser.ParseArguments(options); arguments.OverrideConfig.ShouldBeEquivalentTo(expected); } - private static IEnumerable OverrideconfigWithMultipleOptionsTestData() + private static IEnumerable OverrideConfigWithMultipleOptionsTestData() { yield return new TestCaseData( - "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-scheme=MajorMinor", + "/overrideconfig label-prefix=sample /overrideconfig assembly-versioning-scheme=MajorMinor", new GitVersionConfiguration { - TagPrefix = "sample", + LabelPrefix = "sample", AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor } ); yield return new TestCaseData( - "/overrideconfig tag-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", + "/overrideconfig label-prefix=sample /overrideconfig assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", new GitVersionConfiguration { - TagPrefix = "sample", + LabelPrefix = "sample", AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}" } ); yield return new TestCaseData( - "/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", + "/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", new GitVersionConfiguration { - TagPrefix = "sample", + LabelPrefix = "sample", AssemblyVersioningFormat = "{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}", UpdateBuildNumber = true, AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag, VersioningMode = VersioningMode.ContinuousDelivery, - TagPreReleaseWeight = 4 + LabelPreReleaseWeight = 4 } ); } diff --git a/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs b/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs index 678fca3d4c..250c700fa6 100644 --- a/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs +++ b/src/GitVersion.App.Tests/QuotedStringHelpersTests.cs @@ -27,52 +27,52 @@ private static IEnumerable SplitUnquotedTestData() { ExpectedResult = new[] { "one", "\"two three" } }; - yield return new TestCaseData("/overrideconfig tag-prefix=Sample", ' ') + yield return new TestCaseData("/overrideconfig label-prefix=Sample", ' ') { ExpectedResult = new[] { "/overrideconfig", - "tag-prefix=Sample" + "label-prefix=Sample" } }; - yield return new TestCaseData("/overrideconfig tag-prefix=Sample 2", ' ') + yield return new TestCaseData("/overrideconfig label-prefix=Sample 2", ' ') { ExpectedResult = new[] { "/overrideconfig", - "tag-prefix=Sample", + "label-prefix=Sample", "2" } }; - yield return new TestCaseData("/overrideconfig tag-prefix=\"Sample 2\"", ' ') + yield return new TestCaseData("/overrideconfig label-prefix=\"Sample 2\"", ' ') { ExpectedResult = new[] { "/overrideconfig", - "tag-prefix=\"Sample 2\"" + "label-prefix=\"Sample 2\"" } }; - yield return new TestCaseData("/overrideconfig tag-prefix=\"Sample \\\"quoted\\\"\"", ' ') + yield return new TestCaseData("/overrideconfig label-prefix=\"Sample \\\"quoted\\\"\"", ' ') { ExpectedResult = new[] { "/overrideconfig", - "tag-prefix=\"Sample \\\"quoted\\\"\"" + "label-prefix=\"Sample \\\"quoted\\\"\"" } }; - yield return new TestCaseData("/overrideconfig tag-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ' ') + yield return new TestCaseData("/overrideconfig label-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ' ') { ExpectedResult = new[] { "/overrideconfig", - "tag-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"" + "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}\"", ';') + yield return new TestCaseData("label-prefix=sample;assembly-versioning-format=\"{Major}.{Minor}.{Patch}.{env:CI_JOB_ID ?? 0}\"", ';') { ExpectedResult = new[] { - "tag-prefix=sample", + "label-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 f2943e4f82..b14a97a3c6 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -1,18 +1,18 @@ assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch mode: ContinuousDelivery -tag-prefix: '[vV]?' -continuous-delivery-fallback-tag: ci +label-prefix: '[vV]?' +continuous-delivery-fallback-label: ci 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)' -tag-pre-release-weight: 60000 +label-pre-release-weight: 60000 commit-message-incrementing: Enabled branches: develop: mode: ContinuousDeployment - tag: alpha + label: alpha increment: Minor prevent-increment-of-merged-branch-version: false track-merge-target: true @@ -24,7 +24,7 @@ branches: pre-release-weight: 0 main: mode: ContinuousDelivery - tag: '' + label: '' increment: Patch prevent-increment-of-merged-branch-version: true track-merge-target: false @@ -38,7 +38,7 @@ branches: pre-release-weight: 55000 release: mode: ContinuousDelivery - tag: beta + label: beta increment: None prevent-increment-of-merged-branch-version: true track-merge-target: false @@ -54,7 +54,7 @@ branches: pre-release-weight: 30000 feature: mode: ContinuousDelivery - tag: '{BranchName}' + label: '{BranchName}' increment: Inherit regex: ^features?[/-] source-branches: @@ -67,9 +67,9 @@ branches: pre-release-weight: 30000 pull-request: mode: ContinuousDelivery - tag: PullRequest + label: PullRequest increment: Inherit - tag-number-pattern: '[/-](?\d+)' + label-number-pattern: '[/-](?\d+)' regex: ^(pull|pull\-requests|pr)[/-] source-branches: - develop @@ -81,7 +81,7 @@ branches: pre-release-weight: 30000 hotfix: mode: ContinuousDelivery - tag: beta + label: beta increment: Inherit regex: ^hotfix(es)?[/-] source-branches: @@ -92,7 +92,7 @@ branches: pre-release-weight: 30000 support: mode: ContinuousDelivery - tag: '' + label: '' increment: Patch prevent-increment-of-merged-branch-version: true track-merge-target: false diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs index b1f7dba626..169a1ce2d8 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs @@ -43,7 +43,7 @@ public void OverwritesDefaultsWithProvidedConfig() branches: develop: mode: ContinuousDeployment - tag: dev"; + label: dev"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); @@ -51,7 +51,7 @@ public void OverwritesDefaultsWithProvidedConfig() configuration.Branches.ShouldNotBeNull(); configuration.Branches["develop"].Increment.ShouldBe(defaultConfig.Branches["develop"].Increment); configuration.Branches["develop"].VersioningMode.ShouldBe(defaultConfig.Branches["develop"].VersioningMode); - configuration.Branches["develop"].Tag.ShouldBe("dev"); + configuration.Branches["develop"].Label.ShouldBe("dev"); } [Test] @@ -65,18 +65,18 @@ public void AllBranchesModeWhenUsingMainline() } [Test] - public void CanRemoveTag() + public void CanRemoveLabel() { const string text = @" next-version: 2.0.0 branches: release: - tag: """""; + label: """""; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); configuration.NextVersion.ShouldBe("2.0.0"); - configuration.Branches["release"].Tag.ShouldBe(string.Empty); + configuration.Branches["release"].Label.ShouldBe(string.Empty); } [Test] @@ -86,7 +86,7 @@ public void RegexIsRequired() next-version: 2.0.0 branches: bug: - tag: bugfix"; + label: bugfix"; SetupConfigFileContent(text); var ex = Should.Throw(() => this.configurationProvider.Provide(this.repoPath)); ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'regex'{System.Environment.NewLine}" + @@ -101,7 +101,7 @@ public void SourceBranchIsRequired() branches: bug: regex: 'bug[/-]' - tag: bugfix"; + label: bugfix"; SetupConfigFileContent(text); var ex = Should.Throw(() => this.configurationProvider.Provide(this.repoPath)); ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'source-branches'{System.Environment.NewLine}" + @@ -115,7 +115,7 @@ public void SourceBranchesValidationShouldFailWhenMatchingBranchConfigurationIsM branches: bug: regex: 'bug[/-]' - tag: bugfix + label: bugfix source-branches: [notconfigured]"; SetupConfigFileContent(text); var ex = Should.Throw(() => this.configurationProvider.Provide(this.repoPath)); @@ -132,7 +132,7 @@ public void SourceBranchesValidationShouldSucceedForWellKnownBranches(string wel branches: bug: regex: 'bug[/-]' - tag: bugfix + label: bugfix source-branches: [{wellKnownBranchKey}]"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); @@ -148,13 +148,13 @@ public void CanProvideConfigForNewBranch() branches: bug: regex: 'bug[/-]' - tag: bugfix + label: bugfix source-branches: []"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); configuration.Branches["bug"].Regex.ShouldBe("bug[/-]"); - configuration.Branches["bug"].Tag.ShouldBe("bugfix"); + configuration.Branches["bug"].Label.ShouldBe("bugfix"); } [Test] @@ -165,13 +165,13 @@ public void MasterConfigReplacedWithMain() branches: master: regex: '^master$|^main$' - tag: beta"; + label: beta"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); configuration.Branches[MainBranch].Regex.ShouldBe("^master$|^main$"); - configuration.Branches[MainBranch].Tag.ShouldBe("beta"); + configuration.Branches[MainBranch].Label.ShouldBe("beta"); } [Test] @@ -294,9 +294,9 @@ public void CanReadDefaultDocument() configuration.AssemblyVersioningScheme.ShouldBe(AssemblyVersioningScheme.MajorMinorPatch); configuration.AssemblyFileVersioningScheme.ShouldBe(AssemblyFileVersioningScheme.MajorMinorPatch); configuration.AssemblyInformationalFormat.ShouldBe(null); - configuration.Branches["develop"].Tag.ShouldBe("alpha"); - configuration.Branches["release"].Tag.ShouldBe("beta"); - configuration.TagPrefix.ShouldBe(GitVersionConfiguration.DefaultTagPrefix); + configuration.Branches["develop"].Label.ShouldBe("alpha"); + configuration.Branches["release"].Label.ShouldBe("beta"); + configuration.LabelPrefix.ShouldBe(GitVersionConfiguration.DefaultLabelPrefix); configuration.NextVersion.ShouldBe(null); } @@ -353,7 +353,7 @@ public void ShouldUseSpecifiedSourceBranchesForDevelop() develop: mode: ContinuousDeployment source-branches: ['develop'] - tag: dev"; + label: dev"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); @@ -368,7 +368,7 @@ public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForDevelop() branches: develop: mode: ContinuousDeployment - tag: dev"; + label: dev"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); @@ -384,7 +384,7 @@ public void ShouldUseSpecifiedSourceBranchesForFeature() feature: mode: ContinuousDeployment source-branches: ['develop', 'release'] - tag: dev"; + label: dev"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); @@ -399,7 +399,7 @@ public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForFeature() branches: feature: mode: ContinuousDeployment - tag: dev"; + label: dev"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); @@ -412,7 +412,7 @@ public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty() { const string text = @" next-version: 1.2.3 -tag-prefix: custom-tag-prefix-from-yml"; +label-prefix: custom-label-prefix-from-yml"; SetupConfigFileContent(text); var expectedConfig = this.configurationProvider.Provide(this.repoPath); @@ -424,14 +424,14 @@ public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty() overridenConfig.AssemblyVersioningFormat.ShouldBe(expectedConfig.AssemblyVersioningFormat); overridenConfig.AssemblyFileVersioningFormat.ShouldBe(expectedConfig.AssemblyFileVersioningFormat); overridenConfig.VersioningMode.ShouldBe(expectedConfig.VersioningMode); - overridenConfig.TagPrefix.ShouldBe(expectedConfig.TagPrefix); - overridenConfig.ContinuousDeploymentFallbackTag.ShouldBe(expectedConfig.ContinuousDeploymentFallbackTag); + overridenConfig.LabelPrefix.ShouldBe(expectedConfig.LabelPrefix); + overridenConfig.ContinuousDeploymentFallbackLabel.ShouldBe(expectedConfig.ContinuousDeploymentFallbackLabel); 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.TagPreReleaseWeight.ShouldBe(expectedConfig.TagPreReleaseWeight); + overridenConfig.LabelPreReleaseWeight.ShouldBe(expectedConfig.LabelPreReleaseWeight); overridenConfig.CommitMessageIncrementing.ShouldBe(expectedConfig.CommitMessageIncrementing); overridenConfig.Increment.ShouldBe(expectedConfig.Increment); overridenConfig.CommitDateFormat.ShouldBe(expectedConfig.CommitDateFormat); @@ -455,27 +455,27 @@ public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile() SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); - configuration.TagPrefix.ShouldBe(GitVersionConfiguration.DefaultTagPrefix); + configuration.LabelPrefix.ShouldBe(GitVersionConfiguration.DefaultLabelPrefix); } [Test] public void ShouldUseTagPrefixFromConfigFileWhenProvided() { - const string text = "tag-prefix: custom-tag-prefix-from-yml"; + const string text = "label-prefix: custom-label-prefix-from-yml"; SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); - configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-yml"); + configuration.LabelPrefix.ShouldBe("custom-label-prefix-from-yml"); } [Test] public void ShouldOverrideTagPrefixWithOverrideConfigValue([Values] bool tagPrefixSetAtYmlFile) { - var text = tagPrefixSetAtYmlFile ? "tag-prefix: custom-tag-prefix-from-yml" : ""; + var text = tagPrefixSetAtYmlFile ? "label-prefix: custom-label-prefix-from-yml" : ""; SetupConfigFileContent(text); - var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = "tag-prefix-from-override-configuration" }); + var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { LabelPrefix = "label-prefix-from-override-configuration" }); - configuration.TagPrefix.ShouldBe("tag-prefix-from-override-configuration"); + configuration.LabelPrefix.ShouldBe("label-prefix-from-override-configuration"); } [Test] @@ -483,18 +483,18 @@ public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig() { const string text = ""; SetupConfigFileContent(text); - var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null }); + var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { LabelPrefix = null }); - configuration.TagPrefix.ShouldBe(GitVersionConfiguration.DefaultTagPrefix); + configuration.LabelPrefix.ShouldBe(GitVersionConfiguration.DefaultLabelPrefix); } [Test] public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig() { - const string text = "tag-prefix: custom-tag-prefix-from-yml"; + const string text = "label-prefix: custom-label-prefix-from-yml"; SetupConfigFileContent(text); - var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null }); + var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { LabelPrefix = null }); - configuration.TagPrefix.ShouldBe("custom-tag-prefix-from-yml"); + configuration.LabelPrefix.ShouldBe("custom-label-prefix-from-yml"); } } diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index b0b8fc33fd..a3e4f9a782 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -204,7 +204,7 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn var cacheDirectoryTimestamp = this.fileSystem.GetLastDirectoryWrite(cacheDirectory); - var configuration = new ConfigurationBuilder().Add(new GitVersionConfiguration { TagPrefix = "prefix" }).Build(); + var configuration = new ConfigurationBuilder().Add(new GitVersionConfiguration { LabelPrefix = "prefix" }).Build(); gitVersionOptions = new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, ConfigInfo = { OverrideConfig = configuration } }; gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions); diff --git a/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs b/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs index 6b015df2e7..7b125d4a00 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs @@ -14,9 +14,9 @@ private GitFlowConfigurationBuilder() { AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - TagPrefix = GitVersionConfiguration.DefaultTagPrefix, + LabelPrefix = GitVersionConfiguration.DefaultLabelPrefix, VersioningMode = VersioningMode.ContinuousDelivery, - ContinuousDeploymentFallbackTag = "ci", + ContinuousDeploymentFallbackLabel = "ci", MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern, MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern, PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern, @@ -25,7 +25,7 @@ private GitFlowConfigurationBuilder() CommitDateFormat = "yyyy-MM-dd", UpdateBuildNumber = true, SemanticVersionFormat = SemanticVersionFormat.Strict, - TagPreReleaseWeight = 60000, + LabelPreReleaseWeight = 60000, Increment = IncrementStrategy.Inherit }); @@ -35,7 +35,7 @@ private GitFlowConfigurationBuilder() Increment = IncrementStrategy.Minor, Regex = DevelopBranch.RegexPattern, SourceBranches = new HashSet(), - Tag = "alpha", + Label = "alpha", PreventIncrementOfMergedBranchVersion = false, TrackMergeTarget = true, TracksReleaseBranches = true, @@ -53,7 +53,7 @@ private GitFlowConfigurationBuilder() DevelopBranch.Name, ReleaseBranch.Name }, - Tag = string.Empty, + Label = string.Empty, PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, @@ -73,7 +73,7 @@ private GitFlowConfigurationBuilder() SupportBranch.Name, ReleaseBranch.Name }, - Tag = "beta", + Label = "beta", PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, @@ -95,7 +95,7 @@ private GitFlowConfigurationBuilder() SupportBranch.Name, HotfixBranch.Name }, - Tag = "{BranchName}", + Label = "{BranchName}", PreReleaseWeight = 30000 }); @@ -112,8 +112,8 @@ private GitFlowConfigurationBuilder() SupportBranch.Name, HotfixBranch.Name }, - Tag = "PullRequest", - TagNumberPattern = @"[/-](?\d+)", + Label = "PullRequest", + LabelNumberPattern = @"[/-](?\d+)", PreReleaseWeight = 30000 }); @@ -128,7 +128,7 @@ private GitFlowConfigurationBuilder() SupportBranch.Name, HotfixBranch.Name }, - Tag = "beta", + Label = "beta", PreReleaseWeight = 30000 }); @@ -138,7 +138,7 @@ private GitFlowConfigurationBuilder() Increment = IncrementStrategy.Patch, Regex = SupportBranch.RegexPattern, SourceBranches = new HashSet { MainBranch.Name }, - Tag = string.Empty, + Label = string.Empty, PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, diff --git a/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs b/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs index e0dffb8542..b67b21a67b 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs @@ -14,9 +14,9 @@ private GitHubFlowConfigurationBuilder() { AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - TagPrefix = GitVersionConfiguration.DefaultTagPrefix, + LabelPrefix = GitVersionConfiguration.DefaultLabelPrefix, VersioningMode = VersioningMode.ContinuousDelivery, - ContinuousDeploymentFallbackTag = "ci", + ContinuousDeploymentFallbackLabel = "ci", MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern, MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern, PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern, @@ -25,7 +25,7 @@ private GitHubFlowConfigurationBuilder() CommitDateFormat = "yyyy-MM-dd", UpdateBuildNumber = true, SemanticVersionFormat = SemanticVersionFormat.Strict, - TagPreReleaseWeight = 60000, + LabelPreReleaseWeight = 60000, Increment = IncrementStrategy.Inherit }); @@ -37,7 +37,7 @@ private GitHubFlowConfigurationBuilder() SourceBranches = new HashSet { ReleaseBranch.Name }, - Tag = string.Empty, + Label = string.Empty, PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, @@ -55,7 +55,7 @@ private GitHubFlowConfigurationBuilder() MainBranch.Name, ReleaseBranch.Name }, - Tag = "beta", + Label = "beta", PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, @@ -74,7 +74,7 @@ private GitHubFlowConfigurationBuilder() ReleaseBranch.Name, FeatureBranch.Name }, - Tag = "{BranchName}", + Label = "{BranchName}", PreReleaseWeight = 30000 }); @@ -88,8 +88,8 @@ private GitHubFlowConfigurationBuilder() ReleaseBranch.Name, FeatureBranch.Name }, - Tag = "PullRequest", - TagNumberPattern = @"[/-](?\d+)", + Label = "PullRequest", + LabelNumberPattern = @"[/-](?\d+)", PreReleaseWeight = 30000 }); } diff --git a/src/GitVersion.Core.Tests/Helpers/TestBranchConfigurationBuilder.cs b/src/GitVersion.Core.Tests/Helpers/TestBranchConfigurationBuilder.cs index 24455b2dbd..09a0952670 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestBranchConfigurationBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestBranchConfigurationBuilder.cs @@ -131,10 +131,10 @@ public virtual TestBranchConfigurationBuilder WithConfiguration(BranchConfigurat { WithName(value.Name); WithVersioningMode(value.VersioningMode); - WithTag(value.Tag); + WithTag(value.Label); WithIncrement(value.Increment); WithPreventIncrementOfMergedBranchVersion(value.PreventIncrementOfMergedBranchVersion); - WithTagNumberPattern(value.TagNumberPattern); + WithTagNumberPattern(value.LabelNumberPattern); WithTrackMergeTarget(value.TrackMergeTarget); WithCommitMessageIncrementing(value.CommitMessageIncrementing); WithRegex(value.Regex); @@ -153,7 +153,7 @@ public BranchConfiguration Build() { Name = name, VersioningMode = versioningMode, - Tag = tag, + Label = tag, Increment = increment, Regex = regex, TracksReleaseBranches = tracksReleaseBranches, @@ -161,7 +161,7 @@ public BranchConfiguration Build() CommitMessageIncrementing = commitMessageIncrementing, IsMainline = isMainline, IsReleaseBranch = isReleaseBranch, - TagNumberPattern = tagNumberPattern, + LabelNumberPattern = tagNumberPattern, PreventIncrementOfMergedBranchVersion = preventIncrementOfMergedBranchVersion, PreReleaseWeight = preReleaseWeight, SourceBranches = sourceBranches, diff --git a/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilderBase.cs b/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilderBase.cs index 76ed28b0e2..5858f9f9f4 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilderBase.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestConfigurationBuilderBase.cs @@ -200,14 +200,14 @@ public virtual TConfigurationBuilder WithConfiguration(GitVersionConfiguration v { WithoutVersioningMode(); } - WithTagPrefix(value.TagPrefix); - WithContinuousDeploymentFallbackTag(value.ContinuousDeploymentFallbackTag); + WithTagPrefix(value.LabelPrefix); + WithContinuousDeploymentFallbackTag(value.ContinuousDeploymentFallbackLabel); WithNextVersion(value.NextVersion); WithMajorVersionBumpMessage(value.MajorVersionBumpMessage); WithMinorVersionBumpMessage(value.MinorVersionBumpMessage); WithPatchVersionBumpMessage(value.PatchVersionBumpMessage); WithNoBumpMessage(value.NoBumpMessage); - WithTagPreReleaseWeight(value.TagPreReleaseWeight); + WithTagPreReleaseWeight(value.LabelPreReleaseWeight); WithCommitMessageIncrementing(value.CommitMessageIncrementing); WithIgnoreConfiguration(value.Ignore); WithIncrement(value.Increment); @@ -232,14 +232,14 @@ public virtual GitVersionConfiguration Build() AssemblyVersioningFormat = this.assemblyVersioningFormat, AssemblyFileVersioningFormat = this.assemblyFileVersioningFormat, VersioningMode = this.versioningMode, - TagPrefix = this.tagPrefix, - ContinuousDeploymentFallbackTag = this.continuousDeploymentFallbackTag, + LabelPrefix = this.tagPrefix, + ContinuousDeploymentFallbackLabel = this.continuousDeploymentFallbackTag, NextVersion = this.nextVersion, MajorVersionBumpMessage = this.majorVersionBumpMessage, MinorVersionBumpMessage = this.minorVersionBumpMessage, PatchVersionBumpMessage = this.patchVersionBumpMessage, NoBumpMessage = this.noBumpMessage, - TagPreReleaseWeight = this.tagPreReleaseWeight, + LabelPreReleaseWeight = this.tagPreReleaseWeight, CommitMessageIncrementing = this.commitMessageIncrementing, Ignore = this.ignore, Increment = this.increment, diff --git a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs index 1546572bc7..5cb30e53bd 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs @@ -13,13 +13,13 @@ public TestEffectiveConfiguration( string? assemblyFileVersioningFormat = null, string? assemblyInformationalFormat = null, VersioningMode versioningMode = VersioningMode.ContinuousDelivery, - string tagPrefix = GitVersionConfiguration.DefaultTagPrefix, - string tag = "", + string labelPrefix = GitVersionConfiguration.DefaultLabelPrefix, + string label = "", string? nextVersion = null, string branchPrefixToTrim = "", bool preventIncrementOfMergedBranchVersion = false, - string? tagNumberPattern = null, - string continuousDeploymentFallbackTag = "ci", + string? labelNumberPattern = null, + string continuousDeploymentFallbackLabel = "ci", bool trackMergeTarget = false, string? majorMessage = null, string? minorMessage = null, @@ -38,14 +38,14 @@ public TestEffectiveConfiguration( assemblyVersioningFormat, assemblyFileVersioningFormat, versioningMode, - tagPrefix, - tag, + labelPrefix, + label, nextVersion, IncrementStrategy.Patch, branchPrefixToTrim, preventIncrementOfMergedBranchVersion, - tagNumberPattern, - continuousDeploymentFallbackTag, + labelNumberPattern, + continuousDeploymentFallbackLabel, trackMergeTarget, majorMessage, minorMessage, diff --git a/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs index 2abebc72aa..5d55139051 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs @@ -62,7 +62,7 @@ public void CanChangeDevelopTagViaConfig() "develop", new BranchConfiguration { - Tag = "alpha", + Label = "alpha", SourceBranches = new HashSet() } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs index 51902e0a01..250e6fadb3 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/FeatureBranchScenarios.cs @@ -179,8 +179,8 @@ public void CanUseBranchNameOffAReleaseBranch() { Branches = { - { "release", new BranchConfiguration { Tag = "build" } }, - { "feature", new BranchConfiguration { Tag = "useBranchName" } } + { "release", new BranchConfiguration { Label = "build" } }, + { "feature", new BranchConfiguration { Label = "useBranchName" } } } }; @@ -204,7 +204,7 @@ public void ShouldUseConfiguredTag(string tag, string featureName, string preRel { Branches = { - { "feature", new BranchConfiguration { Tag = tag } } + { "feature", new BranchConfiguration { Label = tag } } } }; @@ -484,7 +484,7 @@ public void PickUpVersionFromMainMarkedWithIsTracksReleaseBranches() { MainBranch, new BranchConfiguration { - Tag = "pre", + Label = "pre", TracksReleaseBranches = true } }, @@ -492,7 +492,7 @@ public void PickUpVersionFromMainMarkedWithIsTracksReleaseBranches() "release", new BranchConfiguration { IsReleaseBranch = true, - Tag = "rc" + Label = "rc" } } } @@ -537,7 +537,7 @@ public void ShouldHaveAGreaterSemVerAfterDevelopIsMergedIntoFeature() { "feature", new BranchConfiguration { - Tag = "feat-{BranchName}" + Label = "feat-{BranchName}" } } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs index 115db47b93..76af176a47 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs @@ -204,13 +204,13 @@ public void CanSpecifyTagPrefixes() fixture.Repository.MakeATaggedCommit(taggedVersion); fixture.Repository.MakeCommits(5); - fixture.AssertFullSemver("1.0.4+5", new GitVersionConfiguration { TagPrefix = "version-" }); + fixture.AssertFullSemver("1.0.4+5", new GitVersionConfiguration { LabelPrefix = "version-" }); } [Test] public void CanSpecifyTagPrefixesAsRegex() { - var configuration = new GitVersionConfiguration { TagPrefix = $"version-|{GitVersionConfiguration.DefaultTagPrefix}" }; + var configuration = new GitVersionConfiguration { LabelPrefix = $"version-|{GitVersionConfiguration.DefaultLabelPrefix}" }; using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "v1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); @@ -228,7 +228,7 @@ public void CanSpecifyTagPrefixesAsRegex() [Test] public void AreTagsNotAdheringToTagPrefixIgnored() { - var configuration = new GitVersionConfiguration { TagPrefix = "" }; + var configuration = new GitVersionConfiguration { LabelPrefix = "" }; using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "version-1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs index acf87bfa42..bbbf05953c 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs @@ -71,7 +71,7 @@ public void TagIsBranchNameForBranchesWithoutPrefixedBranchName(string tag, stri Increment = IncrementStrategy.Patch, Regex = ".*", SourceBranches = new HashSet(), - Tag = tag + Label = tag } } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs index fbb315f6ad..64c5cd2eb2 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/ReleaseBranchScenarios.cs @@ -119,7 +119,7 @@ public void CanTakeVersionFromReleaseBranchWithTagOverridden() { Branches = { - { "release", new BranchConfiguration { Tag = "rc" } } + { "release", new BranchConfiguration { Label = "rc" } } } }; using var fixture = new EmptyRepositoryFixture(); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs index db7aaa1367..98a4b0d634 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionBumpingScenarios.cs @@ -20,7 +20,7 @@ public void AppliedPrereleaseTagCausesBump() { MainBranch, new BranchConfiguration { - Tag = "pre", + Label = "pre", SourceBranches = new HashSet() } } diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs index 5ee487af21..70f8dca8d4 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInTagScenarios.cs @@ -38,7 +38,7 @@ public void TagPreReleaseWeightIsConfigured_HeadIsATaggedCommit_WeightedPreRelea .Add(new GitVersionConfiguration { AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}", - TagPreReleaseWeight = 65535 + LabelPreReleaseWeight = 65535 }) .Build(); @@ -59,7 +59,7 @@ public void TagPreReleaseWeightIsConfigured_GitFlowReleaseIsFinished_WeightedPre .Add(new GitVersionConfiguration { AssemblyFileVersioningFormat = "{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}", - TagPreReleaseWeight = 65535, + LabelPreReleaseWeight = 65535, VersioningMode = VersioningMode.ContinuousDeployment }) .Build(); diff --git a/src/GitVersion.Core.Tests/MergeMessageTests.cs b/src/GitVersion.Core.Tests/MergeMessageTests.cs index ef7a38ede4..eb9bdb741e 100644 --- a/src/GitVersion.Core.Tests/MergeMessageTests.cs +++ b/src/GitVersion.Core.Tests/MergeMessageTests.cs @@ -8,7 +8,7 @@ namespace GitVersion.Core.Tests; [TestFixture] public class MergeMessageTests : TestBase { - private readonly GitVersionConfiguration configuration = new() { TagPrefix = GitVersionConfiguration.DefaultTagPrefix }; + private readonly GitVersionConfiguration configuration = new() { LabelPrefix = GitVersionConfiguration.DefaultLabelPrefix }; [Test] public void NullMessageStringThrows() => @@ -37,7 +37,7 @@ public void EmptyTagPrefix(string prefix) { // Arrange const string message = "Updated some code."; - var conf = new GitVersionConfiguration { TagPrefix = prefix }; + var conf = new GitVersionConfiguration { LabelPrefix = prefix }; // Act var sut = new MergeMessage(message, conf); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs index 904d5cdb9b..b6047b2157 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/EffectiveBranchConfigurationFinderTests.cs @@ -124,7 +124,7 @@ public void When_getting_configurations_of_a_branch_with_tag_alpha_Given_branch_ // Assert actual.ShouldHaveSingleItem(); actual[0].Branch.ShouldBe(mainBranchMock); - actual[0].Value.Tag.ShouldBe("alpha"); + actual[0].Value.Label.ShouldBe("alpha"); } [Test] @@ -151,7 +151,7 @@ public void When_getting_configurations_of_a_branch_without_tag_Given_branch_whi // Assert actual.ShouldHaveSingleItem(); actual[0].Branch.ShouldBe(mainBranchMock); - actual[0].Value.Tag.ShouldBe(string.Empty); + actual[0].Value.Label.ShouldBe(string.Empty); } [TestCase("release/latest", IncrementStrategy.None, "latest")] @@ -175,8 +175,8 @@ public void UsesFirstBranchConfigWhenMultipleMatch(string branchName, IncrementS VersioningMode = VersioningMode.ContinuousDelivery, Branches = { - { "release/latest", new BranchConfiguration(branchConfiguration) { Increment = IncrementStrategy.None, Tag = "latest", Regex = "release/latest" } }, - { "release", new BranchConfiguration(branchConfiguration) { Increment = IncrementStrategy.Patch, Tag = "not-latest", Regex = "releases?[/-]" } } + { "release/latest", new BranchConfiguration(branchConfiguration) { Increment = IncrementStrategy.None, Label = "latest", Regex = "release/latest" } }, + { "release", new BranchConfiguration(branchConfiguration) { Increment = IncrementStrategy.Patch, Label = "not-latest", Regex = "releases?[/-]" } } } }).Build(); @@ -192,7 +192,7 @@ public void UsesFirstBranchConfigWhenMultipleMatch(string branchName, IncrementS actual.ShouldHaveSingleItem(); actual[0].Branch.ShouldBe(releaseBranchMock); actual[0].Value.Increment.ShouldBe(incrementStrategy); - actual[0].Value.Tag.ShouldBe(tag); + actual[0].Value.Label.ShouldBe(tag); } [Test] diff --git a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs index 7393e7e7f8..6f836b165a 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/NextVersionCalculatorTests.cs @@ -76,7 +76,7 @@ public void PreReleaseTagCanUseBranchName() "custom", new BranchConfiguration { Regex = "custom/", - Tag = "useBranchName", + Label = "useBranchName", SourceBranches = new HashSet() } } @@ -232,7 +232,7 @@ public void PreReleaseTagCanUseBranchNameVariable() "custom", new BranchConfiguration { Regex = "custom/", - Tag = "alpha.{BranchName}", + Label = "alpha.{BranchName}", SourceBranches = new HashSet() } } @@ -260,7 +260,7 @@ public void PreReleaseNumberShouldBeScopeToPreReleaseLabelInContinuousDelivery() { MainBranch, new BranchConfiguration { - Tag = "beta" + Label = "beta" } } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs index 2343c6ffef..61abe024ed 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs @@ -25,9 +25,9 @@ public class SemanticVersionTests : TestBase [TestCase("1.2.3+4.Branch.Foo", 1, 2, 3, null, null, 4, "Foo", null, null, null, null, SemanticVersionFormat.Strict)] [TestCase("1.2.3+randomMetaData", 1, 2, 3, null, 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, null, GitVersionConfiguration.DefaultTagPrefix, SemanticVersionFormat.Strict)] - [TestCase("v1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", GitVersionConfiguration.DefaultTagPrefix, SemanticVersionFormat.Strict)] - [TestCase("V1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", GitVersionConfiguration.DefaultTagPrefix, SemanticVersionFormat.Strict)] + [TestCase("1.2.3", 1, 2, 3, null, null, null, null, null, null, null, GitVersionConfiguration.DefaultLabelPrefix, SemanticVersionFormat.Strict)] + [TestCase("v1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", GitVersionConfiguration.DefaultLabelPrefix, SemanticVersionFormat.Strict)] + [TestCase("V1.2.3", 1, 2, 3, null, null, null, null, null, null, "1.2.3", GitVersionConfiguration.DefaultLabelPrefix, SemanticVersionFormat.Strict)] [TestCase("version-1.2.3", 1, 2, 3, null, 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)] @@ -65,7 +65,7 @@ public void ValidateVersionParsing( [TestCase("someText")] [TestCase("some-T-ext")] - [TestCase("v.1.2.3", GitVersionConfiguration.DefaultTagPrefix)] + [TestCase("v.1.2.3", GitVersionConfiguration.DefaultLabelPrefix)] public void ValidateInvalidVersionParsing(string versionString, string? tagPrefixRegex = null) => Assert.IsFalse(SemanticVersion.TryParse(versionString, tagPrefixRegex, out _), "TryParse Result"); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs index 3f3475a7cf..b31428be96 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs @@ -167,7 +167,7 @@ public void ProvidesVariablesInContinuousDeploymentModeWithTagNamePattern() semVer.BuildMetaData.ShortSha = "commitShortSha"; semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - var configuration = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, tagNumberPattern: @"[/-](?\d+)[-/]"); + var configuration = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, labelNumberPattern: @"[/-](?\d+)[-/]"); var vars = this.variableProvider.GetVariablesFor(semVer, configuration, false); vars.FullSemVer.ShouldBe("1.2.3-PullRequest2.5"); @@ -189,7 +189,7 @@ public void ProvidesVariablesInContinuousDeploymentModeWithTagSetToUseBranchName semVer.BuildMetaData.ShortSha = "commitShortSha"; semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z"); - var configuration = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, tag: "useBranchName"); + var configuration = new TestEffectiveConfiguration(versioningMode: VersioningMode.ContinuousDeployment, label: "useBranchName"); var vars = this.variableProvider.GetVariablesFor(semVer, configuration, false); vars.FullSemVer.ShouldBe("1.2.3-feature.5"); diff --git a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs index e3f14e11cf..3b6545ca81 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs @@ -41,7 +41,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", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -57,7 +57,7 @@ public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo var workingDir = Path.GetTempPath(); 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", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -76,7 +76,7 @@ public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInf "AssemblyInfo." + fileExtension, PathHelper.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) }; - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); 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 workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); @@ -111,7 +111,7 @@ public void ShouldNotCreateAssemblyInfoFileForUnknownSourceCodeAndEnsureAssembly var workingDir = Path.GetTempPath(); const string assemblyInfoFile = "VersionAssemblyInfo.js"; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -125,7 +125,7 @@ public void ShouldStartSearchFromWorkingDirectory() this.fileSystem = Substitute.For(); var workingDir = Path.GetTempPath(); var assemblyInfoFiles = Array.Empty(); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFiles.ToArray())); diff --git a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs index 61b40cda9f..30b77dbb57 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs @@ -143,7 +143,7 @@ public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) )] public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -170,7 +170,7 @@ public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string x )] public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -200,7 +200,7 @@ public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string )] public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLastElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -231,7 +231,7 @@ public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLas )] public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsModified(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultTagPrefix), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", GitVersionConfiguration.DefaultLabelPrefix), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); diff --git a/src/GitVersion.Core/Configuration/BranchConfiguration.cs b/src/GitVersion.Core/Configuration/BranchConfiguration.cs index 007dd84bae..876e5e27f4 100644 --- a/src/GitVersion.Core/Configuration/BranchConfiguration.cs +++ b/src/GitVersion.Core/Configuration/BranchConfiguration.cs @@ -15,10 +15,10 @@ public BranchConfiguration() public BranchConfiguration(BranchConfiguration branchConfiguration) { VersioningMode = branchConfiguration.VersioningMode; - Tag = branchConfiguration.Tag; + Label = branchConfiguration.Label; Increment = branchConfiguration.Increment; PreventIncrementOfMergedBranchVersion = branchConfiguration.PreventIncrementOfMergedBranchVersion; - TagNumberPattern = branchConfiguration.TagNumberPattern; + LabelNumberPattern = branchConfiguration.LabelNumberPattern; TrackMergeTarget = branchConfiguration.TrackMergeTarget; CommitMessageIncrementing = branchConfiguration.CommitMessageIncrementing; TracksReleaseBranches = branchConfiguration.TracksReleaseBranches; @@ -37,8 +37,8 @@ public BranchConfiguration(BranchConfiguration branchConfiguration) /// /// Special value 'useBranchName' will extract the tag from the branch name /// - [YamlMember(Alias = "tag")] - public string? Tag { get; set; } + [YamlMember(Alias = "label")] + public string? Label { get; set; } [YamlMember(Alias = "increment")] public IncrementStrategy? Increment { get; set; } @@ -52,9 +52,9 @@ public BranchConfiguration Inherit(BranchConfiguration? parentConfig) if (result.Increment is null || result.Increment == IncrementStrategy.Inherit) result.Increment = parentConfig.Increment; result.VersioningMode ??= parentConfig.VersioningMode; - result.Tag ??= parentConfig.Tag; + result.Label ??= parentConfig.Label; result.PreventIncrementOfMergedBranchVersion ??= parentConfig.PreventIncrementOfMergedBranchVersion; - result.TagNumberPattern ??= parentConfig.TagNumberPattern; + result.LabelNumberPattern ??= parentConfig.LabelNumberPattern; result.TrackMergeTarget ??= parentConfig.TrackMergeTarget; result.CommitMessageIncrementing ??= parentConfig.CommitMessageIncrementing; result.Regex ??= parentConfig.Regex; @@ -71,8 +71,8 @@ public BranchConfiguration Inherit(BranchConfiguration? parentConfig) [YamlMember(Alias = "prevent-increment-of-merged-branch-version")] public bool? PreventIncrementOfMergedBranchVersion { get; set; } - [YamlMember(Alias = "tag-number-pattern")] - public string? TagNumberPattern { get; set; } + [YamlMember(Alias = "label-number-pattern")] + public string? LabelNumberPattern { get; set; } [YamlMember(Alias = "track-merge-target")] public bool? TrackMergeTarget { get; set; } @@ -112,10 +112,10 @@ public void MergeTo(BranchConfiguration targetConfig) if (targetConfig == null) throw new ArgumentNullException(nameof(targetConfig)); targetConfig.VersioningMode = VersioningMode ?? targetConfig.VersioningMode; - targetConfig.Tag = Tag ?? targetConfig.Tag; + targetConfig.Label = Label ?? targetConfig.Label; targetConfig.Increment = Increment ?? targetConfig.Increment; targetConfig.PreventIncrementOfMergedBranchVersion = PreventIncrementOfMergedBranchVersion ?? targetConfig.PreventIncrementOfMergedBranchVersion; - targetConfig.TagNumberPattern = TagNumberPattern ?? targetConfig.TagNumberPattern; + targetConfig.LabelNumberPattern = LabelNumberPattern ?? targetConfig.LabelNumberPattern; targetConfig.TrackMergeTarget = TrackMergeTarget ?? targetConfig.TrackMergeTarget; targetConfig.CommitMessageIncrementing = CommitMessageIncrementing ?? targetConfig.CommitMessageIncrementing; targetConfig.Regex = Regex ?? targetConfig.Regex; diff --git a/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs index 333b570c9d..9304f3cf12 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationBuilder.cs @@ -5,7 +5,7 @@ namespace GitVersion.Configuration; public class ConfigurationBuilder { - private const int DefaultTagPreReleaseWeight = 60000; + private const int DefaultLabelPreReleaseWeight = 60000; private readonly List overrides = new(); @@ -40,14 +40,14 @@ private static void ApplyOverrides(GitVersionConfiguration targetConfig, GitVers targetConfig.AssemblyVersioningFormat = overrideConfiguration.AssemblyVersioningFormat ?? targetConfig.AssemblyVersioningFormat; targetConfig.AssemblyFileVersioningFormat = overrideConfiguration.AssemblyFileVersioningFormat ?? targetConfig.AssemblyFileVersioningFormat; targetConfig.VersioningMode = overrideConfiguration.VersioningMode ?? targetConfig.VersioningMode; - targetConfig.TagPrefix = overrideConfiguration.TagPrefix ?? targetConfig.TagPrefix; - targetConfig.ContinuousDeploymentFallbackTag = overrideConfiguration.ContinuousDeploymentFallbackTag ?? targetConfig.ContinuousDeploymentFallbackTag; + targetConfig.LabelPrefix = overrideConfiguration.LabelPrefix ?? targetConfig.LabelPrefix; + targetConfig.ContinuousDeploymentFallbackLabel = overrideConfiguration.ContinuousDeploymentFallbackLabel ?? targetConfig.ContinuousDeploymentFallbackLabel; targetConfig.NextVersion = overrideConfiguration.NextVersion ?? targetConfig.NextVersion; targetConfig.MajorVersionBumpMessage = overrideConfiguration.MajorVersionBumpMessage ?? targetConfig.MajorVersionBumpMessage; targetConfig.MinorVersionBumpMessage = overrideConfiguration.MinorVersionBumpMessage ?? targetConfig.MinorVersionBumpMessage; targetConfig.PatchVersionBumpMessage = overrideConfiguration.PatchVersionBumpMessage ?? targetConfig.PatchVersionBumpMessage; targetConfig.NoBumpMessage = overrideConfiguration.NoBumpMessage ?? targetConfig.NoBumpMessage; - targetConfig.TagPreReleaseWeight = overrideConfiguration.TagPreReleaseWeight ?? targetConfig.TagPreReleaseWeight; + targetConfig.LabelPreReleaseWeight = overrideConfiguration.LabelPreReleaseWeight ?? targetConfig.LabelPreReleaseWeight; targetConfig.CommitMessageIncrementing = overrideConfiguration.CommitMessageIncrementing ?? targetConfig.CommitMessageIncrementing; targetConfig.Increment = overrideConfiguration.Increment ?? targetConfig.Increment; targetConfig.CommitDateFormat = overrideConfiguration.CommitDateFormat ?? targetConfig.CommitDateFormat; @@ -176,9 +176,9 @@ private static GitVersionConfiguration CreateDefaultConfiguration() { AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - TagPrefix = GitVersionConfiguration.DefaultTagPrefix, + LabelPrefix = GitVersionConfiguration.DefaultLabelPrefix, VersioningMode = VersioningMode.ContinuousDelivery, - ContinuousDeploymentFallbackTag = "ci", + ContinuousDeploymentFallbackLabel = "ci", MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern, MinorVersionBumpMessage = IncrementStrategyFinder.DefaultMinorPattern, PatchVersionBumpMessage = IncrementStrategyFinder.DefaultPatchPattern, @@ -187,7 +187,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() CommitDateFormat = "yyyy-MM-dd", UpdateBuildNumber = true, SemanticVersionFormat = SemanticVersionFormat.Strict, - TagPreReleaseWeight = DefaultTagPreReleaseWeight, + LabelPreReleaseWeight = DefaultLabelPreReleaseWeight, Increment = IncrementStrategy.Inherit }; @@ -197,7 +197,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() Increment = IncrementStrategy.Minor, Regex = GitVersionConfiguration.DevelopBranchRegex, SourceBranches = new HashSet(), - Tag = "alpha", + Label = "alpha", PreventIncrementOfMergedBranchVersion = false, TrackMergeTarget = true, TracksReleaseBranches = true, @@ -215,7 +215,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() GitVersionConfiguration.DevelopBranchKey, GitVersionConfiguration.ReleaseBranchKey }, - Tag = string.Empty, + Label = string.Empty, PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, @@ -235,7 +235,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() GitVersionConfiguration.SupportBranchKey, GitVersionConfiguration.ReleaseBranchKey }, - Tag = "beta", + Label = "beta", PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, @@ -257,7 +257,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() GitVersionConfiguration.SupportBranchKey, GitVersionConfiguration.HotfixBranchKey }, - Tag = "{BranchName}", + Label = "{BranchName}", PreReleaseWeight = 30000 }); @@ -274,8 +274,8 @@ private static GitVersionConfiguration CreateDefaultConfiguration() GitVersionConfiguration.SupportBranchKey, GitVersionConfiguration.HotfixBranchKey }, - Tag = "PullRequest", - TagNumberPattern = @"[/-](?\d+)", + Label = "PullRequest", + LabelNumberPattern = @"[/-](?\d+)", PreReleaseWeight = 30000 }); @@ -290,7 +290,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() GitVersionConfiguration.SupportBranchKey, GitVersionConfiguration.HotfixBranchKey }, - Tag = "beta", + Label = "beta", PreReleaseWeight = 30000 }); @@ -300,7 +300,7 @@ private static GitVersionConfiguration CreateDefaultConfiguration() Increment = IncrementStrategy.Patch, Regex = GitVersionConfiguration.SupportBranchRegex, SourceBranches = new HashSet { GitVersionConfiguration.MainBranchKey }, - Tag = string.Empty, + Label = string.Empty, PreventIncrementOfMergedBranchVersion = true, TrackMergeTarget = false, TracksReleaseBranches = false, diff --git a/src/GitVersion.Core/Configuration/ConfigurationExtensions.cs b/src/GitVersion.Core/Configuration/ConfigurationExtensions.cs index afa95e14b1..05647a403c 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationExtensions.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationExtensions.cs @@ -25,7 +25,7 @@ public static BranchConfiguration GetBranchConfiguration(this GitVersionConfigur { Name = "Unknown", Regex = "", - Tag = "{BranchName}", + Label = "{BranchName}", VersioningMode = configuration.VersioningMode, Increment = IncrementStrategy.Inherit }; @@ -37,7 +37,7 @@ public static BranchConfiguration GetFallbackBranchConfiguration(this GitVersion { Name = "Fallback", Regex = "", - Tag = "{BranchName}", + Label = "{BranchName}", VersioningMode = configuration.VersioningMode, Increment = configuration.Increment, PreventIncrementOfMergedBranchVersion = false, @@ -85,7 +85,7 @@ public static BranchConfiguration GetFallbackBranchConfiguration(this GitVersion public static string GetBranchSpecificTag(this EffectiveConfiguration configuration, ILog log, string? branchFriendlyName, string? branchNameOverride) { - var tagToUse = configuration.Tag; + var tagToUse = configuration.Label; if (tagToUse == "useBranchName") { tagToUse = "{BranchName}"; diff --git a/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs b/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs index c809e89b93..96b3168b40 100644 --- a/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs +++ b/src/GitVersion.Core/Configuration/EffectiveConfiguration.cs @@ -31,8 +31,8 @@ public EffectiveConfiguration(GitVersionConfiguration configuration, BranchConfi if (!configuration.CommitMessageIncrementing.HasValue) throw new Exception("Configuration value for 'CommitMessageIncrementing' 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)"); + if (!configuration.LabelPreReleaseWeight.HasValue) + throw new Exception("Configuration value for 'LabelPreReleaseWeight' has no value. (this should not happen, please report an issue)"); AssemblyVersioningScheme = configuration.AssemblyVersioningScheme.Value; AssemblyFileVersioningScheme = configuration.AssemblyFileVersioningScheme.Value; @@ -40,14 +40,14 @@ public EffectiveConfiguration(GitVersionConfiguration configuration, BranchConfi AssemblyVersioningFormat = configuration.AssemblyVersioningFormat; AssemblyFileVersioningFormat = configuration.AssemblyFileVersioningFormat; VersioningMode = currentBranchConfig.VersioningMode.Value; - TagPrefix = configuration.TagPrefix; - Tag = currentBranchConfig.Tag ?? string.Empty; + LabelPrefix = configuration.LabelPrefix; + Label = currentBranchConfig.Label ?? string.Empty; NextVersion = configuration.NextVersion; Increment = currentBranchConfig.Increment.Value; BranchPrefixToTrim = currentBranchConfig.Regex; PreventIncrementOfMergedBranchVersion = currentBranchConfig.PreventIncrementOfMergedBranchVersion ?? false; - TagNumberPattern = currentBranchConfig.TagNumberPattern; - ContinuousDeploymentFallbackTag = configuration.ContinuousDeploymentFallbackTag; + LabelNumberPattern = currentBranchConfig.LabelNumberPattern; + ContinuousDeploymentFallbackLabel = configuration.ContinuousDeploymentFallbackLabel; TrackMergeTarget = currentBranchConfig.TrackMergeTarget ?? false; MajorVersionBumpMessage = configuration.MajorVersionBumpMessage; MinorVersionBumpMessage = configuration.MinorVersionBumpMessage; @@ -62,7 +62,7 @@ public EffectiveConfiguration(GitVersionConfiguration configuration, BranchConfi UpdateBuildNumber = configuration.UpdateBuildNumber ?? true; SemanticVersionFormat = configuration.SemanticVersionFormat; PreReleaseWeight = currentBranchConfig.PreReleaseWeight ?? 0; - TagPreReleaseWeight = configuration.TagPreReleaseWeight.Value; + LabelPreReleaseWeight = configuration.LabelPreReleaseWeight.Value; } protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningScheme, @@ -71,14 +71,14 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche string? assemblyVersioningFormat, string? assemblyFileVersioningFormat, VersioningMode versioningMode, - string? tagPrefix, - string tag, + string? labelPrefix, + string label, string? nextVersion, IncrementStrategy increment, string? branchPrefixToTrim, bool preventIncrementOfMergedBranchVersion, - string? tagNumberPattern, - string? continuousDeploymentFallbackTag, + string? labelNumberPattern, + string? continuousDeploymentFallbackLabel, bool trackMergeTarget, string? majorVersionBumpMessage, string? minorVersionBumpMessage, @@ -93,7 +93,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche bool updateBuildNumber, SemanticVersionFormat semanticVersionFormat, int preReleaseWeight, - int tagPreReleaseWeight) + int labelPreReleaseWeight) { AssemblyVersioningScheme = assemblyVersioningScheme; AssemblyFileVersioningScheme = assemblyFileVersioningScheme; @@ -101,14 +101,14 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche AssemblyVersioningFormat = assemblyVersioningFormat; AssemblyFileVersioningFormat = assemblyFileVersioningFormat; VersioningMode = versioningMode; - TagPrefix = tagPrefix; - Tag = tag; + LabelPrefix = labelPrefix; + Label = label; NextVersion = nextVersion; Increment = increment; BranchPrefixToTrim = branchPrefixToTrim; PreventIncrementOfMergedBranchVersion = preventIncrementOfMergedBranchVersion; - TagNumberPattern = tagNumberPattern; - ContinuousDeploymentFallbackTag = continuousDeploymentFallbackTag; + LabelNumberPattern = labelNumberPattern; + ContinuousDeploymentFallbackLabel = continuousDeploymentFallbackLabel; TrackMergeTarget = trackMergeTarget; MajorVersionBumpMessage = majorVersionBumpMessage; MinorVersionBumpMessage = minorVersionBumpMessage; @@ -123,7 +123,7 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche UpdateBuildNumber = updateBuildNumber; SemanticVersionFormat = semanticVersionFormat; PreReleaseWeight = preReleaseWeight; - TagPreReleaseWeight = tagPreReleaseWeight; + LabelPreReleaseWeight = labelPreReleaseWeight; } public bool TracksReleaseBranches { get; } @@ -139,12 +139,12 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche /// /// Git tag prefix /// - public string? TagPrefix { get; } + public string? LabelPrefix { get; } /// - /// Tag to use when calculating SemVer + /// Label to use when calculating SemVer /// - public string Tag { get; } + public string Label { get; } public string? NextVersion { get; } @@ -154,9 +154,9 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche public bool PreventIncrementOfMergedBranchVersion { get; } - public string? TagNumberPattern { get; } + public string? LabelNumberPattern { get; } - public string? ContinuousDeploymentFallbackTag { get; } + public string? ContinuousDeploymentFallbackLabel { get; } public bool TrackMergeTarget { get; } @@ -180,5 +180,5 @@ protected EffectiveConfiguration(AssemblyVersioningScheme assemblyVersioningSche public int PreReleaseWeight { get; } - public int TagPreReleaseWeight { get; } + public int LabelPreReleaseWeight { get; } } diff --git a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs index 3db85ce0f5..0dfa39cca9 100644 --- a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs +++ b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs @@ -33,11 +33,11 @@ public GitVersionConfiguration() [YamlMember(Alias = "mode")] public VersioningMode? VersioningMode { get; set; } - [YamlMember(Alias = "tag-prefix")] - public string? TagPrefix { get; set; } + [YamlMember(Alias = "label-prefix")] + public string? LabelPrefix { get; set; } - [YamlMember(Alias = "continuous-delivery-fallback-tag")] - public string? ContinuousDeploymentFallbackTag { get; set; } + [YamlMember(Alias = "continuous-delivery-fallback-label")] + public string? ContinuousDeploymentFallbackLabel { get; set; } [YamlMember(Alias = "next-version")] public string? NextVersion @@ -61,8 +61,8 @@ public string? NextVersion [YamlMember(Alias = "no-bump-message")] public string? NoBumpMessage { get; set; } - [YamlMember(Alias = "tag-pre-release-weight")] - public int? TagPreReleaseWeight { get; set; } + [YamlMember(Alias = "label-pre-release-weight")] + public int? LabelPreReleaseWeight { get; set; } [YamlMember(Alias = "commit-message-incrementing")] public CommitMessageIncrementMode? CommitMessageIncrementing { get; set; } @@ -97,7 +97,7 @@ public override string ToString() return stringBuilder.ToString(); } - public const string DefaultTagPrefix = "[vV]?"; + public const string DefaultLabelPrefix = "[vV]?"; public const string ReleaseBranchRegex = "^releases?[/-]"; public const string FeatureBranchRegex = "^features?[/-]"; public const string PullRequestRegex = @"^(pull|pull\-requests|pr)[/-]"; diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs index a7f14c73b4..89accd9510 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs @@ -40,7 +40,7 @@ protected override StepResult HandleResult(string? result, Queue $@"What would you like to change for '{this.name}': 0) Go Back -1) Branch Pr-release tag (Current: {this.branchConfiguration.Tag}) +1) Branch Pr-release tag (Current: {this.branchConfiguration.Label}) 2) Branch Increment mode (per commit/after tag) (Current: {this.branchConfiguration.VersioningMode})"; protected override string DefaultResult => "0"; diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs index 3713082e9a..4aacf2ac83 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs @@ -34,11 +34,11 @@ protected override StepResult HandleResult(string? result, Queue GetBaseVersions(EffectiveBranchConfigur var nextVersion = Context.Configuration.NextVersion; if (!nextVersion.IsNullOrEmpty() && !Context.IsCurrentCommitTagged) { - var semanticVersion = SemanticVersion.Parse(nextVersion, Context.Configuration.TagPrefix); + var semanticVersion = SemanticVersion.Parse(nextVersion, Context.Configuration.LabelPrefix); 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 1f9c5d0a14..cf19efda8a 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs @@ -23,7 +23,7 @@ internal IEnumerable GetTaggedVersions(IBranch currentBranch, DateT { if (currentBranch is null) return Enumerable.Empty(); - var versionTags = this.repositoryStore.GetValidVersionTags(Context.Configuration.TagPrefix, olderThan); + var versionTags = this.repositoryStore.GetValidVersionTags(Context.Configuration.LabelPrefix, olderThan); var versionTagsByCommit = versionTags.ToLookup(vt => vt.Item3.Id.Sha); var commitsOnBranch = currentBranch.Commits; if (commitsOnBranch == null) diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs index 5b812a4f05..f6d9f920e6 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs @@ -21,7 +21,7 @@ public override IEnumerable GetBaseVersions(EffectiveBranchConfigur string nameWithoutOrigin = NameWithoutOrigin(configuration.Branch); if (Context.Configuration.IsReleaseBranch(nameWithoutOrigin)) { - var versionInBranch = GetVersionInBranch(configuration.Branch.Name.Friendly, Context.Configuration.TagPrefix); + var versionInBranch = GetVersionInBranch(configuration.Branch.Name.Friendly, Context.Configuration.LabelPrefix); if (versionInBranch != null) { var commitBranchWasBranchedFrom = this.repositoryStore.FindCommitBranchWasBranchedFrom(configuration.Branch, Context.Configuration); diff --git a/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs index ba126d2e1c..707c7ba3c5 100644 --- a/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs +++ b/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs @@ -85,7 +85,7 @@ public virtual NextVersion FindVersion() } var hasPreReleaseTag = semver.HasPreReleaseTagWithLabel; - var tag = nextVersion.Configuration.Tag; + var tag = nextVersion.Configuration.Label; var branchConfigHasPreReleaseTagConfigured = !tag.IsNullOrEmpty(); var preReleaseTagDoesNotMatchConfiguration = hasPreReleaseTag && branchConfigHasPreReleaseTagConfigured && semver.PreReleaseTag?.Name != tag; if (semver.PreReleaseTag?.HasTag() != true && branchConfigHasPreReleaseTagConfigured || preReleaseTagDoesNotMatchConfiguration) @@ -118,7 +118,7 @@ private void UpdatePreReleaseTag(EffectiveBranchConfiguration configuration, Sem // TODO: Please update the pre release-tag in the IVersionStrategy implementation. var lastTag = this.repositoryStore - .GetVersionTagsOnBranch(Context.CurrentBranch, Context.Configuration.TagPrefix) + .GetVersionTagsOnBranch(Context.CurrentBranch, Context.Configuration.LabelPrefix) .FirstOrDefault(v => v.PreReleaseTag?.Name?.IsEquivalentTo(tagToUse) == true); if (lastTag != null && MajorMinorPatchEqual(lastTag, semanticVersion) && lastTag.HasPreReleaseTagWithLabel) diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs index 745daab0ef..f6385088c6 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() == true ? (this.semver.PreReleaseTag.Number + this.configuration.PreReleaseWeight).ToString() : null; return weightedPreReleaseNumber.IsNullOrEmpty() - ? $"{this.configuration.TagPreReleaseWeight}" + ? $"{this.configuration.LabelPreReleaseWeight}" : weightedPreReleaseNumber; } } diff --git a/src/GitVersion.Core/VersionCalculation/VariableProvider.cs b/src/GitVersion.Core/VersionCalculation/VariableProvider.cs index dcfb7b73c4..b7e645501d 100644 --- a/src/GitVersion.Core/VersionCalculation/VariableProvider.cs +++ b/src/GitVersion.Core/VersionCalculation/VariableProvider.cs @@ -32,18 +32,18 @@ public VersionVariables GetVariablesFor(SemanticVersion semanticVersion, Effecti { // TODO: Why do we manipulating the semantic version here in the VariableProvider? The method name is GET not MANIPULATE. // What is about the separation of concern and single-responsibility principle? - semanticVersion.PreReleaseTag.Name = configuration.ContinuousDeploymentFallbackTag; + semanticVersion.PreReleaseTag.Name = configuration.ContinuousDeploymentFallbackLabel; } } } // Evaluate tag number pattern and append to prerelease tag, preserving build metadata - var appendTagNumberPattern = !configuration.TagNumberPattern.IsNullOrEmpty() && semanticVersion.PreReleaseTag?.HasTag() == true; + var appendTagNumberPattern = !configuration.LabelNumberPattern.IsNullOrEmpty() && semanticVersion.PreReleaseTag?.HasTag() == true; if (appendTagNumberPattern) { - if (semanticVersion.BuildMetaData?.Branch != null && configuration.TagNumberPattern != null) + if (semanticVersion.BuildMetaData?.Branch != null && configuration.LabelNumberPattern != null) { - var match = Regex.Match(semanticVersion.BuildMetaData.Branch, configuration.TagNumberPattern); + var match = Regex.Match(semanticVersion.BuildMetaData.Branch, configuration.LabelNumberPattern); var numberGroup = match.Groups["number"]; if (numberGroup.Success && semanticVersion.PreReleaseTag != null) {