Skip to content

Commit 2951807

Browse files
stephentoubCopilot
andauthored
Improve .NET SDK build infrastructure and documentation (#643)
* Improve .NET SDK build infrastructure and documentation - 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 * Exclude nodejs/scripts/ from Node.js SDK test triggers 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> * Mock sendRequest in session.resume unit tests 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> * Fix PermissionRequestResultKind type in custom-agents docs 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> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 207b85b commit 2951807

30 files changed

+824
-181
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Set up .NET
5959
uses: actions/setup-dotnet@v5
6060
with:
61-
dotnet-version: "8.0.x"
61+
dotnet-version: "10.0.x"
6262

6363
# Install just command runner
6464
- name: Install just

.github/workflows/docs-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108

109109
- uses: actions/setup-dotnet@v5
110110
with:
111-
dotnet-version: "8.0.x"
111+
dotnet-version: "10.0.x"
112112

113113
- name: Install validation dependencies
114114
working-directory: scripts/docs-validation

.github/workflows/dotnet-sdk-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions/checkout@v6.0.2
4444
- uses: actions/setup-dotnet@v5
4545
with:
46-
dotnet-version: "8.0.x"
46+
dotnet-version: "10.0.x"
4747
- uses: actions/setup-node@v6
4848
with:
4949
node-version: "22"

.github/workflows/nodejs-sdk-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'nodejs/**'
1313
- 'test/**'
1414
- '.github/workflows/nodejs-sdk-tests.yml'
15+
- '!nodejs/scripts/**'
1516
- '!**/*.md'
1617
- '!**/LICENSE*'
1718
- '!**/.gitignore'

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- uses: actions/checkout@v6.0.2
122122
- uses: actions/setup-dotnet@v5
123123
with:
124-
dotnet-version: "8.0.x"
124+
dotnet-version: "10.0.x"
125125
- name: Restore dependencies
126126
run: dotnet restore
127127
- name: Build and pack

.github/workflows/scenario-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152

153153
- uses: actions/setup-dotnet@v5
154154
with:
155-
dotnet-version: "8.0.x"
155+
dotnet-version: "10.0.x"
156156

157157
- uses: actions/cache@v4
158158
with:

.github/workflows/update-copilot-dependency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- uses: actions/setup-dotnet@v5
4040
with:
41-
dotnet-version: "8.0.x"
41+
dotnet-version: "10.0.x"
4242

4343
- name: Update @github/copilot in nodejs
4444
env:

dotnet/Directory.Build.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<LangVersion>14</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<AnalysisLevel>10.0-minimum</AnalysisLevel>
9+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
10+
</PropertyGroup>
11+
12+
</Project>

dotnet/Directory.Packages.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
9+
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.2.0" />
10+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.2" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
12+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.102" />
13+
<PackageVersion Include="StreamJsonRpc" Version="2.24.84" />
14+
<PackageVersion Include="System.Text.Json" Version="10.0.2" />
15+
<PackageVersion Include="xunit" Version="2.9.3" />
16+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
17+
</ItemGroup>
18+
19+
</Project>

dotnet/global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100",
4+
"rollForward": "major"
5+
}
6+
}

0 commit comments

Comments
 (0)