Repository navigation
breaking: move the GitVersion providers to GitVersion 7 - #414
Draft
DecSmith42 wants to merge 2 commits into
Draft
DecSmith42 wants to merge 2 commits into
DecSmith42 wants to merge 2 commits into
Conversation
Pin GitVersion.Tool to 7.0.0 and update the providers for its 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`.
- Include the tool version in the GitVersion output cache key, so output
cached by GitVersion 6 (where `PreReleaseLabel` means something else)
is never 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 invalidation.
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NmBdNrhc5dVcJV7JXypNEJ
This branch has not been deployed
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. Follows #413 (merged), which pinned GitVersion 6.8.2 as a hotfix.
Summary
#413 pins the tool and makes
IDotnetToolInstallHelperallow downgrades. This PR moves that pin to GitVersion.Tool 7.0.0 and updates the providers for v7'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 migratedWhy the cache key changed.
.gitversioncachewas keyed only by the Git hash. Output cached by v6 on the same commit would have been reused, and v6'sPreReleaseLabellacks the pre-release number. The version would have dropped the.Nsuffix with no error. The key is now<tool version>:<git hash>, so any existing cache entry is a miss and gets overwritten.Changes
GitVersionTool.Versionis7.0.0, andOutputJsonArgumentsisgitversion --output json. Both providers use them, and the version provider readsPreReleaseLabel.GitVersionCachekeys entries by tool version and Git hash.GitVersion.yml. Restructured intocalculation:andoutput:, with{PreReleaseTagWithDash}renamed to{PreReleaseLabelWithDash}. I did it by hand rather than keeping the output ofgitversion config migrate, because the migration drops the file's comments.Invex.Atom.Module.GitVersion.Testsproject with 5 tests: the pinned version, the v7 arguments,PreReleaseLabelparsing,FullSemVeras the build ID, cache reuse, and ignoring v6-format cache entries. It's registered inInvex.Atom.slnxandITestTargets, and.github/workflows/Build.ymland.devops/workflows/Test_Devops_Build.ymlare regenerated withatom gen.docs/modules/git-version.mdgives the pinned version and how to migrate a v6 config.Breaking change for consumers
Builds using
IGitVersionnow run GitVersion 7, which rejects the GitVersion 6 config layout with: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*. The commit uses thebreaking:prefix, so the release will bump the major version. If you'd rather ship this as a minor or patch, the commit needs rewording before merge, because GitVersion reads the branch commits.Testing
dotnet build Invex.Atom.slnx: 0 warnings, 0 errors.dotnet test Invex.Atom.slnx: all passing onnet10.0andnet11.0, including the 5 new tests. I checked that the cache test fails if the tool version is removed from the cache key, and that the tool test fails with the old version and arguments.main,feat/thing,fix/bug,patch/1.2,develop,pr/5,randomand av9.9.9tag.FullSemVer, the pre-release,InformationalVersionandAssemblySemFileVermatched on every one.dotnet run --project _atom -- SetupBuildInfowith GitVersion 6.8.2 installed globally and a v6-format cache entry planted. The tool upgraded to 7.0.0 and the stale cache was ignored. Build ID and Build Version came out as5.3.1-alpha.claude-laughing-ptolemy-ls6ira.1, and the cache was rewritten as7.0.0:<hash>.GitVersion.Tool7.0.0 still publishes anosx-x64tool package, so themacos-15-intelCI runners can install it. v7 only dropped the standalone Intel macOS archives.Open question: telemetry
GitVersion 7 sends sampled CLI usage telemetry by default. Atom shows this as a build warning every time GitVersion runs: "GitVersion may send sampled CLI usage data to PostHog Cloud. Opt out with --telemetry-opt-out or DO_NOT_TRACK=1." This PR doesn't opt out. Adding
--telemetry-opt-outtoOutputJsonArgumentswould silence the warning and opt every consumer out.🤖 Generated with Claude Code
https://claude.ai/code/session_01NmBdNrhc5dVcJV7JXypNEJ