Skip to content

Improve .NET SDK build infrastructure and documentation#643

Merged
patniko merged 5 commits intogithub:mainfrom
stephentoub:stoub/updatedotnetbuild
Mar 5, 2026
Merged

Improve .NET SDK build infrastructure and documentation#643
patniko merged 5 commits intogithub:mainfrom
stephentoub:stoub/updatedotnetbuild

Conversation

@stephentoub
Copy link
Collaborator

  • Add Central Package Management (Directory.Packages.props) with all package versions centralized
  • Add Directory.Build.props with shared properties (TargetFramework, ImplicitUsings, Nullable, TreatWarningsAsErrors)
  • Add nuget.config with single nuget.org source and package source mapping (required by CPM)
  • Add global.json specifying .NET 10 SDK (the library is still built with a net8.0 TFM)
  • Update all CI workflows from .NET 8.0.x to .NET 10.0.x
  • Enable XML documentation file generation (GenerateDocumentationFile) so that comments are validated and IntelliSense docs are generated
  • Add XML doc comments to all non-generated public types and members
  • Add valid-value lists in XML docs for string properties with known values (e.g. PermissionRequest.Kind, ToolResultObject.ResultType)
  • Add #pragma warning disable CS1591 to generated files (SessionEvents.cs, Rpc.cs) and codegen scripts
  • Enable EmbedUntrackedSources, IncludeSymbols, SymbolPackageFormat
  • Enable ContinuousIntegrationBuild conditional on CI/TF_BUILD environment variables
  • Add PackageProjectUrl to package metadata
  • Add [EditorBrowsable(Never)] to obsolete GithubToken property
  • Upgrade analysis level and fix some diagnostics

@stephentoub stephentoub requested a review from a team as a code owner March 3, 2026 17:41
Copilot AI review requested due to automatic review settings March 3, 2026 17:41
@stephentoub stephentoub enabled auto-merge March 3, 2026 17:45
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

This PR modernizes the .NET SDK’s build/tooling setup (centralized package/version management, updated SDK tooling in CI) and improves public API documentation by enabling XML doc generation and adding XML docs across the SDK (with CS1591 suppression for generated code).

Changes:

  • Introduce Central Package Management + shared build props (TFM/lang/analyzers/warnings-as-errors) and add NuGet source mapping + dotnet/global.json.
  • Update CI workflows to use .NET 10 SDK and adjust codegen to suppress CS1591 in generated C# files.
  • Add/expand XML documentation across public .NET SDK types and tighten some implementation details (logging, parsing, small refactors).

Reviewed changes

Copilot reviewed 25 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/codegen/csharp.ts Suppress CS1591 in generated C# and tweak default initializers for generated types.
nodejs/scripts/update-protocol-version.ts Adjust generated C# protocol version constant visibility.
dotnet/test/ToolsTests.cs Test refactors and modern C# syntax changes (incl. permission handler).
dotnet/test/SessionTests.cs Use collection expressions for AvailableTools/ExcludedTools in tests.
dotnet/test/Harness/E2ETestContext.cs Seal type + expand expression-bodied members for style/analyzer compliance.
dotnet/test/Harness/E2ETestBase.cs Expand expression-bodied members and update collection initialization style.
dotnet/test/Harness/CapiProxy.cs Seal type + collection expression usage and expanded DisposeAsync.
dotnet/test/GitHub.Copilot.SDK.Test.csproj Move package versions to CPM (remove Version=...).
dotnet/test/ClientTests.cs Minor test cleanup (collection expressions, ThrowsAsync simplification).
dotnet/src/Types.cs Add extensive XML docs and modernize initializers; adjust API metadata attributes.
dotnet/src/Session.cs Seal session class + refactors (handlers, initializers, formatting).
dotnet/src/SdkProtocolVersion.cs Hide constant and expose accessor; formatting changes.
dotnet/src/GitHub.Copilot.SDK.csproj Enable XML docs + add pack/sourcelink/CI build metadata; move to CPM.
dotnet/src/Generated/SessionEvents.cs Suppress CS1591 and small formatting changes.
dotnet/src/Generated/Rpc.cs Suppress CS1591 and update empty collection initialization style.
dotnet/src/Client.cs Seal client class + logging/formatting/culture tweaks; regex source-gen; minor refactors.
dotnet/samples/Chat.csproj Remove duplicated per-project props now covered by Directory.Build.props.
dotnet/nuget.config Add single source + package source mapping for CPM.
dotnet/global.json Pin .NET SDK selection for dotnet/ folder builds.
dotnet/Directory.Packages.props Centralize NuGet package versions for dotnet projects.
dotnet/Directory.Build.props Centralize shared build settings (TFM, LangVersion, analyzers, warnings-as-errors).
.github/workflows/update-copilot-dependency.yml Update CI to install .NET 10.
.github/workflows/scenario-builds.yml Update CI to install .NET 10.
.github/workflows/publish.yml Update CI to install .NET 10.
.github/workflows/dotnet-sdk-tests.yml Update CI to install .NET 10.
.github/workflows/docs-validation.yml Update CI to install .NET 10.
.github/workflows/copilot-setup-steps.yml Update CI to install .NET 10.

- Add Central Package Management (Directory.Packages.props) with all package versions centralized
- Add Directory.Build.props with shared properties (TargetFramework, ImplicitUsings, Nullable, TreatWarningsAsErrors)
- Add nuget.config with single nuget.org source and package source mapping (required by CPM)
- Add global.json specifying .NET 10 SDK (the library is still built with a net8.0 TFM)
- Update all CI workflows from .NET 8.0.x to .NET 10.0.x
- Enable XML documentation file generation (GenerateDocumentationFile)
- Add XML doc comments to all non-generated public types and members
- Add valid-value lists in XML docs for string properties with known values (e.g. PermissionRequest.Kind, ToolResultObject.ResultType)
- Add #pragma warning disable CS1591 to generated files (SessionEvents.cs, Rpc.cs) and codegen scripts
- Enable EmbedUntrackedSources, IncludeSymbols, SymbolPackageFormat
- Enable ContinuousIntegrationBuild conditional on CI/TF_BUILD environment variables
- Add PackageProjectUrl to package metadata
- Add [EditorBrowsable(Never)] to obsolete GithubToken property
- Upgrade analysis level and fix some diagnostics
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 25 out of 27 changed files in this pull request and generated no new comments.

stephentoub and others added 2 commits March 3, 2026 20:48
Changes to development utility scripts (codegen, protocol version updates)
should not trigger the Node.js test suite, as they don't affect SDK runtime
code and the workflow fails on fork PRs that lack the COPILOT_HMAC_KEY secret.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These tests verify that the correct parameters are forwarded to the RPC
call, not that the CLI handles them. Mock sendRequest (like the setModel
test already does) so the tests don't depend on CLI authentication,
which is unavailable on fork PRs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@patniko
Copy link
Contributor

patniko commented Mar 5, 2026

@stephentoub mind resolving conflicts? Happy to take this after the checks clear.

…uild

# Conflicts:
#	dotnet/src/Types.cs
#	dotnet/test/Harness/E2ETestContext.cs
#	dotnet/test/ToolsTests.cs
#	nodejs/test/client.test.ts
@stephentoub
Copy link
Collaborator Author

@stephentoub mind resolving conflicts? Happy to take this after the checks clear.

Done, thanks

Use PermissionRequestResultKind.Approved instead of string literal
"approved" to match the strongly-typed struct in the .NET SDK.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@patniko patniko disabled auto-merge March 5, 2026 04:31
@patniko patniko enabled auto-merge March 5, 2026 04:31
@patniko patniko added this pull request to the merge queue Mar 5, 2026
Merged via the queue into github:main with commit 2951807 Mar 5, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants