Skip to content

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

Merged
paulmedynski merged 4 commits into
release/7.0from
dev/paul/release/7.0/upper-bounds
Jun 18, 2026
Merged

[7.0.2] Use upper-bound version ranges for sibling package dependencies#4357
paulmedynski merged 4 commits into
release/7.0from
dev/paul/release/7.0/upper-bounds

Conversation

@paulmedynski

@paulmedynski paulmedynski commented Jun 11, 2026

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.

Non-Official build here: https://sqlclientdrivers.visualstudio.com/ADO.Net/_build/results?buildId=156503&view=results

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 previously approved these changes Jun 12, 2026
@cheenamalhotra cheenamalhotra self-assigned this Jun 12, 2026
The old generate-nuget-package-step.yml template used NuGetToolInstaller@1
and NuGetCommand@2 which provided nuget.exe implicitly. The replacement
DotNetCoreCLI@2 call invokes the GenerateMdsPackage MSBuild target which
shells out to nuget.exe, but nothing installs it on the agent.

Add NuGetToolInstaller@1 and pass -p:NuGetCmd=nuget.exe so the target
uses the PATH-installed binary instead of the BITS download fallback.
Copilot AI review requested due to automatic review settings June 16, 2026 10:31
@paulmedynski paulmedynski marked this pull request as ready for review June 16, 2026 10:35
@paulmedynski paulmedynski requested a review from a team as a code owner June 16, 2026 10:35
@paulmedynski paulmedynski enabled auto-merge (squash) June 16, 2026 10:35
@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board Jun 16, 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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread Directory.Packages.props
Comment thread tools/targets/GenerateMdsPackage.targets Outdated
- Delete tools/scripts/downloadLatestNuget.ps1 (only caller was
  GenerateMdsPackage.targets; CI uses NuGetToolInstaller@1 instead)
- Replace download with Error if not running on Windows
  (using MSBuild intrinsic IsOSPlatform)
- Use 'where' to verify nuget.exe is available on PATH or at the
  configured path, with a clear error message and docs link
- Add NuGet CLI prerequisite section to BUILDGUIDE.md
Comment thread tools/targets/GenerateMdsPackage.targets
Comment thread tools/targets/GenerateMdsPackage.targets
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.68%. Comparing base (778614a) to head (84b146a).

❗ There is a different number of reports uploaded between BASE (778614a) and HEAD (84b146a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (778614a) HEAD (84b146a)
CI-SqlClient 1 0
Additional details and impacted files
@@               Coverage Diff               @@
##           release/7.0    #4357      +/-   ##
===============================================
- Coverage        73.11%   65.68%   -7.44%     
===============================================
  Files              280      275       -5     
  Lines            43026    65853   +22827     
===============================================
+ Hits             31457    43253   +11796     
- Misses           11569    22600   +11031     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 65.68% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski paulmedynski merged commit 221fac8 into release/7.0 Jun 18, 2026
299 checks passed
@paulmedynski paulmedynski deleted the dev/paul/release/7.0/upper-bounds branch June 18, 2026 12:59
@github-project-automation github-project-automation Bot moved this from In review to Done in SqlClient Board Jun 18, 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: Done

Development

Successfully merging this pull request may close these issues.

6 participants