Skip to content

Comments

Introduce Logging package and rework official pipelines#3967

Open
cheenamalhotra wants to merge 56 commits intomainfrom
dev/cheena/logging-package
Open

Introduce Logging package and rework official pipelines#3967
cheenamalhotra wants to merge 56 commits intomainfrom
dev/cheena/logging-package

Conversation

@cheenamalhotra
Copy link
Member

Summary

Moves the ETW SqlClientEventSource tracing infrastructure (~1,180 lines) from the core driver into a new Microsoft.Data.SqlClient.Extensions.Logging (netstandard2.0) NuGet package. This enables independent versioning and shared use across SqlClient and the AKV provider (which had its own AKVEventSource, now deleted).

Key Changes

Area What Changed
New package Microsoft.Data.SqlClient.Extensions.Logging — contains SqlClientEventSource, SqlClientMetrics, SqlClientEventScope, and scope types
Core driver SqlClientEventSource.cs reduced to a ~43-line SqlClientDiagnostics bridge; 28 source files updated from TryEventScope/TrySNIEventScopeSqlClientEventScope
AKV provider Deleted AKVEventSource.cs; AKV now uses the shared SqlClientEventSource.Log from the Logging package
Build build.proj gains Logging targets; nuspec files add Logging dependency across all TFMs
Pipelines Consolidated into unified OneBranch official/non-official pipelines with selective build params, approval service, ESRP signing for Logging, reusable publish job with dry-run; deleted 9 standalone pipeline/variable files
Docs Added PackageReadme.md for all 6 packages; new OneBranch pipeline design spec (522 lines); updated AGENTS.md

Checklist

  • No breaking changes — logging behavior preserved via the extracted package as a dependency

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

Copilot AI review requested due to automatic review settings February 20, 2026 06:11
Copy link
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 100 out of 100 changed files in this pull request and generated 3 comments.

<_OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' != ''">$(AbstractionsPackageVersion.Split('-')[0])</_OurAssemblyFileVersion>
<!-- If neither property is set, use the default value.-->
<_OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' == ''">$(AbstractionsDefaultMajorVersion).0.0.$(BuildNumber)</_OurAssemblyFileVersion>
<_OurAssemblyFileVersion Condition="'$(AbstractionsAssemblyFileVersion)' == '' and '$(AbstractionsPackageVersion)' == ''">$(AbstractionsDefaultMajorVersion).0.0.$(AssemblyBuildNumber)</_OurAssemblyFileVersion>
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The AssemblyBuildNumber property is used here but is defined in tools/props/Versions.props. This creates an import order dependency: Versions.props must be imported before this file for AssemblyBuildNumber to be defined. Verify that the import order in all consuming projects ensures Versions.props is imported first, or consider defining a fallback value here if AssemblyBuildNumber is empty.

Copilot uses AI. Check for mistakes.
<_OurAssemblyFileVersion Condition="'$(AzureAssemblyFileVersion)' == '' and '$(AzurePackageVersion)' != ''">$(AzurePackageVersion.Split('-')[0])</_OurAssemblyFileVersion>
<!-- If neither property is set, use the default value.-->
<_OurAssemblyFileVersion Condition="'$(AzureAssemblyFileVersion)' == '' and '$(AzurePackageVersion)' == ''">$(AzureDefaultMajorVersion).0.0.$(BuildNumber)</_OurAssemblyFileVersion>
<_OurAssemblyFileVersion Condition="'$(AzureAssemblyFileVersion)' == '' and '$(AzurePackageVersion)' == ''">$(AzureDefaultMajorVersion).0.0.$(AssemblyBuildNumber)</_OurAssemblyFileVersion>
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The AssemblyBuildNumber property is used here but is defined in tools/props/Versions.props. This creates an import order dependency: Versions.props must be imported before this file for AssemblyBuildNumber to be defined. Verify that the import order in all consuming projects ensures Versions.props is imported first, or consider defining a fallback value here if AssemblyBuildNumber is empty.

Copilot uses AI. Check for mistakes.
<!-- If LoggingPackageVersion is set, use its trimmed value. -->
<_OurAssemblyFileVersion Condition="'$(LoggingAssemblyFileVersion)' == '' and '$(LoggingPackageVersion)' != ''">$(LoggingPackageVersion.Split('-')[0])</_OurAssemblyFileVersion>
<!-- If neither property is set, use the default value.-->
<_OurAssemblyFileVersion Condition="'$(LoggingAssemblyFileVersion)' == '' and '$(LoggingPackageVersion)' == ''">$(LoggingDefaultMajorVersion).0.0.$(AssemblyBuildNumber)</_OurAssemblyFileVersion>
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The AssemblyBuildNumber property is used here but is defined in tools/props/Versions.props. This creates an import order dependency: Versions.props must be imported before this file for AssemblyBuildNumber to be defined. Verify that the import order in all consuming projects ensures Versions.props is imported first, or consider defining a fallback value here if AssemblyBuildNumber is empty.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 20, 2026 17:22
Copy link
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 121 out of 122 changed files in this pull request and generated 2 comments.

Comment on lines +26 to +37
<PackageVersion
Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider"
Version="$(AkvPackageVersion)" />
<PackageVersion
Include="Microsoft.Data.SqlClient.Extensions.Abstractions"
Version="$(AbstractionsPackageVersion)" />
<PackageVersion
Include="Microsoft.Data.SqlClient.Extensions.Azure"
Version="$(AzurePackageVersion)" />
<PackageVersion
Include="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider"
Version="$(AkvPackageVersion)" />
Include="Microsoft.Data.SqlClient.Extensions.Logging"
Version="$(LoggingPackageVersion)" />
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The package ordering has been changed to place Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider before the Extensions packages. For consistency with the rest of the file (alphabetical ordering within logical groups), consider either keeping the original order or documenting the reason for this specific ordering if it's intentional.

Copilot uses AI. Check for mistakes.
build.proj Outdated
<Target Name="BuildAll" DependsOnTargets="BuildNetFx;BuildNetCore;BuildNetStandard" />
<Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;GenerateMdsPackage" />
<Target Name="BuildAll" DependsOnTargets="BuildNetFx;BuildNetCore;BuildNetStandard;BuildLogging;BuildAzure" />
<Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;BuildLogging;BuildSqlServerPackage;GenerateMdsPackage" />
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The PackAbstractions target was split out from BuildAbstractions, but the BuildAllConfigurations target chain doesn't appear to call PackAbstractions, PackLogging, or PackAzure. This means the Pack step won't run during BuildAllConfigurations. Verify whether this is intentional or if these Pack targets should be added to the dependency chain.

Suggested change
<Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;BuildLogging;BuildSqlServerPackage;GenerateMdsPackage" />
<Target Name="BuildAllConfigurations" DependsOnTargets="Restore;BuildTools;BuildSqlServerLib;BuildNetFx;BuildNetCoreAllOS;BuildNetStandard;BuildLogging;BuildSqlServerPackage;GenerateMdsPackage;PackAbstractions;PackLogging;PackAzure" />

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings February 20, 2026 17:49
Copy link
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 121 out of 122 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 20, 2026 19:25
Copy link
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 125 out of 126 changed files in this pull request and generated 3 comments.

Comment on lines 113 to +116
- template: /eng/pipelines/common/templates/steps/copy-dlls-for-test-step.yml@self
parameters:
softwareFolder: '${{ parameters.softwareFolder }}'
symbolsFolder: '${{ parameters.symbolsFolder }}'
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The step at line 113 includes a comment "Copy DLLs and PDBs to the software and symbols folders for APIScan and testing." but the template invocation doesn't show any actual copy operations visible in this diff. Verify that the compound-step template at copy-dlls-for-test-step.yml actually performs the copy operations needed for APIScan and that the softwareFolder and symbolsFolder parameters are correctly wired through.

Copilot uses AI. Check for mistakes.
Comment on lines 40 to 49
@@ -43,8 +49,9 @@ steps:
Pattern: '${{ parameters.pattern }}'
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The ESRP task versions were upgraded from v5 to v6 (EsrpMalwareScanning@6 and EsrpCodeSigning@6). Ensure that the new task versions are compatible with the current OneBranch pipeline configuration and that all required parameters are still supported. Review the breaking changes documentation for ESRP v5→v6 migration.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
- job: build_package_SqlClient
displayName: 'Build Microsoft.Data.SqlClient'
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The job name changed from build_signed_package to build_package_SqlClient, but validate-signed-package-job.yml references the old job name via stageDependencies.build_dependent.build_package_SqlClient. However, the stage name appears to be buildMDS in the old code (line 35 shows the old reference). Verify that the stage name has also been updated to build_dependent in the calling pipeline, otherwise this job dependency will fail at runtime.

Copilot uses AI. Check for mistakes.
- Replaced copy scripts with CopyFiles@2 tasks.
Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

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

It may work as a whole, but this is a tough one to review because there are so many ideas combined into one changeset. I'd really like to see pieces broken out so that they can be effectively reviewed.

- task: DownloadPipelineArtifact@2
displayName: 'Download Abstractions Package'
inputs:
artifactName: drop_build_independent_build_package_Abstractions
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably best to have these come in as parameters. We don't have control over this artifact name and it could change in the future. The package step for the independent packages should output these values and then the pipeline should pass them in to this step. The ci-build-nugets-job.yml file is already doing this.

type: string
default: MSSQLSERVER

# User.
Copy link
Contributor

Choose a reason for hiding this comment

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

None of these comments are really adding any value and they're greatly expanding the diff.

parameters:
debug: ${{ parameters.debug }}

# We use the 'custom' command because the DotNetCoreCLI@2 task doesn't
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little suspicious of this. It's a big pain to maintain multi-step builds all over the place. All of these supporting packages, should be buildable with a single dotnet pack command.

value: >-
$(commonArguments)
--configuration ${{ parameters.buildConfiguration }}
-p:LoggingPackageVersion=${{ parameters.loggingPackageVersion }}
Copy link
Contributor

Choose a reason for hiding this comment

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

✏️ I think all of these package jobs could be factored out into a generic package job that takes package and assembly file version numbers as params. We could avoid a ton of extra stage and job files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should move to src folder like other readmes

Copy link
Contributor

Choose a reason for hiding this comment

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

should move to src folder with other readmes

- Fixed inconsistent/inaccurate official pipeline variable names.
Copilot AI review requested due to automatic review settings February 22, 2026 22:09
Copy link
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 124 out of 125 changed files in this pull request and generated no new comments.

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. Public API 🆕 Issues/PRs that introduce new APIs to the driver.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants