[7.0.2] Use upper-bound version ranges for sibling package dependencies#4357
Draft
paulmedynski wants to merge 1 commit into
Draft
[7.0.2] Use upper-bound version ranges for sibling package dependencies#4357paulmedynski wants to merge 1 commit into
paulmedynski wants to merge 1 commit into
Conversation
Compute [floor, ceiling) version ranges for all sibling package dependencies (Abstractions, Logging, MDS, Azure, AKV, SNI, SqlServer.Server) so that NuGet cannot resolve an incompatible newer major version at restore time. Changes: - Define range properties in tools/props/Versions.props (available to both build.proj and SDK-style projects via Directory.Build.props import order) - Reference range properties in Directory.Packages.props PackageVersion items - Update Microsoft.Data.SqlClient.nuspec to use range tokens - Pass range properties through GenerateMdsPackage.targets to nuget pack - Replace MSBuild@1 with DotNetCoreCLI@2 for MDS pack in CI and OneBranch - Wire loggingPackageVersion/referenceType through Abstractions and Azure pipeline stages for Package-mode builds - Remove unused generate-nuget-package-step.yml template
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the build/packaging infrastructure to use upper-bounded NuGet version ranges ([floor, ceiling)) for sibling package dependencies, preventing NuGet restore from selecting incompatible newer major versions.
Changes:
- Introduces MSBuild properties that compute
[floor, ceiling)ranges and uses them for CPMPackageVersionitems and nuspec token expansion. - Updates the MDS nuspec +
GenerateMdsPackagetarget to pass version range tokens intonuget pack. - Refactors CI/OneBranch packing to invoke
build.proj’sGenerateMdsPackage(and removes the unusedgenerate-nuget-package-step.ymltemplate), while wiring extra package-mode parameters through pipeline stages/jobs.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/targets/GenerateMdsPackage.targets | Passes version range properties to nuget pack for nuspec token expansion. |
| tools/specs/Microsoft.Data.SqlClient.nuspec | Switches sibling dependencies to use range tokens (Abstractions/Logging/SNI/SqlServer.Server). |
| tools/props/Versions.props | Adds computed [floor, ceiling) range properties for sibling packages. |
| Directory.Packages.props | Uses range properties for CPM PackageVersion items (SqlServer.Server + SNI + sibling packages in Package mode). |
| eng/pipelines/stages/build-abstractions-package-ci-stage.yml | Adds parameters to support package-mode inputs for Abstractions stage. |
| eng/pipelines/stages/build-azure-package-ci-stage.yml | Adds parameters to support package-mode inputs for Azure stage. |
| eng/pipelines/jobs/pack-abstractions-package-ci-job.yml | Downloads Logging artifacts and passes package-mode properties during dotnet pack. |
| eng/pipelines/jobs/pack-azure-package-ci-job.yml | Downloads Abstractions/Logging artifacts and passes package-mode properties during dotnet pack. |
| eng/pipelines/dotnet-sqlclient-ci-core.yml | Threads referenceType/logging variables through stages for package-mode builds. |
| eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml | Packs MDS via build.proj -t:GenerateMdsPackage instead of the removed template. |
| eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml | Packs MDS via build.proj -t:GenerateMdsPackage (DotNetCoreCLI) for OneBranch. |
| eng/pipelines/common/templates/steps/generate-nuget-package-step.yml | Removed (no longer referenced). |
| src/Microsoft.Data.SqlClient.sln | Removes the deleted pipeline step template from the solution items list. |
cheenamalhotra
approved these changes
Jun 12, 2026
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.
Summary
Compute
[floor, ceiling)version ranges for all sibling package dependencies so that NuGet cannot resolve an incompatible newer major version at restore time.Affected packages: Abstractions, Logging, MDS, Azure, AKV Provider, SNI, SqlServer.Server.
Changes
tools/props/Versions.props(available to bothbuild.projand SDK-style projects via theDirectory.Build.propsimport order)Directory.Packages.propsPackageVersionitemsMicrosoft.Data.SqlClient.nuspecto use range tokens ($AbstractionsVersionRange$,$LoggingVersionRange$,$SniVersionRange$,$SqlServerVersionRange$)GenerateMdsPackage.targetstonuget packMSBuild@1withDotNetCoreCLI@2for MDS pack in CI and OneBranch pipelinesloggingPackageVersion/referenceTypethrough Abstractions and Azure pipeline stages for Package-mode buildsgenerate-nuget-package-step.ymltemplateVerification
dotnet msbuild build.proj -getProperty:AbstractionsVersionRangeetc. all resolve correctlydotnet packof Abstractions and Azure produces nupkgs with correct[floor, ceiling)dependency metadataPackageVersionitems resolve correct ranges for SDK-style projects in Package modeRelated
Port of #4337 (commit fd8cb4b) adapted for this branch's variable naming and MSBuild-based pack approach.