Consolidate and align SqlClient versioning#4336
Draft
paulmedynski wants to merge 5 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a centralized “compute versions” stage for CI/PR pipelines (mirroring the OneBranch approach) and refactors version sources so pipelines can compute/package versions once and flow them to downstream stages/jobs.
Changes:
- Added
compute_versions_cistage to extract package/file versions up-front via newGetVersions*targets inbuild.proj. - Refactored each package’s
Versions.propsto introduce*NextVersionand*PublishedVersionproperties. - Began wiring CI/PR and OneBranch pipelines/templates to consume computed versions (but the current wiring is incomplete and will break pipeline execution).
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.SqlServer.Server/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use SqlServerNextVersion. |
| src/Microsoft.Data.SqlClient/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use SqlClientNextVersion. |
| src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use LoggingNextVersion. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use AzureNextVersion. |
| src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use AbstractionsNextVersion. |
| src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props | Adds Published/Next version properties; updates computed package/file version logic to use AkvProviderNextVersion. |
| eng/pipelines/stages/compute-versions-ci-stage.yml | New CI/PR stage that runs GetVersions* targets and exports versions as stage/job outputs. |
| eng/pipelines/stages/build-sqlserver-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but needs additional wiring updates). |
| eng/pipelines/stages/build-sqlclient-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables; attempts to use those versions downstream. |
| eng/pipelines/stages/build-logging-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but needs downstream job wiring updates). |
| eng/pipelines/stages/build-azure-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but downstream job calls still use template parameters). |
| eng/pipelines/stages/build-abstractions-package-ci-stage.yml | Adds dependency on compute stage and maps its outputs to stage variables (but downstream job calls still use template parameters). |
| eng/pipelines/sqlclient-pr-project-ref-pipeline.yml | Passes buildSuffix: 'pr' into the CI core template. |
| eng/pipelines/sqlclient-pr-package-ref-pipeline.yml | Passes buildSuffix: 'pr' into the CI core template. |
| eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml | Passes buildSuffix: 'ci' into the CI core template. |
| eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml | Passes buildSuffix: 'ci' into the CI core template. |
| eng/pipelines/dotnet-sqlclient-ci-core.yml | Adds buildSuffix parameter and injects the compute-versions stage before other stages. |
| eng/pipelines/libraries/ci-build-variables.yml | Removes previously hardcoded per-package version variables in favor of computed versions. |
| build.proj | Adds GetVersions* targets that emit labeled version lines for pipeline parsing. |
| eng/pipelines/onebranch/variables/package-variables.yml | Removes OneBranch per-package version variables; keeps artifact naming variables. |
| eng/pipelines/onebranch/stages/compute-versions-stage.yml | New OneBranch stage to compute “next/published/effective” versions and emit output variables. |
| eng/pipelines/onebranch/stages/build-stages.yml | Refactors build template to require pre-computed versions; comments out SqlClient package validation stage. |
| eng/pipelines/onebranch/stages/publish-symbols-stage.yml | Refactors parameters to require pre-computed package versions for symbol publishing. |
| eng/pipelines/onebranch/stages/release-stages.yml | Removes explicit per-version packagePath in favor of default/wildcarded publish behavior. |
| eng/pipelines/onebranch/jobs/build-buildproj-job.yml | Threads “pre-computed version” concept through build/pack steps; tweaks APIScan versionNumber handling. |
| eng/pipelines/onebranch/jobs/publish-symbols-job.yml | Refactors job variables to list form; clarifies version requirement. |
| eng/pipelines/onebranch/steps/roslyn-analyzers-buildproj-step.yml | Updates comments to reflect version must be pre-computed. |
| eng/pipelines/onebranch/steps/pack-buildproj-step.yml | Updates comments to reflect version must be pre-computed. |
| eng/pipelines/onebranch/steps/build-buildproj-step.yml | Updates comments to reflect version must be pre-computed. |
| eng/pipelines/onebranch/sqlclient-official.yml | Removes passing version vars to templates (but does not yet provide new required version parameters). |
| eng/pipelines/onebranch/sqlclient-non-official.yml | Removes passing version vars to templates (but does not yet provide new required version parameters). |
| .github/instructions/sqlclient-package-versions.instructions.md | New documentation describing version resolution flow (examples need to match actual pipeline build-number format). |
| .github/instructions/3rd-party-package-versions.instructions.md | Renames/re-scopes instructions to explicitly cover third-party dependency versions. |
10 tasks
756dc7a to
e63eafa
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4336 +/- ##
==========================================
+ Coverage 65.45% 66.59% +1.14%
==========================================
Files 285 286 +1
Lines 43373 73294 +29921
==========================================
+ Hits 28388 48808 +20420
- Misses 14985 24486 +9501
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulmedynski
added a commit
that referenced
this pull request
Jun 25, 2026
- compute-versions (CI + OneBranch): install the global.json-pinned .NET SDK and restore dotnet tools before 'dotnet build'; fail fast if version extraction yields an empty value; add 'set -euo pipefail' to the resolve step. (review: #8, #9, #10, #12, #13, #14) - build-buildproj-job: use an explicit non-empty check for package.artifactName in the compile-time 'if'; drop the no-op coalesce for the APIScan file version (OneBranch always supplies one). (review: #15, #25) - compute-versions: document that a boolean ${{ }} parameter renders the PascalCase 'True'/'False', so comparing to 'True' is correct. (review: #24) - publish-nuget-package-job: correct the stale packagePath comment (packages/ -> Package-Release/) and note coalesce() skips the empty default. (review: #16-#21) - docs: sqlclient-package-versions.instructions.md uses buildSqlServer, not releaseSqlServer. (review: #27)
paulmedynski
added a commit
that referenced
this pull request
Jun 25, 2026
…eline cleanup
- Directory.Packages.props: clarify only the SqlServer Versions.props is imported here; the SqlClient family file comes from src/Directory.Build.props
- src/Microsoft.Data.SqlClient/Versions.props: drop stale claim that Directory.Packages.props imports this file
- onebranch build/pack-buildproj-step.yml: remove obsolete comment block (also fixes 'againast' typo)
- onebranch compute-versions-stage.yml: avoid literal empty ${{ }} in a script-block comment that ADO evaluated as a template expression
Replace the generated InformationalVersion/NuGetPackageVersion constants with FileVersion/PackageVersion and update all consumers (diagnostics, user agent, Azure extension, stress runner, and unit tests).
Replace the per-project Versions.props files for the AKV provider, Abstractions, Azure, and Logging packages with a single shared family version. Wire the consuming csproj files, nuspec, central package props, and build.proj version arguments to the unified version.
Add a compute-versions CI stage and thread the unified family version through the legacy Azure DevOps CI and PR pipelines (build/pack/test stages, jobs, steps, and shared templates).
Add a compute-versions stage and thread the unified family version through the OneBranch official and non-official pipelines (build/publish/release stages, jobs, steps, and package variables).
Add the sqlclient-package-versions instructions, rename the package-versions instructions to 3rd-party-package-versions, refresh the OneBranch pipeline design notes, and update BUILDGUIDE for the unified version model.
17a911d to
c78ee0f
Compare
Comment on lines
+259
to
+263
| // Look for the PackageVersion field, falling back to FileVersion. | ||
| var field = type.GetField( | ||
| "NuGetPackageVersion", | ||
| "PackageVersion", | ||
| BindingFlags.NonPublic | BindingFlags.Static) | ||
| ?? type.GetField( |
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.
Overall goal
Make package version specification and computation simple, centralized, and unambiguous:
PackageVersion,FileVersion,AssemblyVersion) is specified/computed in exactly one place — once for the entire SqlClient family and once forMicrosoft.SqlServer.Server.Microsoft.Data.SqlClient,Internal.Logging,Extensions.Abstractions,Extensions.Azure, and the AlwaysEncryptedAzureKeyVaultProvideralways share one version (package, file, and assembly) and release together.Microsoft.SqlServer.Serveris versioned and released independently.AssemblyFileVersionproperty and use only the unambiguous SDK termsFileVersion(Major.Minor.Patch.Revision) andAssemblyVersion(Major.0.0.0).Why one PR with several large commits (not one PR per commit)
This is a single cross-cutting change to how versions flow through projects, build orchestration, and three pipeline families. The pieces share tight, bidirectional contracts, so splitting them into independently-mergeable PRs would mean writing throwaway scaffolding (temporary shims, dual code paths, and compatibility aliases) purely to keep
maingreen between merges — strictly more total work that we would then have to unwind. The commits are instead structured so a reviewer can read one logical body of work at a time, while the PR merges atomically. Concrete examples of the interdependencies:dotnet build build.proj -t:GetVersionsSqlClient/GetVersionsSqlServerand parse aPackageVersion:/FileVersion:stdout contract. Those targets and that stdout format are introduced in the build commit. A standalone "pipeline" PR would invoke targets that don't exist onmain; a standalone "build.proj" PR would delete the old per-packageGetVersions*targets that the current pipelines still call — breaking CI onmainthe moment it merged.stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.SqlClientPackageVersion']and feed it into thePackageVersionSqlClientbuild argument. The producing stage (pipeline commit) and the consuming argument (build commit) are only meaningful together; neither half is correct alone.Versions.propsfiles and adds the singleDirectory.Build.propsimport of the familyVersions.props. Done separately, one ordering leaves family projects with no version defined, and the other leaves duplicate/conflicting version definitions — so they cannot be reviewed/merged as independently-correct units.ThisAssembly.InformationalVersion/NuGetPackageVersionconstants without simultaneously updating the six consumers (AdapterUtil,SqlDiagnosticListener,UserAgent, the Azure auth provider,UserAgentTests, the stress runner) fails to compile. Even this "small" change is irreducible — which is exactly why it is one commit, not one-PR-per-file.Commits (review order)
The branch is organized into five logical commits. Each is a single coherent body of work; they are intended to be reviewed in order. Individual commits are not guaranteed to build/test in isolation (see above).
1. Rename
ThisAssemblyversion constants toFileVersionandPackageVersionA self-contained refactor that removes the ambiguous version naming. In
tools/targets/GenerateThisAssemblyCs.targetsthe generatedThisAssemblyconstants are renamed:InformationalVersion→FileVersionandNuGetPackageVersion→PackageVersion. All consumers are updated:AdapterUtil,SqlDiagnosticListener,UserAgent, the AzureActiveDirectoryAuthenticationProvider,UserAgentTests, and the reflection-based stress runner. (7 files)2. Unify SqlClient family packages onto a single shared version
The core project/build change. The four per-package family
Versions.propsfiles (AKV provider, Abstractions, Azure, Logging) are deleted.src/Microsoft.Data.SqlClient/Versions.propsbecomes the single source of truth for the family (SqlClientPackageVersion,SqlClientFileVersion,SqlClientAssemblyVersion);src/Microsoft.SqlServer.Server/Versions.propsstays independent.src/Directory.Build.propsimports the familyVersions.propsfor every project,Directory.Packages.propspins family packages to the shared range, and all family.csprojfiles plus the nuspec consume the shared properties.build.projcollapses the per-packageGetVersions*targets toGetVersionsSqlClientandGetVersionsSqlServer, with a singlePackageVersionSqlClientparameter (old per-package arguments kept as aliases). (15 files)3. Compute SqlClient family versions centrally in CI/PR pipelines
Adds
eng/pipelines/stages/compute-versions-ci-stage.yml, which runs the twoGetVersions*targets with aBuildSuffixand emits the family + SqlServer versions. All family build/test/pack stages, jobs, steps, and shared templates take a dependency on the new stage and map their version variables from the sharedSqlClient*outputs. CI version parameters are consolidated onto a singlepackageVersionparameter (Microsoft.SqlServer.Serverkeeps its own); PR pipelines passbuildSuffix: pr, CI pipelines passbuildSuffix: ci. (25 files)4. Compute SqlClient family versions centrally in OneBranch pipelines
Adds
eng/pipelines/onebranch/stages/compute-versions-stage.yml, resolving one SqlClient family version and one SqlServer version up front.build-stages.yml,publish-symbols-stage.yml, and the build/pack/publish jobs and steps consumesqlClient{Package,File}Versionfor all family packages andsqlServer*for SqlServer.release-stages.ymlcollapses the five family release toggles to onereleaseSqlClient(keptreleaseSqlServerServerseparate);package-variables.ymldrops hardcoded version values. (13 files)5. Document unified SqlClient family versioning
Adds
.github/instructions/sqlclient-package-versions.instructions.mddescribing family/SqlServer version resolution across all scenarios, renamespackage-versions.instructions.md→3rd-party-package-versions.instructions.md(now scoped to external deps), refreshes the OneBranch pipeline design notes, and updatesBUILDGUIDE.mdpack/build parameter tables and package-mode examples for the single family parameter. (4 files)Version source of truth
After this PR, versions are computed in just two files:
src/Microsoft.Data.SqlClient/Versions.propsSqlClientPackageVersion,SqlClientFileVersion,SqlClientAssemblyVersion— shared by the whole familysrc/Microsoft.SqlServer.Server/Versions.propsSqlServerPackageVersion,SqlServerFileVersion,SqlServerAssemblyVersionEach
Versions.propsuses a 3-tier priority to resolve the version:*PackageVersionparameter (CI/OneBranch pass this) — supersedes all.BuildNumber(+ optionalBuildSuffix) → prerelease tag;BuildNumberis theFileVersionrevision component.-devsuffix for local developer builds.AssemblyVersionis always derived asMajor.0.0.0for strong-name backward compatibility.Resulting version differentiation
-dev7.1.0-preview1-dev-pr7.1.0-preview1-pr20250602.1-ci7.1.0-preview1-ci20250602.17.1.0-preview1Verification
dotnet buildstill produces-devversions-prsuffixed versions: 17607-prsuffixed versions:-cisuffixed versions:Future work
Deferred follow-ups, to be tracked/implemented separately:
sqlclient-prpipeline (eng/pipelines/pr/) in line with the central version-computation model used by the CI and OneBranch pipelines: add a compute-versions stage that resolves the SqlClient family version and the SqlServer version once, up front, and pass them down explicitly to the pack and test stages instead of re-deriving them per step. (build.projalready exposes the neededGetVersions*targets andPackageVersionSqlClient/PackageVersionSqlServerarguments, so this is pipeline-only work.)