Reset build patch on GitVersion.yml changes (keep GitVersion for Major.Minor)#90
Merged
Merged
Conversation
… to .0 GitVersion's ConfiguredNextVersion strategy returns next-version from the config file but does not set a base version SHA, so CommitsSinceVersionSource falls back to counting all commits in the repository (357 on main). That keeps the version monotonic but means a next-version bump never resets the patch back to .0. Keep GitVersion responsible for parsing/validating Major.Minor and override the patch in both pipelines with 'git rev-list --count <GitVersion.yml-commit>..HEAD'. The first build after merging this branch will be 1.1.0; subsequent commits become 1.1.1, 1.1.2, ... and the next bump (e.g. 1.2.0) automatically resets the counter.
ob_sdl_binskim_scanOutputDirectoryOnly limits BinSkim to ob_outputDirectory (= out\). The pre-SDL cleanup whitelisted only zip/nupkg/_manifest, but BinSkim does not look inside .zip/.nupkg archives, so it found no scannable PE files and logged: 'No files found to upload for tool: binskim. Skipping...'. Add win-x64 and win-arm64 (the only RID outputs that contain Windows PE binaries) to the keep list. The bytes are duplicates of what is already inside the zips, but they're needed loose for SDL scanning.
sevoku
approved these changes
May 20, 2026
mkrueger
added a commit
that referenced
this pull request
May 21, 2026
… versioning (#91) ## Summary Adopt [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning) (NBGV) as the single source of truth for version computation, replacing both the abandoned GitVersion tool and the CI-only patch-bump script introduced in #90. NBGV is a Microsoft / .NET Foundation project (MIT-licensed) that derives the patch component from git history (commit count since `version.json` last changed) at MSBuild time. This means **local developer builds and CI builds now produce identical, deterministic versions** — no more `1.0.0` placeholders when building outside the pipeline. ## Why #90 dropped GitVersion in favor of a custom patch-bump script that runs only in CI. Local builds therefore lost meaningful versioning. We needed a replacement that: - Computes the patch automatically from git history starting at the last major/minor bump. - Lets us pin a baseline `major.minor` in source. - Works the same way locally and in CI. - Is maintained by a trustworthy upstream (we ruled out devlooped/GitInfo for OSMF license reasons). NBGV satisfies all of the above and is already widely used across .NET Foundation repos. ## Changes ### New: `version.json` - Baseline `1.1-preview` — bumping major/minor is a one-line edit; patch resets automatically because the file changed. - `publicReleaseRefSpec` covers `main`, `rel/*`, and PR merge refs. Other branches (including `dev/*`) get a `-g<sha>` suffix to prevent collisions on feeds. - `nugetPackageVersion.semVer = 2`. - `cloudBuild.*` variable injection disabled — we emit the version explicitly in our pipelines instead. ### Removed: `GitVersion.yml` ### Build infrastructure - `Directory.Build.props`: replaced the old `VersionSuffix` block with a single `<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all" VersionOverride="3.9.50" />`. `VersionOverride` is required because `CosmosDBShell.Fuzzer` opts out of central package management. - `Directory.Packages.props`: added `Nerdbank.GitVersioning 3.9.50` for the central-PM consumers. - `.config/dotnet-tools.json`: `gitversion.tool` → `nbgv` 3.9.50. ### CI Both pipelines now fetch full git history (already required by NBGV), restore tools, and call `nbgv get-version` once for the package version. The redundant `/p:Version`, `/p:FileVersion`, `/p:InformationalVersion`, and `/p:PackageVersion` overrides on `dotnet build`, the per-RID `dotnet publish` loop, and `dotnet pack` were removed — NBGV stamps those automatically. - `.github/workflows/validate-and-package.yml` - `.pipelines/CosmosDB-Shell-Official.yml` ## Verification - `dotnet restore`, `dotnet build CosmosDBShell.sln -c Release`, and `dotnet test CosmosDBShell.sln -c Release` all pass (1074/1074). - The built `CosmosDBShell.dll` carries the expected attributes: - `AssemblyVersion = 1.1.0.0` - `FileVersion = 1.1.0.<commit-hash-short>` (NBGV embeds the first 16 bits of the commit SHA into the revision component for per-commit uniqueness) - `AssemblyInformationalVersion = 1.1.0-preview+808048fc14` - `NuGetPackageVersion = 1.1.0-preview` - `CosmosDBShell --version` → `CosmosDBShell 1.1.0-preview (808048f)` - `version` shell command → `1.1.0-preview` (existing parser splits on `+`, unchanged). - Existing `VersionCommand_UsesInformationalVersion` test still passes. ## Operational notes - Bumping major/minor: edit `version.json` and commit. Patch resets to `0` and increments per commit afterwards. - Cutting a stable release: drop `-preview` from `version.json`'s `version` (or branch to `rel/1.1`). - Feature/PR branches that don't match `publicReleaseRefSpec` get a `-g<sha>` suffix on the package version, so they cannot collide with official packages on a feed.
mkrueger
added a commit
that referenced
this pull request
May 21, 2026
Converts the `Unreleased — since v1.0.273` section to `1.1.4 — 2026-05-21` (first release on the 1.1 line) and adds entries for the PRs that landed after #86 (the last CHANGELOG update): - **Highlights / New features:** multi-line REPL input with `\` continuation and parser-driven incomplete-input detection ([#88](#88)); parser & query diagnostics with line, column, source caret, and "Did you mean…" suggestions ([#87](#87)). - **Documentation:** notes that [docs/navigation.md](docs/navigation.md) and [README](README.md) now document multi-line input. - **Build & pipeline:** versioning moved to [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning); local builds now produce the same versions as CI ([#90](#90), [#91](#91)). PR #89 was a stepping stone superseded by the NBGV migration, so it isn't called out separately. Docs-only change — no code touched.
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.
Why
PR #89 made the build version independent of git tags by removing the
TaggedCommitstrategy fromGitVersion.yml. That fixed the regression where taggingv1.0.273reset the patch to82. However, GitVersion'sConfiguredNextVersionstrategy returnsnext-versionfrom the config file but does not set a base version SHA, soCommitsSinceVersionSourcefalls back to counting all commits in the repository.Result: after merging #89, builds show
1.1.357+instead of starting at1.1.0after thenext-versionbump. The patch never resets whennext-versionis bumped, which makes aMajor.Minorbump indistinguishable from any other commit.What
Keep GitVersion responsible for parsing/validating
Major.MinorfromGitVersion.yml, but compute the patch in both pipelines from the commit history ofGitVersion.ymlitself:Applied identically in:
.github/workflows/validate-and-package.yml.pipelines/CosmosDB-Shell-Official.ymlBehavior
0wheneverGitVersion.ymlis edited (e.g. when bumpingnext-version).1.1.1,1.1.2, … in order.1.2.0) automatically resets the counter back to0.Note: the very first build after this PR merges will be
1.1.<small>rather than literally1.1.0, because the merge commit and any commits between #89 and this PR are counted fromGitVersion.yml's last edit (commit319b304from #89). Futurenext-versionbumps will reset cleanly because they touchGitVersion.yml.Validation
dotnet build CosmosDBShell/CosmosDBShell.csprojsucceeds locally.