Add CustomVersion output variable - #5098
Open
arturcic wants to merge 3 commits into
Open
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Adds a configurable
CustomVersionoutput variable controlled bycustom-version-format. The format supports the existing version-variable and environment-variable formatters and defaults to{SemVer}without changing the semantics of existing outputs.The value is available in JSON output, generated version files, WiX output, and the MSBuild
GetVersiontask. Configuration, CLI override, output approvals, documentation, and generated schemas are updated as well.Related Issue
Closes #1674
Closes #2065
Closes #3340
Closes #4659
Supersedes the implementation attempted in #4659 and follows the design described in discussion #4272.
Motivation and Context
Consumers sometimes need a version format with semantics different from GitVersion's standard outputs. Examples covered by this change include:
0.6.3beta10.0001000.For #1674, separators in a branch-derived label can be removed with the PascalCase formatter:
When the exact replacement must be controlled—for example, preserving
JIRA.123instead of reducingJIRA-123toJira123—replace{PreReleaseLabel:c}with an environment variable containing the desired RPM-safe label:How Has This Been Tested?
dotnet build ./src/GitVersion.slnx --no-restoredotnet test --project ./src/GitVersion.Configuration.Tests/GitVersion.Configuration.Tests.csproj --no-restore— 97 passeddotnet test --project ./src/GitVersion.Output.Tests/GitVersion.Output.Tests.csproj --no-restore— 123 passeddotnet test --project ./src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj --no-restore— 151 passeddotnet format ./src/GitVersion.slnx --verify-no-changes --no-restoreA broader Core test run reached an unrelated timing-sensitive failure in
PerformanceScenarios.RepositoryWithALotOfTags(3518 ms versus the 2500 ms threshold); all CustomVersion-related tests pass.Checklist