Skip to content

Add CI package pipeline for building and publishing NuGet packages#4292

Open
paulmedynski wants to merge 7 commits into
mainfrom
dev/paul/sqlclient-package
Open

Add CI package pipeline for building and publishing NuGet packages#4292
paulmedynski wants to merge 7 commits into
mainfrom
dev/paul/sqlclient-package

Conversation

@paulmedynski
Copy link
Copy Markdown
Contributor

@paulmedynski paulmedynski commented May 14, 2026

Adds a new top-level pipeline at eng/pipelines/ci/package/sqlclient-package.yml that:

  • Runs on pushes to GitHub main and ADO internal/main branches (batched)
  • Runs nightly at 00:00 UTC on those same branches
  • Cleans the packages/ directory before building
  • Uses build.proj Pack target with ReferenceType=Package
  • On internal builds, downloads the signing key and strong-name signs assemblies
  • Publishes all produced .nupkg/.snupkg files as a pipeline artifact

Tested ADO.Net project runs here:

We can't test Public project runs until this merges, because we can only create new pipelines based on GitHub for YAML files on main.

Copilot AI review requested due to automatic review settings May 14, 2026 19:13
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board May 14, 2026
@paulmedynski paulmedynski changed the base branch from main to dev/paul/sql-server-project-refs May 14, 2026 19:13
@paulmedynski paulmedynski added the Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. label May 14, 2026
@paulmedynski paulmedynski added this to the 7.1.0-preview2 milestone May 14, 2026
@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new CI pipeline that builds and publishes NuGet packages via build.proj in ReferenceType=Package mode, alongside a broader refactor to make package-mode builds self-sustaining: version flow is unified through import-guarded Versions.props files imported early by Directory.Packages.props, all Pack* targets now mirror their output into the local packages/ feed and gain DependsOn chains so dependent packages restore against freshly built nupkgs, and many test/csproj files now switch between ProjectReference and PackageReference for Microsoft.SqlServer.Server based on ReferenceType. A new signed test category gates UDT tests that require a strong-name-signed Microsoft.SqlServer.Server.

Changes:

  • New pipeline eng/pipelines/ci/package/sqlclient-package.yml (push to main/internal/main, nightly, optional strong-name signing on internal builds).
  • build.proj and Directory.Packages.props overhaul: package-mode DependsOn/Pack mirroring, central SqlServerPackageVersion token wiring, category!=signed filter for unsigned builds.
  • Threading of sqlServerArtifactsName/sqlServerPackageVersion through existing CI templates, and reference-mode switching for Microsoft.SqlServer.Server across csprojs (including nuspec token $SqlServerPackageVersion$).

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eng/pipelines/ci/package/sqlclient-package.yml New CI pipeline that packs all packages and publishes Packages artifact.
build.proj Adds package-mode DependsOn chains, output mirroring to packages/, category!=signed filter, and PackageVersionSqlServer threading.
Directory.Packages.props Imports all Versions.props in Package mode to centrally manage sibling package versions.
doc/Directory.Packages.props, doc/samples/Microsoft.Data.SqlClient.Samples.csproj Pin and reorganize Microsoft.SqlServer.Server package usage.
src/Directory.Build.props Comment clarifying FileVersionBuildNumber ordering relative to Directory.Packages.props.
src/**/Versions.props (×6) Add per-product import-guard property to prevent double evaluation.
src/**/*.csproj (Logging, Abstractions, Azure, AKV, SqlServer, SqlClient src/ref/notsupported) Conditional Versions.props import using the new guard; SqlClient ref/notsupported gain SqlServer reference; nuspec token updated.
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Adds SqlServer version import, trim, validation error, and nuspec token replacement.
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.nuspec Replaces hard-coded 1.0.0 with $SqlServerPackageVersion$ token.
src/Microsoft.Data.SqlClient/tests/UnitTests/...csproj Adds ValidateReferenceType target and project reference to Microsoft.SqlServer.Server.
src/Microsoft.Data.SqlClient/tests/ManualTests/...csproj Reference-mode switching for Microsoft.SqlServer.Server (top-level and UDT projects).
src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj Enables ImplicitUsings.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/SqlServerTypesTest.cs, FunctionalTests/SqlDataRecordTest.cs Adds [Trait("Category", "signed")] on NETFRAMEWORK for UDT tests requiring signed SqlServer assembly.
eng/pipelines/**/*.yml (ci-core, build-sqlclient/azure stages, ci-run-tests stage/job, ci-build-nugets, ci-project-build, run-all-tests, test-azure-package job) Thread new sqlServerArtifactsName/sqlServerPackageVersion parameter and download the SqlServer artifact for package-mode test/build flows.

Comment thread eng/pipelines/ci/package/sqlclient-package.yml Outdated
Comment thread eng/pipelines/ci/package/sqlclient-package.yml Outdated
Comment thread eng/pipelines/ci/package/sqlclient-package.yml
Copilot AI review requested due to automatic review settings May 14, 2026 19:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 3 out of 3 changed files in this pull request and generated no new comments.

@paulmedynski paulmedynski marked this pull request as ready for review May 14, 2026 19:32
@paulmedynski paulmedynski requested a review from a team as a code owner May 14, 2026 19:32
@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board May 14, 2026
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from 2b54e4e to da6d01c Compare May 15, 2026 12:34
@paulmedynski paulmedynski added the DO NOT MERGE PRs that are created for test reasons, should not be merged. label May 15, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.68%. Comparing base (520b40b) to head (5815f60).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4292      +/-   ##
==========================================
- Coverage   66.50%   64.68%   -1.83%     
==========================================
  Files         284      279       -5     
  Lines       43301    66219   +22918     
==========================================
+ Hits        28796    42831   +14035     
- Misses      14505    23388    +8883     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 64.68% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copilot AI review requested due to automatic review settings May 20, 2026 10:26
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from da6d01c to 5977b22 Compare May 20, 2026 10:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread eng/pipelines/ci/package/sqlclient-package.yml
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from 5977b22 to ccfa6f8 Compare May 20, 2026 12:06
Copilot AI review requested due to automatic review settings May 20, 2026 12:12
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from ccfa6f8 to 98683d2 Compare May 20, 2026 12:12
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from 98683d2 to b1e3b65 Compare May 20, 2026 12:14
@paulmedynski paulmedynski changed the base branch from dev/paul/sql-server-project-refs to dev/paul/internals-package-mode May 20, 2026 12:15
@paulmedynski paulmedynski force-pushed the dev/paul/internals-package-mode branch 2 times, most recently from 2a46b0a to 2463f9a Compare May 20, 2026 15:34
Copilot AI review requested due to automatic review settings May 20, 2026 16:20
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from 9015ee3 to bef42de Compare May 20, 2026 16:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread eng/pipelines/sqlclient-pr-project-ref-pipeline.yml
Comment thread eng/pipelines/sqlclient-pr-package-ref-pipeline.yml
Comment thread eng/pipelines/ci/package/sqlclient-package.yml
@paulmedynski paulmedynski moved this from In review to In progress in SqlClient Board May 20, 2026
@paulmedynski paulmedynski force-pushed the dev/paul/internals-package-mode branch from e91096e to fd1a2ff Compare May 20, 2026 19:38
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from c07c795 to c6bf797 Compare May 21, 2026 11:06
@paulmedynski paulmedynski removed the DO NOT MERGE PRs that are created for test reasons, should not be merged. label May 21, 2026
Base automatically changed from dev/paul/internals-package-mode to main May 29, 2026 14:42
Copilot AI review requested due to automatic review settings May 29, 2026 14:48
@paulmedynski paulmedynski force-pushed the dev/paul/sqlclient-package branch from c6bf797 to 9868788 Compare May 29, 2026 14:48
@paulmedynski paulmedynski marked this pull request as ready for review May 29, 2026 14:49
@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board May 29, 2026
@paulmedynski paulmedynski enabled auto-merge (squash) May 29, 2026 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 3 out of 3 changed files in this pull request and generated no new comments.

@cheenamalhotra
Copy link
Copy Markdown
Member

cheenamalhotra commented May 29, 2026

This reminds me we should be building for a forward release, i.e. published packages should be named as '7.1.0-preview2.xxxxxx' instead of '7.1.0-preview1.xxxxxx'.

Once we have bumped up the versioning, we should also start publishing Nightly built packages to an ADO Artifact feed that's available to public as well - in public project. I don't know if running this pipeline in CI would be any help in long term, as Nightly build and publishing will serve its purpose.

Overall this pipeline is doing its job well, we just need to come on agreement with versioning bump to happen right after we release something (or with release notes), before the first 'vNext' nightly build is published.

Copy link
Copy Markdown
Member

@cheenamalhotra cheenamalhotra left a comment

Choose a reason for hiding this comment

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

A few minor changes I would suggest maybe now or future.

type: string
default: Release
values:
- Debug
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should not build in debug mode I think.

include:
- main
- internal/main
always: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we omit running this if there were no changes merged in last 24 hours?

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 review

Development

Successfully merging this pull request may close these issues.

6 participants