Add assembly signing for Microsoft.Data.SqlClient.Internal.Logging - #4567
Draft
paulmedynski wants to merge 1 commit into
Draft
Add assembly signing for Microsoft.Data.SqlClient.Internal.Logging#4567paulmedynski wants to merge 1 commit into
paulmedynski wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates CI pipelines to strong-name sign the Microsoft.Data.SqlClient.Internal.Logging assembly during internal package builds.
Changes:
- Threads signing and internal-build parameters through pipeline templates.
- Downloads the secure signing key for internal package builds.
- Passes
SigningKeyPathduring package creation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
eng/pipelines/stages/build-logging-package-ci-stage.yml |
Forwards signing-related parameters. |
eng/pipelines/jobs/pack-logging-package-ci-job.yml |
Downloads the key and signs internal packages. |
eng/pipelines/dotnet-sqlclient-ci-core.yml |
Connects core pipeline parameters to the logging stage. |
Suppressed comments (1)
eng/pipelines/jobs/pack-logging-package-ci-job.yml:132
- The linked PR metadata is not aligned with this change: issue #123 is about SQL Graph
SqlBulkCopycolumn mappings and PR #456 is about large UDT buffers, neither of which concerns signingMicrosoft.Data.SqlClient.Internal.Logging. Please replace these stale references with the relevant signing issue or remove them so the change remains traceable to the correct requirements.
buildProperties: SqlClientPackageVersion=${{ parameters.packageVersion }};BuildNumber=$(Build.BuildNumber);SigningKeyPath=$(driverKeyFile.secureFilePath)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
paulmedynski
force-pushed
the
dev/paul/assembly-signing-logging
branch
from
August 21, 2026 15:33
38d1007 to
98a4e2a
Compare
Thread referenceType and isInternalBuild into the Logging stage and pack job so the Logging package is strong-name signed on internal Package-mode builds. Abstractions references Logging, so Logging must be signed before Abstractions can be; a strong-named assembly referencing a weak-named one fails with CS8002, which is an error here because TreatWarningsAsErrors is enabled. Logging has no test project yet, so no test-assembly signing or signed InternalsVisibleTo grant is added.
paulmedynski
force-pushed
the
dev/paul/assembly-signing-logging
branch
from
August 24, 2026 17:59
98a4e2a to
798f983
Compare
| configurationToPack: ${{ parameters.buildConfiguration }} | ||
| packDirectory: $(dotnetPackagesDir) | ||
| verbosityToPack: ${{ parameters.dotnetVerbosity }} | ||
| buildProperties: SqlClientPackageVersion=${{ parameters.packageVersion }};BuildNumber=$(Build.BuildNumber);SigningKeyPath=$(driverKeyFile.secureFilePath) |
cheenamalhotra
added a commit
that referenced
this pull request
Aug 25, 2026
The required sqlclient-pr pipeline is failing only on tests unrelated to this change, in a pipeline with a ~48% baseline failure rate across other PRs. Observed failures, none of which touch any file in this PR: MARSTest.MarsScenarioClientJoin (also failed on PR #4567) SqlCommandCancelTest.TimeOutDuringRead_Tcp (timing sensitive) TransactionEnlistmentTest.TestManualEnlistment_Enlist (also failed on PR #4585) The /azp run comment trigger is not enabled on this repo, so refreshing the head SHA is the only available way to re-run the required checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cfc64bc6-a9e6-490d-88b1-4b78d25aa103
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.
What's This All About?
This is PR 2 of 6 in the assembly signing stack that builds on #4566.
The first 5 PRs in this stack are all about adding assembly signing and public-key-protected InternalsVisibleTo support to the legacy CI pipeline. This is infrastructure work necessary to support the Native AOT fix in the final PR.
We have never been including assembly signing in our CI, which IMO was a blind spot. Now, when CI runs in our internal ADO.Net project, all assemblies will be signed, we will be running tests against signed assemblies, and fully testing our nascent inter-assembly IVT just as it would be in a real app. Public project CI and all of our PR pipelines will continue to use unsigned assemblies, and testing that requires inter-assembly IVT will only be done in Project mode (PR, legacy CI Project-mode pipeline) or via internal CI with signed assemblies.
The 6th and final PR in the stack addresses the Native AOT issue #4193 by eliminating inter-assembly reflection and using signed IVT with proper package dependencies.
Description
This PR sets up assembly signing in the legacy CI pipeline for the Logging project.
Microsoft.Data.SqlClient.Internal.Loggingwas not receivingSigningKeyPathwhen it was packed by the internal, Package-reference CI flow. As a result, that package could be produced without the strong-name signing applied to the other internal package artifacts. Internal Package-mode builds need a consistent set of signed assemblies; public builds and Project-reference builds should continue to build without access to the internal signing key.This PR:
isInternalBuildandreferenceTypethrough the CI core, Logging stage, and Logging pack job;download-assembly-signing-key.ymlstep introduced in Add assembly signing for Microsoft.SqlServer.Server #4566 to fetch the driver key for internal Package-reference builds only;SigningKeyPathwhen packingMicrosoft.Data.SqlClient.Internal.Loggingonly for internal Package-reference builds; andSupplying
SigningKeyPathactivates the existing signing behavior insrc/Directory.Build.props; this PR does not change product source, public APIs, package contents beyond assembly signing, or compatibility behavior.Issues
Works towards addressing #4193.
Testing
This is a pipeline-only change, so no unit or integration tests were added.
The GitHub PR validation pipelines exercise the public Package-reference and Project-reference paths. The internal signing branch requires the ADO.Net secure file and is exercised only by an internal Package-reference pipeline run.
CI pipeline runs
The GitHub PR pipelines never set
isInternalBuild, so they always take the unsigned path. The CI runs below are what actually exercise this change, and together they cover all four quadrants of the signing matrix:The
Build Logging Packagestage succeeded in all four runs. TheDownload Driver Signing Keystep is present in exactly one of them - MDS Main CI-Package - which is the only quadrant that is supposed to sign.Artifact verification
The
Logging.Artifactspackage produced by each run was downloaded and inspected withtools/PackageValidator, which reads signing state from CLI metadata. It requires both a public key and theCorFlags.StrongNameSignedbit, so it distinguishes a fully signed assembly from a delay-signed one.Microsoft.Data.SqlClient.Internal.Loggingships a singlenetstandard2.0target.23ec7fc2d6eaa4a5Only the internal + Package quadrant is signed, it reports
Signedrather thanDelaySigned, and23ec7fc2d6eaa4a5is the SqlClient family public key token. PackageValidator'sunsignedfinding count across the four runs above is 1, 1, 1, and 0 respectively, dropping to zero only where signing is expected. All four runs also report onepackage-unsignedfinding, which refers to NuGet package signing rather than assembly signing and is expected for CI-produced packages in every quadrant.CI failures
The runs above report failures, but none are related to this change. All of them reproduce on
main-CI-SqlClient-Packagehas failed onrefs/heads/mainin each of its last five runs with the same signature:testJobTimeoutacross Win11, Win22, Ubuntu22, and Win11_ARM64;Configure SQL Server [macOS]step failing because thesql1container dies during startup (sqlservrcore dump), which in turn failsPublish Test Artifactswith a missingTestResultsdirectory; andTransactionPoolTest.TransactionCleanupTestandDistributedTransactionTestWindows.Test_EnlistedTransactionPreservedWhilePooled(56 failures against 377,807 passes).None of these touch strong naming, IVT, or packaging. The failed jobs have been retried.