Repository navigation
breaking: move the GitVersion providers to GitVersion 7 - #420
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approved
No active review issues remain for the GitVersion 7.0.1 upgrade.
No open issues 🎉
What changed in this PR
Updates Atom’s GitVersion providers to GitVersion 7.0.1, addressing #412 while retaining the version-aware cache introduced in #418. This is a breaking upgrade for consumers using GitVersion 6 configuration files.
Changes:
- Updates both providers to GitVersion 7 arguments and output names, with telemetry disabled.
- Migrates the repository configuration and documents consumer migration steps.
- Adds four provider tests and integrates them into the solution, test targets, and generated workflows.
| File | Description |
|---|---|
tests/Invex.Atom.Module.GitVersion.Tests/Invex.Atom.Module.GitVersion.Tests.csproj |
Adds a GitVersion test project targeting .NET 10 and 11. |
tests/Invex.Atom.Module.GitVersion.Tests/GitVersionProviderTests.cs |
Tests version parsing, build IDs, tool invocation, and cache reuse. |
tests/Invex.Atom.Module.GitVersion.Tests/_usings.cs |
Defines global imports for the new tests. |
src/Invex.Atom.Module.GitVersion/Providers/GitVersionTool.cs |
Pins 7.0.1 and centralizes arguments with telemetry opt-out. |
src/Invex.Atom.Module.GitVersion/Providers/GitVersionBuildVersionProvider.cs |
Uses the shared arguments and reads PreReleaseLabel. |
src/Invex.Atom.Module.GitVersion/Providers/GitVersionBuildIdProvider.cs |
Uses the shared GitVersion 7 arguments. |
src/Invex.Atom.Module.GitVersion/Invex.Atom.Module.GitVersion.csproj |
Grants the test project access to internal members. |
Invex.Atom.slnx |
Registers the GitVersion test project. |
GitVersion.yml |
Migrates settings into calculation and output sections. |
docs/modules/git-version.md |
Documents the new pin, telemetry opt-out, and migration requirements. |
.github/workflows/Build.yml |
Adds upload and retrieval steps for GitVersion test artifacts. |
.devops/workflows/Test_Devops_Build.yml |
Adds publication of GitVersion test artifacts. |
_atom/Targets/ITestTargets.cs |
Includes GitVersion tests in the repository’s test target. |
Review effort: Balanced
Pin GitVersion.Tool to 7.0.1 and update the providers for GitVersion 7's
breaking changes:
- Run `dotnet gitversion --output json`; v7 no longer accepts the
`/output json` syntax.
- Read the pre-release from `PreReleaseLabel`; v7 renamed `PreReleaseTag`
to `PreReleaseLabel`, and the old `PreReleaseLabel` (the label without
the number) to `PreReleaseLabelName`.
The GitVersion cache key already includes the tool version, so output
cached by GitVersion 6 is not reused.
Migrate this repository's GitVersion.yml to the v7 `calculation:` /
`output:` layout and the renamed `{PreReleaseLabelWithDash}` variable.
The resulting versions are unchanged for main, patch, develop, feature,
pull request, other and tagged builds.
Add Invex.Atom.Module.GitVersion.Tests covering the pinned version, the
v7 arguments and variables, and cache reuse.
BREAKING CHANGE: builds using IGitVersion now run GitVersion 7, which
rejects the GitVersion 6 configuration layout. Migrate GitVersion.yml with
`dotnet gitversion config migrate --in-place` and rename
`PreReleaseTag*` variables in format strings to `PreReleaseLabel*`.
Closes #412
GitVersion 7 sends sampled CLI usage telemetry by default. Atom runs it on behalf of builds that never chose to run GitVersion directly, so pass `--telemetry-opt-out`. This also suppresses the telemetry notice that GitVersion writes to standard error, which Atom surfaced as a warning on every fresh machine, and the network request a sampled run waits on before calculating the version.
DecSmith42
force-pushed
the
feature/gh-412-gitversion-7
branch
from
December 1, 2026 03:25
d3706f2 to
017ab8d
Compare
DecSmith42
marked this pull request as ready for review
December 1, 2026 03:31
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.
Closes #412. Replaces #414 (closed): the same GitVersion 7 upgrade, redone on the current
main. Since #414, #418 already added the tool version to the cache key, so that part of #414 is no longer needed here.Summary
#413 pinned
GitVersion.Toolto 6.8.2 as a hotfix. This PR moves the pin to 7.0.1 and updates the providers for GitVersion 7's breaking changes:dotnet gitversion /output json/-style arguments rejected:Could not parse command line parameter '/output'.dotnet gitversion --output json(GitVersionTool.OutputJsonArguments)PreReleaseTag=beta.x.4PreReleaseLabelGitVersionBuildVersionProviderreadsPreReleaseLabelPreReleaseLabel=beta.xPreReleaseLabelNameGitVersion.ymlcalculation:/output:sectionsGitVersion.ymlis migrated7.0.1 only adds one fix on top of 7.0.0, for the TrunkBased workflow with
ignore.paths.Cache. No change is needed: since #418,
GitVersionCacheKeyincludesGitVersionTool.Versionand a hash ofGitVersion.yml. Raising the pin invalidates any cache entry written by GitVersion 6, wherePreReleaseLabelmeant something different.Commits
breaking: move the GitVersion providers to GitVersion 7GitVersion.ymlby hand, keeping its comments.gitversion config migratedrops comments and leaves the old{PreReleaseTagWithDash}variable in place.Invex.Atom.Module.GitVersion.Testsproject with 4 tests: the pinned version and arguments,PreReleaseLabelparsing,FullSemVeras the build ID, and cache reuse. It's registered inInvex.Atom.slnxandITestTargets, and the workflows are regenerated withatom gen.docs/modules/git-version.mdwith migration guidance.feat: opt out of GitVersion telemetry--telemetry-opt-out. GitVersion 7 sends sampled usage telemetry by default, and Atom runs it for builds that never chose to run GitVersion directly.WRNline in every build. It also skips the HTTP request (up to 1 s) that a sampled run waits on before calculating the version.Breaking change for consumers
Builds using
IGitVersionnow run GitVersion 7, which rejects the GitVersion 6 config layout:The configuration file uses the legacy v6 configuration structure ... Run 'gitversion config migrate'. Consumers must rundotnet gitversion config migrate --in-placeand rename anyPreReleaseTag*format variables toPreReleaseLabel*. Thebreaking:commit bumps the major version: this branch calculates6.0.0-beta…. If you'd rather ship it as a minor or patch, the commit message needs rewording before merge.Testing
dotnet build Invex.Atom.slnx: 0 warnings, 0 errors.dotnet test Invex.Atom.slnx: all passing onnet10.0andnet11.0, including the new GitVersion tests.dotnet run --project _atom -- SetupBuildInfowith GitVersion 6.8.2 installed globally. The tool upgraded to 7.0.1, and Build ID and Build Version were5.4.0-beta.feature-gh-412-gitversion-7.7before thebreaking:commit. With the opt-out in place, starting from no saved telemetry state, there was no telemetry warning and GitVersion wrote no telemetry state file.--telemetry-opt-out. 7.0.1 printedGitVersion may send sampled CLI usage data to PostHog Cloud…on stderr on the first run. The JSON output was the same with and without the flag.main,patch/*,develop,feat/*,fix/*,pr/*, other branches and a tag. Every version matched.GitVersion.ymlhasn't changed onmainsince then.Other GitVersion 7 options considered (not included)
$schemacomment inGitVersion.yml. SchemaStore already mapsGitVersion.ymlto the 7.0 schema by default, so VS Code's YAML extension and Rider validate the migrated file without it.gitversion config validate. It exits 1 on an invalid config and can report JSON diagnostics. It could become a CI or pre-flight step, but a normal run already fails with a clear message on a bad config.--no-fetch,--no-normalize,--no-cache. These change how versions are calculated or cached on build servers, so I left GitVersion's defaults alone.{ShortSha},{env:VAR ?? "fallback"}) and=semver: none|patch|minor|majorcommit messages. These are available if you want them, but the current branch labels and bump messages don't need them.Generated by Claude Code