Skip to content

[7.0.2] Use upper-bound version ranges for sibling package dependencies#4357

Draft
paulmedynski wants to merge 1 commit into
release/7.0from
dev/paul/release/7.0/upper-bounds
Draft

[7.0.2] Use upper-bound version ranges for sibling package dependencies#4357
paulmedynski wants to merge 1 commit into
release/7.0from
dev/paul/release/7.0/upper-bounds

Conversation

@paulmedynski

Copy link
Copy Markdown
Contributor

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

  • Define range properties in tools/props/Versions.props (available to both build.proj and SDK-style projects via the Directory.Build.props import order)
  • Reference range properties in Directory.Packages.props PackageVersion items
  • Update Microsoft.Data.SqlClient.nuspec to use range tokens ($AbstractionsVersionRange$, $LoggingVersionRange$, $SniVersionRange$, $SqlServerVersionRange$)
  • Pass range properties through GenerateMdsPackage.targets to nuget pack
  • Replace MSBuild@1 with DotNetCoreCLI@2 for MDS pack in CI and OneBranch pipelines
  • Wire loggingPackageVersion/referenceType through Abstractions and Azure pipeline stages for Package-mode builds
  • Remove unused generate-nuget-package-step.yml template

Verification

  • dotnet msbuild build.proj -getProperty:AbstractionsVersionRange etc. all resolve correctly
  • dotnet pack of Abstractions and Azure produces nupkgs with correct [floor, ceiling) dependency metadata
  • PackageVersion items resolve correct ranges for SDK-style projects in Package mode

Related

Port of #4337 (commit fd8cb4b) adapted for this branch's variable naming and MSBuild-based pack approach.

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
Copilot AI review requested due to automatic review settings June 11, 2026 14:11
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jun 11, 2026
@paulmedynski paulmedynski changed the title Use upper-bound version ranges for sibling package dependencies [7.0.2] Use upper-bound version ranges for sibling package dependencies Jun 11, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Jun 11, 2026
@paulmedynski paulmedynski added this to the 7.0.2 milestone Jun 11, 2026
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CPM PackageVersion items and nuspec token expansion.
  • Updates the MDS nuspec + GenerateMdsPackage target to pass version range tokens into nuget pack.
  • Refactors CI/OneBranch packing to invoke build.proj’s GenerateMdsPackage (and removes the unused generate-nuget-package-step.yml template), 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.

Comment thread Directory.Packages.props
Comment thread eng/pipelines/stages/build-abstractions-package-ci-stage.yml
@cheenamalhotra cheenamalhotra self-assigned this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants