Consolidate package version specification and computation#4336
Draft
paulmedynski wants to merge 12 commits into
Draft
Consolidate package version specification and computation#4336paulmedynski wants to merge 12 commits into
paulmedynski wants to merge 12 commits into
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. |
Comment on lines
+81
to
+85
| variables: | ||
| - name: abstractionsPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AbstractionsPackageVersion'] ] | ||
| - name: abstractionsAssemblyFileVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AbstractionsFileVersion'] ] |
Comment on lines
+77
to
+80
| variables: | ||
| - name: sqlServerPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.SqlServerPackageVersion'] ] | ||
|
|
Comment on lines
+100
to
+104
| - name: mdsPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.SqlClientPackageVersion'] ] | ||
| - name: akvPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AkvProviderPackageVersion'] ] | ||
| - name: loggingPackageVersion |
Comment on lines
+170
to
+174
| # Package versions from compute-versions stage. | ||
| - name: azurePackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AzurePackageVersion'] ] | ||
| - name: azureAssemblyFileVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.AzureFileVersion'] ] |
Comment on lines
+82
to
+86
| - name: loggingPackageVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.LoggingPackageVersion'] ] | ||
| - name: loggingAssemblyFileVersion | ||
| value: $[ stageDependencies.compute_versions_ci.compute_versions_job.outputs['versions.LoggingFileVersion'] ] | ||
|
|
Comment on lines
+131
to
+135
| # Compute all package versions up-front. Downstream stages consume these via | ||
| # stage dependency output variables (e.g. $(loggingPackageVersion)). | ||
| - template: /eng/pipelines/stages/compute-versions-ci-stage.yml@self | ||
| parameters: | ||
| buildSuffix: ${{ parameters.buildSuffix }} |
Comment on lines
+7
to
11
| # Variables for PR and CI pipelines. Package versions are computed by each project's | ||
| # Versions.props using BuildNumber + buildSuffix. No per-package version variables are needed. | ||
| # The buildSuffix itself is set by each pipeline via the core template parameter. | ||
|
|
||
| variables: |
10 tasks
…ions - Rename *VersionDefault -> *NextVersion in all Versions.props - Add *PublishedVersion (last shipped) to all Versions.props - Add 6 GetVersions* targets to build.proj (stdout-based extraction) - Add compute-versions-stage.yml (single job extracts all versions up-front) - Make packageVersion a required parameter in all build/pack steps - Remove BuildSuffix from pipeline variables - Wire release booleans to resolve next vs published version per package
- Add compute-versions-ci-stage.yml that extracts all package/file versions up-front using GetVersions* targets with BuildSuffix - Wire compute-versions as first stage in dotnet-sqlclient-ci-core.yml - PR pipelines pass buildSuffix='pr', CI pipelines pass buildSuffix='ci' - Each downstream stage consumes versions via stageDependencies outputs - Remove buildSuffix from ci-build-variables.yml (now a parameter) - Rename package-versions.instructions.md to 3rd-party scope - Add sqlclient-package-versions.instructions.md documenting version flow
- Add compute-versions-stage.yml invocation to official and non-official OneBranch pipelines, passing release* parameters - Add dependsOn: compute_versions and stage-level variables to all build stages in build-stages.yml (resolves versions from stageDependencies) - Add dependsOn: compute_versions and stage-level variables to publish-symbols-stage.yml - Give version parameters default values of $(variableName) so they resolve at runtime from stage variables when not passed explicitly - Fix BuildNumber format in docs: use $(Rev:rr) (e.g. 15401) instead of incorrect 20250602.1 format - Add comment on name: explaining 16-bit int FileVersion constraint
The CI/PR test stage (ci-run-tests-stage.yml) did not depend on the compute_versions_ci stage nor define the package version variables from its outputs. In Package mode this left the $(...PackageVersion) macros empty, causing dotnet test restore to fail with NU1604/NU1602 across all test legs. Add compute_versions_ci to the stage dependsOn and map abstractions/logging/mds/sqlServer package versions from its outputs, mirroring the build stages.
756dc7a to
e63eafa
Compare
Comment on lines
+36
to
+39
| steps: | ||
| # Extract all versions (package, file) per project. | ||
| # Each GetVersions* target emits labeled stdout lines. | ||
| - script: | |
Comment on lines
+50
to
+55
| local pkg file | ||
| pkg=$(echo "$output" | sed -n 's/^ *PackageVersion: //p') | ||
| file=$(echo "$output" | sed -n 's/^ *FileVersion: //p') | ||
| echo " ${label}: pkg=$pkg file=$file" | ||
| echo "##vso[task.setvariable variable=${label}PackageVersion;isOutput=true]$pkg" | ||
| echo "##vso[task.setvariable variable=${label}FileVersion;isOutput=true]$file" |
Comment on lines
+78
to
+85
| local pkg pub file | ||
| pkg=$(echo "$output" | sed -n 's/^ *PackageVersion: //p') | ||
| pub=$(echo "$output" | sed -n 's/^ *PublishedVersion: //p') | ||
| file=$(echo "$output" | sed -n 's/^ *FileVersion: //p') | ||
| echo " ${label}: pkg=$pkg pub=$pub file=$file" | ||
| echo "##vso[task.setvariable variable=${label}NextVersion]$pkg" | ||
| echo "##vso[task.setvariable variable=${label}PublishedVersion]$pub" | ||
| echo "##vso[task.setvariable variable=${label}FileVersion]$file" |
All SqlClient family packages (Internal.Logging, Extensions.Abstractions,
Microsoft.Data.SqlClient, Extensions.Azure, and the AlwaysEncrypted
AzureKeyVaultProvider) now share the SqlClient version (package, file, and
assembly). Microsoft.SqlServer.Server remains versioned separately.
- src/Directory.Build.props imports the canonical SqlClient Versions.props
for every project, exposing SqlClient{Package,File,Assembly}Version globally.
- Deleted the four family Versions.props; family csproj reference SqlClient*.
- src/Microsoft.Data.SqlClient/Versions.props is the family version source;
removed SqlClientPublishedVersion (the family always ships its next version).
- Directory.Packages.props pins all family packages to the shared
SqlClientPackageVersion range; imports only the SqlServer Versions.props.
- build.proj: collapsed GetVersions* to GetVersionsSqlClient + GetVersionsSqlServer;
family PackageVersion*Argument values alias PackageVersionSqlClientArgument.
- SqlClient nuspec uses a single $SqlClientVersionRange$ token for the family
dependencies (Abstractions, Logging).
Verified locally: family projects resolve to the SqlClient version in dev/ci
and explicit-override modes; SqlServer stays independent; Package-mode pack of
SqlClient emits family deps at the shared range and SqlServer at its own.
The compute-versions stage now resolves a single SqlClient family version plus
a separately-versioned SqlServer version (one releaseSqlServerServer toggle).
Build, symbols, and release stages consume sqlClient{Package,File}Version for
all family packages and sqlServer* for Microsoft.SqlServer.Server.
- compute-versions-stage.yml: extracts only GetVersionsSqlClient + GetVersionsSqlServer;
emits SqlClient + SqlServer outputs.
- build-stages.yml / publish-symbols-stage.yml: family jobs use the shared SqlClient version.
- release-stages.yml: five family release toggles collapsed to one releaseSqlClient
(family released together); releaseSqlServerServer kept separate.
- official/non-official entries: collapsed release parameters; build* and
publishSymbols toggles unchanged.
- package-variables.yml: updated version-strategy comment.
The CI/PR compute-versions stage now extracts only the SqlClient family version
and the separately-versioned SqlServer version. All family build stages map their
version variables from versions.SqlClientPackageVersion / SqlClientFileVersion,
and the standalone family pack jobs (Logging, Abstractions, Azure) pass
SqlClientPackageVersion so they produce correctly-versioned packages.
- compute-versions-ci-stage.yml: extracts GetVersionsSqlClient + GetVersionsSqlServer only.
- build-{logging,abstractions,azure,sqlclient}-package-ci-stage.yml: family version
variables sourced from the shared SqlClient outputs.
- pack-{logging,abstractions,azure}-package-ci-job.yml: buildProperties pass
SqlClientPackageVersion; dropped vestigial *AssemblyFileVersion (ThisAssembly
falls back to FileVersion) and redundant per-dependency version properties.
- ci-run-tests-stage.yml: family test version variables sourced from SqlClient.
The SqlClient and AKV packages pack via build.proj (PackageVersionSqlClient), which
already routes family versions correctly.
Update the version-resolution instructions and BUILDGUIDE to reflect that all SqlClient family packages (Internal.Logging, Extensions.Abstractions, Microsoft.Data.SqlClient, Extensions.Azure, and the AKV Provider) share the SqlClient version, set via PackageVersionSqlClient. Microsoft.SqlServer.Server is versioned separately via PackageVersionSqlServer. - sqlclient-package-versions.instructions.md: family/SqlServer split, two-target GetVersions, releaseSqlServerServer-only effective-version resolution, updated 'Updating Versions' guidance. - BUILDGUIDE.md: pack/build parameter tables and package-mode examples use the single family parameter.
The SqlClient family shares one version, so the per-package version parameters
(abstractions/logging/azure/akv/mds PackageVersion and the vestigial
*AssemblyFileVersion) are collapsed into a single packageVersion parameter.
Microsoft.SqlServer.Server keeps its own sqlServerPackageVersion.
Build stages now self-compute their version(s) from the compute_versions_ci
outputs into stage variables and feed jobs directly ($(packageVersion) /
$(sqlServerPackageVersion)); the core no longer passes any version parameters
down. Reusable job/step templates keep a single packageVersion parameter.
Also drops the now-redundant -p:PackageVersion{Abstractions,Logging,AkvProvider}
build.proj arguments (they alias to PackageVersionSqlClient) and fixes two
Project-mode pack buildProperties (pack-abstractions, pack-azure) that still
passed the dead per-package version property.
…t csproj These per-package Versions.props files were deleted when the SqlClient family was unified onto a single shared version. The csproj still defined paths to and conditionally imported them (guarded by Exists, so they were silent no-ops). The SqlClient family version is already imported globally by src/Directory.Build.props, so only the separately-versioned Microsoft.SqlServer.Server props is needed here.
Remove the ambiguous 'AssemblyFileVersion' indirection in GenerateThisAssemblyCs: the custom property always fell back to FileVersion, so emit FileVersion directly. Rename the generated ThisAssembly constants InformationalVersion -> FileVersion and NuGetPackageVersion -> PackageVersion, and update all consumers (AdapterUtil, SqlDiagnosticListener, UserAgent, Azure ActiveDirectoryAuthenticationProvider, UserAgentTests). The stress runner reads these internal fields via reflection; since it project-references SqlClient it only probes the current names. Also replace 'AssemblyFileVersion' with 'FileVersion' in the four CI/PR pipeline BuildNumber comments (Major.Minor.Patch.Revision).
…Server The SqlClient family (Logging, Abstractions, SqlClient, Azure, AKV Provider) is always built and released together, so the buildSqlClient/buildAkvProvider toggles are removed. buildSqlServer is now the only build toggle: when on, the family depends on the freshly-built SqlServer artifact; when off, it depends on the most recently published SqlServer package (version-only dependency restored from NuGet). - compute-versions-stage: SqlServer version selection driven by buildSqlServer (next when built, published when not). - build-stages: family stages are unconditional; SqlServer build job and the SqlClient/AKV SqlServer dependency are gated on buildSqlServer. - build-buildproj-job: dependency artifactName is now optional (version-only deps skip artifact download and restore from NuGet). - publish-symbols-stage: independent publishSymbols flag; family symbols always publish, SqlServer symbols gated on buildSqlServer; dropped no-op placeholder. - release-stages: dropped nonexistent sqlclient_package_validation from dependsOn. - Dropped duplicate 'Server' suffix: buildSqlServerServer -> buildSqlServer, releaseSqlServerServer -> releaseSqlServer. - Updated onebranch-pipeline-design instructions to match.
Comment on lines
26
to
28
| <ImportGroup Condition="'$(ReferenceType)' == 'Package'"> | ||
| <Import Project="src/Microsoft.Data.SqlClient/Versions.props" /> | ||
| <Import Project="src/Microsoft.SqlServer.Server/Versions.props" /> | ||
| <Import Project="src/Microsoft.Data.SqlClient.Internal/Logging/src/Versions.props" /> | ||
| <Import Project="src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Versions.props" /> | ||
| <Import Project="src/Microsoft.Data.SqlClient.Extensions/Azure/src/Versions.props" /> | ||
| <Import Project="src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/Versions.props" /> | ||
| </ImportGroup> |
Comment on lines
+37
to
+42
| steps: | ||
| # Extract package + file versions for the SqlClient family | ||
| # (GetVersionsSqlClient) and Microsoft.SqlServer.Server (GetVersionsSqlServer). | ||
| # Each target emits labeled stdout lines. | ||
| - script: | | ||
| set -euo pipefail |
Comment on lines
+49
to
+59
| steps: | ||
| - pwsh: | | ||
| New-Item -Path "$(ob_outputDirectory)" -ItemType Directory -Force | ||
| "**" | Out-File -FilePath "$(ob_outputDirectory)/.artifactignore" -Encoding ascii | ||
| displayName: 'Suppress artifact publishing' | ||
|
|
||
| # Extract versions (package, published, file) for the SqlClient family | ||
| # (GetVersionsSqlClient) and Microsoft.SqlServer.Server (GetVersionsSqlServer). | ||
| # Each target emits labeled messages to stdout. | ||
| - script: | | ||
| set -euo pipefail |
Comment on lines
+83
to
+87
| - script: | | ||
| echo "Resolving effective versions..." | ||
|
|
||
| # The SqlClient family always uses its "next" version. | ||
| SQLCLIENT_VERSION="$(SqlClientNextVersion)" |
Comment on lines
+62
to
66
| # Assembly file version for APIScan (e.g. 1.0.0.12345). Pre-computed by compute-versions stage. | ||
| - name: fileVersion | ||
| type: string | ||
| default: '' | ||
|
|
Comment on lines
172
to
178
| - template: /eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml@self | ||
| parameters: | ||
| packageName: Microsoft.Data.SqlClient.Internal.Logging | ||
| artifactName: '${{ parameters.loggingArtifactsName }}' | ||
| packagePath: 'Package-Release/Microsoft.Data.SqlClient.Internal.Logging.${{ parameters.loggingPackageVersion }}.nupkg' | ||
| nugetServiceConnection: ${{ variables.nugetServiceConnection }} | ||
| isProduction: ${{ parameters.isOfficial }} | ||
| displaySuffix: ${{ variables.nugetTargetSuffix }} |
Comment on lines
181
to
187
| - template: /eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml@self | ||
| parameters: | ||
| packageName: Microsoft.Data.SqlClient.Extensions.Abstractions | ||
| artifactName: '${{ parameters.abstractionsArtifactsName }}' | ||
| packagePath: 'Package-Release/Microsoft.Data.SqlClient.Extensions.Abstractions.${{ parameters.abstractionsPackageVersion }}.nupkg' | ||
| nugetServiceConnection: ${{ variables.nugetServiceConnection }} | ||
| isProduction: ${{ parameters.isOfficial }} | ||
| displaySuffix: ${{ variables.nugetTargetSuffix }} |
Comment on lines
190
to
196
| - template: /eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml@self | ||
| parameters: | ||
| packageName: Microsoft.Data.SqlClient | ||
| artifactName: '${{ parameters.sqlClientArtifactsName }}' | ||
| packagePath: 'Package-Release/Microsoft.Data.SqlClient.${{ parameters.sqlClientPackageVersion }}.nupkg' | ||
| nugetServiceConnection: ${{ variables.nugetServiceConnection }} | ||
| isProduction: ${{ parameters.isOfficial }} | ||
| displaySuffix: ${{ variables.nugetTargetSuffix }} |
Comment on lines
199
to
205
| - template: /eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml@self | ||
| parameters: | ||
| packageName: Microsoft.Data.SqlClient.Extensions.Azure | ||
| artifactName: '${{ parameters.azureArtifactsName }}' | ||
| packagePath: 'Package-Release/Microsoft.Data.SqlClient.Extensions.Azure.${{ parameters.azurePackageVersion }}.nupkg' | ||
| nugetServiceConnection: ${{ variables.nugetServiceConnection }} | ||
| isProduction: ${{ parameters.isOfficial }} | ||
| displaySuffix: ${{ variables.nugetTargetSuffix }} |
Comment on lines
208
to
214
| - template: /eng/pipelines/onebranch/jobs/publish-nuget-package-job.yml@self | ||
| parameters: | ||
| packageName: Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider | ||
| artifactName: '${{ parameters.akvProviderArtifactsName }}' | ||
| packagePath: 'Package-Release/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.${{ parameters.akvProviderPackageVersion }}.nupkg' | ||
| nugetServiceConnection: ${{ variables.nugetServiceConnection }} | ||
| isProduction: ${{ parameters.isOfficial }} | ||
| displaySuffix: ${{ variables.nugetTargetSuffix }} |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4336 +/- ##
==========================================
- Coverage 65.45% 63.47% -1.98%
==========================================
Files 285 280 -5
Lines 43373 66344 +22971
==========================================
+ Hits 28388 42113 +13725
- Misses 14985 24231 +9246
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:
|
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.
Goals
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 (was it the file version or the assembly version?) and use only the unambiguous SDK termsFileVersion(Major.Minor.Patch.Revision) andAssemblyVersion(Major.0.0.0).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,SqlServerAssemblyVersionsrc/Directory.Build.propsimports the SqlClientVersions.propsfor every project, so the family version is globally available; all family.csprojfiles consume$(SqlClient{Package,File,Assembly}Version).Directory.Packages.propspins all family packages to the sharedSqlClientPackageVersionrange and the SqlServer package to its own range. The four per-package familyVersions.propsfiles have been deleted.Each
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.build.proj
GetVersions*targets to justGetVersionsSqlClientandGetVersionsSqlServer, which emitPackageVersion:/FileVersion:(andPublishedVersion:for SqlServer) to stdout for pipeline capture.PackageVersionSqlClientparameter sets the version for the entire family; the historical per-package version arguments are retained as aliases ofPackageVersionSqlClientArgumentfor backward compatibility.PackageVersionSqlServerremains separate.OneBranch pipeline (official)
onebranch/stages/compute-versions-stage.ymlresolves one SqlClient family version + one SqlServer version up front (singlereleaseSqlServerServertoggle for the separately-versioned package).build-stages.yml,publish-symbols-stage.yml, and the build/pack jobs/steps consumesqlClient{Package,File}Versionfor all family packages andsqlServer*for SqlServer.release-stages.yml: five family release toggles collapsed to onereleaseSqlClient(the family releases together);releaseSqlServerServerkept separate.package-variables.yml: removed hardcoded version values.CI/PR pipeline
stages/compute-versions-ci-stage.ymlruns the twoGetVersions*targets with aBuildSuffixand emits the family + SqlServer versions.compute_versions_citodependsOnand map their version variables from the sharedSqlClient*outputs; pack jobs passSqlClientPackageVersion.packageVersionparameter across the reusable templates (Microsoft.SqlServer.ServerkeepssqlServerPackageVersion); the core stops threading per-package version parameters down.buildSuffix: pr, CI pipelines passbuildSuffix: ci.Version-naming cleanup
AssemblyFileVersionproperty fromtools/targets/GenerateThisAssemblyCs.targets(it always fell back toFileVersion).ThisAssemblyconstants:InformationalVersion→FileVersion,NuGetPackageVersion→PackageVersion; updated all consumers (AdapterUtil,SqlDiagnosticListener,UserAgent, AzureActiveDirectoryAuthenticationProvider,UserAgentTests, and the reflection-based stress runner).AssemblyFileVersionwithFileVersionin the four CI/PR pipelineBuildNumbercomments.Documentation
package-versions.instructions.md→3rd-party-package-versions.instructions.md(scoped to external deps).sqlclient-package-versions.instructions.mddescribing family/SqlServer version resolution across all scenarios.BUILDGUIDE.mdpack/build parameter tables and package-mode examples to use the single family parameter.Resulting version differentiation
-dev7.1.0-preview1-dev-pr7.1.0-preview1-pr20250602.1-ci7.1.0-preview1-ci20250602.17.1.0-preview1Verification
-cisuffixed versions-prsuffixed versionsdotnet buildstill produces-devversions