-
Notifications
You must be signed in to change notification settings - Fork 657
Introduce CustomVersion
variable
#4659
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new CustomVersion
output variable and associated custom-version-format
configuration option to provide users with a customizable version string that doesn't affect existing semantics. This addresses compatibility issues with tools like NuGet that don't fully follow semantic versioning rules.
Key changes:
- Added
CustomVersion
property toGitVersionVariables
with configurable formatting - Introduced
custom-version-format
configuration option with default value{SemVer}
- Updated test outputs and documentation to include the new variable
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/GitVersion.Core/OutputVariables/GitVersionVariables.cs | Added CustomVersion property to the record and included it in property collections |
src/GitVersion.Core/Configuration/IGitVersionConfiguration.cs | Added CustomVersionFormat property to configuration interface |
src/GitVersion.Configuration/GitVersionConfiguration.cs | Implemented CustomVersionFormat configuration property with JSON serialization attributes |
src/GitVersion.Core/VersionCalculation/VariableProvider.cs | Added logic to format and provide CustomVersion variable |
docs/input/docs/reference/variables.md | Updated documentation to include CustomVersion variable description |
schemas/6.4/GitVersion.configuration.json | Added custom-version-format to configuration schema |
Various test files | Updated approved test outputs to include CustomVersion in generated code |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1. `patch-version-bump-message` | ||
1. `tag-prefix` | ||
1. `tag-pre-release-weight` | ||
1. `update-build-number` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The numbered list has been changed from sequential numbering (2, 3, 4, etc.) to all items being numbered '1'. This makes the list harder to reference and appears to be an unintended formatting change.
1. `update-build-number` | |
2. `assembly-file-versioning-scheme` | |
3. `assembly-informational-format` | |
4. `assembly-versioning-format` | |
5. `assembly-versioning-scheme` | |
6. `commit-date-format` | |
7. `commit-message-incrementing` | |
8. `custom-version-format` | |
9. `label` | |
10. `increment` | |
11. `major-version-bump-message` | |
12. `minor-version-bump-message` | |
13. `mode` | |
14. `next-version` | |
15. `no-bump-message` | |
16. `patch-version-bump-message` | |
17. `tag-prefix` | |
18. `tag-pre-release-weight` | |
19. `update-build-number` |
Copilot uses AI. Check for mistakes.
|
@arturcic Why did you revert the doc change on my branch? Also, confused as to why some of the App tests are failing e.g. Is there another mechanism other than |
One other question is whether the changes should be under the 6.4 schema or be bumped to a 6.5 schema? |
The schema is updated as part of the release |
That's not me who updated, but of you want to change the configuration.md you need to update mdsource instead |
Introduces a new output variable
CustomVersion
and an associated formatting variablecustom-version-format
Description
Intent is to allow the user to define an output variable without changing the semantics of existing ones. This can then be used to resolve issues such as providing an appropriate version to tools such as NuGet which do not fully followed semantic versioning rules.
Related Issue
Motivation and Context
See above
How Has This Been Tested?
Additional tests in
ConfigurationProviderTest
for custom-version-format and updated test outputs elsewhere to alignChecklist: