Expose VersionSourceIncrement property in output variables#4815
Closed
Expose VersionSourceIncrement property in output variables#4815
Conversation
Copilot
AI
changed the title
[WIP] Expose VersionSourceIncrement property in output variables
Expose VersionSourceIncrement property in output variables
Feb 10, 2026
Copilot
AI
changed the title
Expose VersionSourceIncrement property in output variables
Expose Feb 10, 2026
VersionSourceIncrement property in output variables
Copilot
AI
changed the title
Expose
Expose VersionSourceIncrement property in output variables
Feb 10, 2026
VersionSourceIncrement property in output variables4824bfc to
1947b91
Compare
arturcic
approved these changes
Feb 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new VersionSourceIncrement output variable to GitVersion so consumers can see which increment strategy (None, Patch, Minor, Major) was used during next-version calculation, and threads it through JSON/MSBuild output + docs + snapshots.
Changes:
- Propagates
VersionSourceIncrementfrom version calculation (NextVersionCalculator) through format values/variable provider intoGitVersionVariables. - Exposes the variable via JSON output model and MSBuild task/targets integration.
- Updates docs and approved snapshot outputs to include the new variable.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/GitVersion.Core/SemVer/SemanticVersionBuildMetaData.cs | Adds VersionSourceIncrement to build metadata + copy ctor propagation. |
| src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs | Extracts increment strategy from base version and attaches it to final build metadata. |
| src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersionFormatValues.cs | Exposes VersionSourceIncrement as a formatted value. |
| src/GitVersion.Core/VersionCalculation/VariableProvider.cs | Threads the new formatted value into GitVersionVariables. |
| src/GitVersion.Core/OutputVariables/GitVersionVariables.cs | Adds VersionSourceIncrement variable (but also changes record primary ctor ordering). |
| src/GitVersion.Output/Serializer/VersionVariablesJsonModel.cs | Adds VersionSourceIncrement to JSON model for serialized output. |
| src/GitVersion.MsBuild/Tasks/GetVersion.cs | Adds MSBuild task output property VersionSourceIncrement. |
| src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets | Binds the new output to MSBuild properties/WiX constants (contains a define-constant typo). |
| src/GitVersion.Core/PublicAPI.Unshipped.txt | Records new public API surface for core outputs/format values/build metadata. |
| src/GitVersion.MsBuild/PublicAPI.Unshipped.txt | Records new public API surface for MSBuild task output. |
| src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs | Updates version-cache JSON test content to include new field. |
| src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs | Updates test helper to include new variable in construction. |
| src/GitVersion.Core.Tests/VersionCalculation/Approved/*.approved.txt | Updates approved JSON snapshots to include VersionSourceIncrement. |
| src/GitVersion.Output.Tests/Output/Approved/cs/*.approved.txt | Updates approved C# GitVersionInfo output snapshots. |
| src/GitVersion.Output.Tests/Output/Approved/fs/*.approved.txt | Updates approved F# GitVersionInfo output snapshots. |
| src/GitVersion.Output.Tests/Output/Approved/vb/*.approved.txt | Updates approved VB GitVersionInfo output snapshots. |
| src/GitVersion.Output.Tests/Output/Approved/WixFileTests.*.approved.txt | Updates approved WiX defines snapshots. |
| docs/input/docs/reference/variables.md | Documents the new output variable and updates JSON example/table. |
| docs/input/docs/reference/version-increments.md | Updates conventional-commits reference link. |
| docs/input/docs/reference/configuration.md | Updates conventional-commits reference link. |
| docs/input/docs/reference/mdsource/configuration.source.md | Updates conventional-commits reference link. |
| docs/input/docs/reference/build-servers/teamcity.md | Removes a “Guides” link section. |
| build/common/Utilities/Models.cs | Adjusts build-metadata null handling in build utilities. |
| build/common/Addins/GitVersion/GitVersionAliases.cs | Minor alias API/documentation tweak. |
| build/common/Addins/GitVersion/GitVersion.cs | Updates build addin GitVersion model to include new output + refreshed docs/types. |
src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets
Outdated
Show resolved
Hide resolved
81b061b to
01a7409
Compare
228fc32 to
b9dd9ea
Compare
arturcic
reviewed
Feb 10, 2026
src/GitVersion.Core/VersionCalculation/VersionCalculators/NextVersionCalculator.cs
Show resolved
Hide resolved
Member
|
@HHobeck please have a look on the changes Copilot did and please make sure the GitVersion variable is properly set |
This was referenced Feb 17, 2026
This was referenced Feb 26, 2026
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.
Adds
VersionSourceIncrementto GitVersion output variables, exposing which increment strategy (None,Patch,Minor,Major) was used for the next version calculation.Core pipeline
VersionSourceIncrement(VersionField) toSemanticVersionBuildMetaData, propagated through copy constructorNextVersionCalculator.FindVersion()extracts increment fromBaseVersion.Operator.Incrementand sets it on finalBuildMetaDataSemanticVersionFormatValues→VariableProvider→GitVersionVariablesOutput & serialization
VersionVariablesJsonModelwithJsonPropertyDescriptionVersionVariableSerializer.FromDictionaryto useSingleOrDefaultinstead ofSinglefor backward compatibility with cached JSON missing new fieldsMSBuild integration
[Output] VersionSourceIncrementtoGetVersiontaskDefineConstantsentry in.targetsDocs & API surface
variables.mdwith JSON example and description table entryPublicAPI.Unshipped.txtfor bothGitVersion.CoreandGitVersion.MsBuildTest updates
VersionSourceIncrementtoversionCacheFileContentinGitVersionExecutorTests{ "Major": 3, "Minor": 22, "Patch": 11, "VersionSourceIncrement": "Minor", "SemVer": "3.22.11-beta.99" }Original prompt
VersionSourceIncrementproperty in output variables #4814💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.