Skip to content

Fix GitVersion 6.0 configuration compatibility and enable dynamic versioning#49

Merged
maximilien-noal merged 3 commits intomainfrom
copilot/fix-gitversion-output-json
Nov 10, 2025
Merged

Fix GitVersion 6.0 configuration compatibility and enable dynamic versioning#49
maximilien-noal merged 3 commits intomainfrom
copilot/fix-gitversion-output-json

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 10, 2025

Description of Changes

GitVersion 6.0 introduced breaking changes in configuration property names. The existing configuration used deprecated properties causing parsing errors and preventing JSON output. Additionally, hardcoded version properties in the project file prevented GitVersion from injecting calculated versions during CI/CD builds.

GitVersion.yml updates:

  • taglabel (all branch configurations)
  • tag-number-patternlabel-number-pattern (pull-request branch)
  • prevent-increment-of-merged-branch-versionprevent-increment: { of-merged-branch: true/false } (main, develop, release branches)

Cryogenic.csproj updates:

  • Made version properties conditional to allow override via MSBuild properties:
    <Version Condition="'$(Version)' == ''">0.1.0</Version>
    <AssemblyVersion Condition="'$(AssemblyVersion)' == ''">0.1.0.0</AssemblyVersion>

Rationale behind Changes

GitVersion 6.0.5 fails to parse configurations using pre-6.0 property names, causing CI/CD pipelines to fail with "Property 'tag' not found" errors. Hardcoded version properties prevented the /p:Version= parameters in workflow builds from taking effect, defeating the purpose of GitVersion integration.

Suggested Testing Steps

  1. Verify GitVersion produces valid JSON: dotnet-gitversion /output json | jq .
  2. Verify configuration parses: dotnet-gitversion /showconfig
  3. Test local build uses fallback: dotnet build (should show version 0.1.0)
  4. Test version override: dotnet build /p:Version=1.2.3 (should show version 1.2.3 in assembly)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.1/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Command: /opt/hostedtoolcache/GitVersion.Tool/6.0.5/dotnet-gitversion /home/runner/work/Cryogenic/Cryogenic /output json /l console /config GitVersion.yml

the output of git version is not valid json.

cryogenic project file probably doesn't define a version


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 10, 2025 20:23
Co-authored-by: maximilien-noal <1087524+maximilien-noal@users.noreply.github.com>
Co-authored-by: maximilien-noal <1087524+maximilien-noal@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitVersion output to valid JSON Fix GitVersion 6.0 configuration compatibility and enable dynamic versioning Nov 10, 2025
@maximilien-noal maximilien-noal marked this pull request as ready for review November 10, 2025 20:37
@maximilien-noal maximilien-noal merged commit fcb1d4d into main Nov 10, 2025
6 checks passed
@maximilien-noal maximilien-noal deleted the copilot/fix-gitversion-output-json branch April 4, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants