Add API documentation generation for the Logging package#4021
Add API documentation generation for the Logging package#4021apoorvdeshmukh merged 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
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.csprojto generate XML documentation and added build targets to copy untrimmed docs toartifacts/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. |
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
paulmedynski
left a comment
There was a problem hiding this comment.
Lookg good overall! Just a few comments/questions.
src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/Logging.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient.Extensions/Logging/src/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests.
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mdaigle
left a comment
There was a problem hiding this comment.
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 |
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 underlib/<tfm>/.Added
SaveUntrimmedDocstarget — copies the full (untrimmed) XML documentation toartifacts/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.ps1to 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
GenerateDocumentationFileis set. Both the CI pipeline (pack-logging-package-ci-job.yml) and the OneBranch official pipeline use dotnet pack, which handles this natively.