Skip to content

Add API documentation generation for the Logging package#4021

Merged
apoorvdeshmukh merged 6 commits intomainfrom
dev/ad/api-docs-logging
Mar 11, 2026
Merged

Add API documentation generation for the Logging package#4021
apoorvdeshmukh merged 6 commits intomainfrom
dev/ad/api-docs-logging

Conversation

@apoorvdeshmukh
Copy link
Contributor

@apoorvdeshmukh apoorvdeshmukh commented Mar 9, 2026

Description

Adds XML documentation comments to all public APIs in Microsoft.Data.SqlClient.Extensions.Logging and configures the project to generate, preserve, and trim XML documentation — following the same patterns used by the main Microsoft.Data.SqlClient package.

Issues

AB#42969

Changes

Added <GenerateDocumentationFile>true</GenerateDocumentationFile> so the compiler generates an XML doc file alongside the assembly. SDK Pack automatically includes it in the NuGet package under lib/<tfm>/.
Added SaveUntrimmedDocs target — copies the full (untrimmed) XML documentation to artifacts/doc/<tfm>/ after build, preserving <remarks> and <example> content for public documentation workflows (e.g., API Drop → Content CI → dotnet/sqlclient-api-docs).
Added TrimDocsForIntelliSense target — runs TrimDocs.ps1 to strip and nodes from the in-place XML file so the NuGet package ships a cleaner IntelliSense experience, matching how the main MDS package handles this.
Added <summary>, <param>, <typeparam>, <returns>, and <remarks> tags to all ~80+ public members across:
SqlClientEventSource.cs — class-level docs with and , all Enable/Disable methods, Trace overloads (with and without if guards), Scope enter/leave methods, Execution Trace, Notification Trace/Scope, Pooler Trace/Scope, Advanced Trace/Scope/Bin/Error, Correlation Trace, State Dump, SNI Trace/Scope, and all WriteEvent methods

Notes

No pipeline changes needed: SDK Pack automatically includes the XML doc file in the NuGet package when GenerateDocumentationFile is set. Both the CI pipeline (pack-logging-package-ci-job.yml) and the OneBranch official pipeline use dotnet pack, which handles this natively.

@apoorvdeshmukh apoorvdeshmukh requested a review from a team as a code owner March 9, 2026 12:24
Copilot AI review requested due to automatic review settings March 9, 2026 12:24
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 9, 2026
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

Adds XML documentation support to the Microsoft.Data.SqlClient.Extensions.Logging package by enabling compiler-generated XML docs, preserving a full “untrimmed” copy for doc workflows, and trimming the packaged IntelliSense XML to remove <remarks>/<example> content.

Changes:

  • Added XML doc comments to public APIs in SqlClientEventSource.
  • Updated Logging.csproj to generate XML documentation and added build targets to copy untrimmed docs to artifacts/doc/<tfm>/ and then trim the in-place XML file.
  • Minor project metadata formatting tweaks (e.g., package description wrapping).

Reviewed changes

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

File Description
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs Adds/updates XML documentation comments across public APIs for the Logging EventSource.
src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj Enables XML doc generation and introduces post-build targets to preserve and trim XML docs for packaging/IntelliSense.

@paulmedynski paulmedynski moved this from To triage to In review in SqlClient Board Mar 9, 2026
@paulmedynski paulmedynski added this to the 7.0.0 milestone Mar 9, 2026
@paulmedynski paulmedynski added the Area\Documentation Use this for issues that requires changes in public documentations/samples. label Mar 9, 2026
@paulmedynski paulmedynski self-assigned this Mar 9, 2026
Copy link
Contributor

@paulmedynski paulmedynski left a comment

Choose a reason for hiding this comment

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

Lookg good overall! Just a few comments/questions.

@github-project-automation github-project-automation bot moved this from In review to In progress in SqlClient Board Mar 9, 2026
Copilot AI review requested due to automatic review settings March 9, 2026 16:46
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 2 out of 2 changed files in this pull request and generated 2 comments.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.46%. Comparing base (326a242) to head (2e8d69a).
⚠️ Report is 5 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (326a242) and HEAD (2e8d69a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (326a242) HEAD (2e8d69a)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4021      +/-   ##
==========================================
- Coverage   72.65%   67.46%   -5.19%     
==========================================
  Files         287      282       -5     
  Lines       43134    67142   +24008     
==========================================
+ Hits        31337    45298   +13961     
- Misses      11797    21844   +10047     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 67.46% <ø> (?)

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.

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.

I may be missing something, but I grabbed the npkg file from the PR-package pipeline and it still includes remarks comments. I also do not see an untrimmed artifact uploaded to the pipeline artifacts or included in the package.

@apoorvdeshmukh
Copy link
Contributor Author

I may be missing something, but I grabbed the npkg file from the PR-package pipeline and it still includes remarks comments. I also do not see an untrimmed artifact uploaded to the pipeline artifacts or included in the package.

MDS package has untrimmed documentation xml files under lib and contains documentation for IntelliSense under ref directory. The logging package contains only lib directory from which the api docs will be generated so it needs to be untrimmed. The TrimDocsForIntelliSense does not make sense for this package. I'll revert the changes made there.
For MDS package we do not publish untrimmed documentation as a seaparate artifact but is included in the package itself.
For logging package, the untrimmed documentation xml is within the lib/ directory in the package.

@apoorvdeshmukh apoorvdeshmukh requested a review from mdaigle March 10, 2026 04:23
@apoorvdeshmukh apoorvdeshmukh requested a review from mdaigle March 11, 2026 17:07
@apoorvdeshmukh apoorvdeshmukh merged commit 3f9246c into main Mar 11, 2026
296 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in SqlClient Board Mar 11, 2026
@apoorvdeshmukh apoorvdeshmukh deleted the dev/ad/api-docs-logging branch March 11, 2026 19:32
This was referenced Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Documentation Use this for issues that requires changes in public documentations/samples.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants