Skip to content

Rename back "tag-pre-release-weight" and "tag-prefix" #3481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 5 additions & 5 deletions docs/input/docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: (?<version>[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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions docs/input/docs/usage/cli/arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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'

Expand All @@ -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'

Expand Down
4 changes: 2 additions & 2 deletions docs/input/docs/usage/cli/assembly-patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 11 additions & 11 deletions schemas/6.0/GitVersion.configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
26 changes: 13 additions & 13 deletions src/GitVersion.App.Tests/ArgumentParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ public string OverrideconfigWithInvalidOption(string options)

private static IEnumerable<TestCaseData> 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")
{
Expand Down Expand Up @@ -448,10 +448,10 @@ private static IEnumerable<TestCaseData> OverrideConfigWithSingleOptionTestData(
}
);
yield return new TestCaseData(
"label-prefix=sample",
"tag-prefix=sample",
new GitVersionConfiguration
{
LabelPrefix = "sample"
TagPrefix = "sample"
}
);
yield return new TestCaseData(
Expand Down Expand Up @@ -497,10 +497,10 @@ private static IEnumerable<TestCaseData> 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(
Expand Down Expand Up @@ -544,31 +544,31 @@ public void OverrideConfigWithMultipleOptions(string options, IGitVersionConfigu
private static IEnumerable<TestCaseData> 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
}
);
}
Expand Down
24 changes: 12 additions & 12 deletions src/GitVersion.App.Tests/QuotedStringHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,52 +26,52 @@ private static IEnumerable<TestCaseData> 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}\""
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
label-prefix: '[vV]?'
tag-prefix: '[vV]?'
version-in-branch-pattern: (?<version>[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
Expand Down
Loading