Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
268230b
Drop .NET 8 and 9 target frameworks; pick up .NET 10
AArnott Oct 5, 2026
1169d5e
Fix NativeAOT metadata update in target
AArnott Nov 3, 2026
ade7976
Merge remote-tracking branch 'origin/main' into microbuild
AArnott Nov 3, 2026
e63c156
Merge the microbuild branch from https://github.com/aarnott/Library.T…
AArnott Nov 3, 2026
af2fa6f
Adapt CONTRIBUTING to azp files
AArnott Nov 3, 2026
4020c62
Update Markup Link Checker to version 1.3.0
AArnott Nov 4, 2026
622e99d
Trust the Copilot environment for Azure OIDC authentication
AArnott Nov 4, 2026
134b0af
Update mcr.microsoft.com/dotnet/sdk:10.0.403 Docker digest to 212fe4c…
renovate[bot] Nov 6, 2026
230d0a0
Update dependency PolySharp to 1.17.0 (#617)
renovate[bot] Nov 9, 2026
8949674
Update xunit to 4.0.3 (#616)
renovate[bot] Nov 9, 2026
b2e3f5e
Merge remote-tracking branch 'origin/main' into nov-2026
AArnott Nov 9, 2026
4c05bba
Stop template expansion from adding referenced projects twice
cursor[bot] Nov 9, 2026
e414681
Pin the .NET 11 GA SDK
cursor[bot] Nov 10, 2026
1216765
Update the devcontainer to the .NET 11 GA SDK image
AArnott Nov 10, 2026
a200741
Merge pull request #618 from AArnott/nov-2026
AArnott Nov 10, 2026
efe4c4b
Merge remote-tracking branch 'origin/main' into microbuild
AArnott Nov 11, 2026
5fc9c76
Revert "Update dependency PolySharp to 1.17.0 (#617)"
AArnott Nov 11, 2026
28f1cb9
Revert "Update xunit to 4.0.3 (#616)"
AArnott Nov 11, 2026
73411ea
Bump dotnet-symbols to 10.0.755903
AArnott Nov 11, 2026
5f0cb52
Merge Library.Template updates
invalid-email-address Nov 11, 2026
b288e8c
Use dotnet-symbol version available to CI feed
invalid-email-address Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/skills/testing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ dotnet test --no-build -c Release -- --treenode-filter "/*/*/*/*[PropertyName=va

**Run tests for a specific framework only**:
```bash
dotnet test --no-build -c Release --framework net8.0
dotnet test --no-build -c Release --framework net10.0
```

**List all available tests without running them**:
```bash
dotnet run --no-build -c Release --framework net8.0 -- --list-tests
dotnet run --no-build -c Release --framework net10.0 -- --list-tests
```

**Key points about test filtering with TUnit / MTP v2**:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: 🔗 Markup Link Checker (mlc)
uses: becheran/mlc@b0d0d353e04fcbcfd1d86716103d78a61e5b25dd # v1.2.2
uses: becheran/mlc@d791bd6ae91ea883f02172e21f453ba8da45dfcd # v1.3.0
- name: Authenticate to Azure with GitHub OIDC
id: azure-login
# This tenant requires enterprise-issued assertions. Other owners restore anonymously.
Expand Down
30 changes: 21 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ Run `dotnet publish tools/dirs.proj -c Release` to publish the shipping-library
Then run `./tools/dotnet-test-cloud.ps1 -Configuration Release -IncludeNativeAOT` to run managed TUnit tests and the published NativeAOT tests.
The traversal projects discover projects under `src` and `test`; `test/AotCompatibilityTest` compiles the shipping assembly with NativeAOT, while `-IncludeNativeAOT` runs eligible test executables. These are separate validations.
Keep test projects in the solution as well: managed test runs still use the solution, while the traversal handles NativeAOT publishing.
The test projects remain managed because the Moq-based tests and Roslyn analyzer tests rely on runtime code generation or dynamic composition.`nTest projects can opt out of NativeAOT publishing with `<PublishNativeAOTTests>false</PublishNativeAOTTests>`.
The test projects remain managed because the Moq-based tests and Roslyn analyzer tests rely on runtime code generation or dynamic composition.

Test projects can opt out of NativeAOT publishing with `<PublishNativeAOTTests>false</PublishNativeAOTTests>`.
Shipping libraries targeting .NET 8 or later opt into NativeAOT compatibility analysis with `IsAotCompatible`.
Add each NativeAOT-compatible shipping assembly as a `TrimmerRootAssembly` in `test/AotCompatibilityTest`, and keep this project publishable in `test/dirs.proj`.
Root `Directory.Build.props` supplies project-reference defaults for both traversal and SDK projects that remove the `_IsPublishing` global property for managed dependencies, avoiding duplicate project instances that write to the same outputs during parallel publishing.
Expand All @@ -76,15 +78,16 @@ API and hand-written docs are found under the `docfx/` directory and are built b
You can make changes and host the site locally to preview them by switching to that directory and running the `dotnet docfx --serve` command.
After making a change, you can rebuild the docs site while the localhost server is running by running `dotnet docfx` again from a separate terminal.

DocFX metadata extraction suppresses `NU1901` through `NU1904` in `docfx/docfx.json` to match the nonfatal NuGet audit warning policy in `.github/workflows/build.yml`.
DocFX metadata extraction suppresses `NU1901` through `NU1904` in `docfx/docfx.json` to match the nonfatal NuGet audit warning policy in `azure-pipelines/dotnet.yml`.
DocFX otherwise turns MSBuild workspace warnings into fatal documentation warnings under `--warningsAsErrors`.
Normal builds still report these audit warnings, and other documentation warnings remain fatal in CI.

The `.github/workflows/docs.yml` GitHub Actions workflow publishes the content of these docs to github.io if the workflow itself and [GitHub Pages is enabled for your repository](https://docs.github.com/en/pages/quickstart).

### Documentation validation feed authentication
### Documentation validation and Copilot feed authentication

The `.github/workflows/docs_validate.yml` workflow uses GitHub OIDC to authenticate
The `.github/workflows/docs_validate.yml` and `.github/workflows/copilot-setup-steps.yml`
workflows use GitHub OIDC to authenticate
as the **azure-public/vside package pull** Entra application before `init.ps1` restores packages.
It requests an Azure DevOps access token and supplies it through
`NuGetPackageSourceCredentials_<source name>` for each Azure Artifacts source in
Expand All @@ -98,19 +101,28 @@ Sign in with `gh auth login` and
`az login --tenant 72f988bf-86f1-41af-91ab-2d7cd011db47 --allow-no-subscriptions` first.
The signed-in identities need repository administration and permission to manage the app's
federated credentials. Use `-WhatIf` to preview without making changes.
The script discovers the calling repository, trusts pull requests plus its default branch,
and can be rerun without duplicating credentials.
The script discovers the calling repository, trusts pull requests, its default branch,
and the `copilot` environment used by Copilot code review and cloud agent setup.
It can be rerun without duplicating credentials.
Use `-Branches microbuild,release` to add other trusted branches; the default branch
and PR context are always included. The script reports each created or reused credential.
Credential names identify the owner, repository, and PR or branch context, for example
`github-AArnott-Library.Template-pull-request` and
and the PR and Copilot environment contexts are always included.
The script reports each created or reused credential.
Credential names identify the owner, repository, and PR, environment, or branch context, for example
`github-AArnott-Library.Template-pull-request`,
`github-AArnott-Library.Template-environment-copilot`, and
`github-AArnott-Library.Template-branch-main`. Names requiring punctuation replacement
or truncation include a short hash suffix to preserve uniqueness within Entra's name limits.

This changes OIDC subjects for **all workflows** in the repository. Update any other cloud
trust policies (including environment subjects) before running it; existing Entra credentials
are preserved. The script does not configure Azure DevOps feed permissions.

For repositories configured before Copilot environment trust was included, rerun the script
with any additional trusted branches retained, then re-request the Copilot review.
Copilot setup runs use an OIDC subject ending in `:environment:copilot`, rather than the
PR or branch subject, so those existing credentials alone do not authenticate Copilot.
Without the environment credential, Azure login fails with `AADSTS700213` before package restore.

Authentication is enabled only for repositories owned by the `microsoft` organization,
because this Entra tenant requires enterprise-issued GitHub assertions.
Same-repository dependency update PRs, including Renovate and Dependabot, authenticate
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</PropertyGroup>

<PropertyGroup>
<LangVersion Condition="'$(MSBuildProjectExtension)'=='.csproj'">14</LangVersion>
<LangVersion Condition="'$(MSBuildProjectExtension)'=='.csproj'">15</LangVersion>
<LangVersion Condition="'$(MSBuildProjectExtension)'=='.vbproj'">16.9</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.403",
"version": "11.0.100",
"rollForward": "patch",
"allowPrerelease": false
},
Expand Down
2 changes: 1 addition & 1 deletion test/dirs.proj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</MSBuild>
<ItemGroup>
<!-- MSBuild copies reference metadata to returned items; native publishes must retain _IsPublishing. -->
<_NativeAOTTest Update="@(_NativeAOTTest)" UndefineProperties=""
<_NativeAOTTest UndefineProperties=""
AdditionalProperties="TargetFramework=%(_NativeAOTTest.TargetFramework)" />
</ItemGroup>
</Target>
Expand Down
7 changes: 5 additions & 2 deletions tools/Configure-GitHubOidc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
belong to this tenant.
.PARAMETER Branches
Additional branches to trust. Pull requests and the repository's default
branch are always included.
branch are always included, along with the copilot environment used by
Copilot code review and cloud agent setup.
.EXAMPLE
./tools/Configure-GitHubOidc.ps1 -WhatIf
.EXAMPLE
Expand Down Expand Up @@ -91,7 +92,7 @@ if ($PSBoundParameters.ContainsKey('Branches')) {
$trustedBranches += $Branches
}

$contexts = @('pull_request')
$contexts = @('pull_request', 'environment:copilot')
foreach ($branch in $trustedBranches) {
if ([string]::IsNullOrWhiteSpace($branch)) {
throw 'Branch names must not be empty or whitespace.'
Expand All @@ -116,6 +117,8 @@ foreach ($context in ($contexts | Select-Object -Unique)) {

$contextName = if ($context -eq 'pull_request') {
'pull-request'
} elseif ($context -eq 'environment:copilot') {
'environment-copilot'
} else {
"branch-$($context.Substring('ref:refs/heads/'.Length).Replace('%3A', ':'))"
}
Expand Down
33 changes: 24 additions & 9 deletions tools/tests/Configure-GitHubOidc.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,45 +102,60 @@ function Assert-Fails([string]$Pattern, [hashtable]$Parameters = @{}) {
Reset-State
& $target -WarningAction SilentlyContinue
$subjects = @($script:state.Credentials.subject)
Assert-True ($subjects.Count -eq 2) 'Expected two federated credentials.'
Assert-True ($subjects.Count -eq 3) 'Expected PR, Copilot environment, and default branch federated credentials.'
Assert-True ($subjects -cnotcontains "${prefix}:ref:refs/heads/microbuild") 'microbuild must not be trusted by default.'
foreach ($context in @('pull_request', 'ref:refs/heads/trunk')) {
foreach ($context in @('pull_request', 'environment:copilot', 'ref:refs/heads/trunk')) {
Assert-True ($subjects -ccontains "${prefix}:$context") "Missing subject: $context"
}
Assert-True (($script:state.Writes -join ',') -eq 'az-create,az-create,gh-put') 'Azure trust must be created before GitHub settings change.'
Assert-True (@($script:state.Credentials.name | Select-Object -Unique).Count -eq 2) 'Credential names must be unique.'
Assert-True (($script:state.Writes -join ',') -eq 'az-create,az-create,az-create,gh-put') 'Azure trust must be created before GitHub settings change.'
Assert-True (@($script:state.Credentials.name | Select-Object -Unique).Count -eq 3) 'Credential names must be unique.'
Assert-True ($script:state.Credentials.name -ccontains 'github-ExampleOrg-ExampleRepo-pull-request') 'PR credential name must be human-readable.'
Assert-True ($script:state.Credentials.name -ccontains 'github-ExampleOrg-ExampleRepo-environment-copilot') 'Copilot credential name must be human-readable.'
Assert-True ($script:state.Credentials.name -ccontains 'github-ExampleOrg-ExampleRepo-branch-trunk') 'Branch credential name must be human-readable.'
$firstCredentialName = $script:state.Credentials[0].name

$script:state.Writes = @()
& $target -WarningAction SilentlyContinue
Assert-True ($script:state.Writes.Count -eq 0) 'Rerun must not duplicate credentials or rewrite settings.'

Reset-State
$script:state.Settings = @{ use_default = $true; use_immutable_subject = $true; sub_claim_prefix = $prefix }
$script:state.Credentials = @(
@{ name = 'existing-pr'; issuer = 'https://token.actions.githubusercontent.com'; subject = "${prefix}:pull_request"; audiences = @('api://AzureADTokenExchange') }
@{ name = 'existing-branch'; issuer = 'https://token.actions.githubusercontent.com'; subject = "${prefix}:ref:refs/heads/trunk"; audiences = @('api://AzureADTokenExchange') }
)
& $target -WarningAction SilentlyContinue
Assert-True (($script:state.Writes -join ',') -eq 'az-create') 'Existing configurations must add only the missing Copilot trust without rewriting GitHub settings.'
Assert-True ($script:state.Credentials.subject -ccontains "${prefix}:environment:copilot") 'Existing configurations must gain Copilot environment trust.'
Assert-True ($script:state.Credentials.name -ccontains 'existing-pr' -and $script:state.Credentials.name -ccontains 'existing-branch') 'Existing credential names must be preserved.'
$script:state.Writes = @()
& $target -WarningAction SilentlyContinue
Assert-True ($script:state.Writes.Count -eq 0) 'Rerunning the migration must not duplicate Copilot trust.'

Reset-State
& $target -WhatIf -WarningAction SilentlyContinue
Assert-True ($script:state.Writes.Count -eq 0) 'WhatIf must not mutate either service.'

Reset-State
& $target -Branches @('release', 'release') -WarningAction SilentlyContinue
Assert-True ($script:state.Credentials.Count -eq 3) 'Duplicate branches must be deduplicated while retaining the default branch.'
Assert-True ($script:state.Credentials.Count -eq 4) 'Duplicate branches must be deduplicated while retaining the default branch and Copilot environment.'
Assert-True ($script:state.Credentials.subject -ccontains "${prefix}:ref:refs/heads/release") 'Custom branch subject missing.'
Assert-True ($script:state.Credentials.subject -ccontains "${prefix}:ref:refs/heads/trunk") 'Explicit branches must not replace the default branch.'

Reset-State
& $target -Branches microbuild -WarningAction SilentlyContinue
Assert-True ($script:state.Credentials.Count -eq 3) 'A single additional branch must produce PR, default branch, and additional branch credentials.'
Assert-True ($script:state.Credentials.Count -eq 4) 'A single additional branch must produce PR, Copilot environment, default branch, and additional branch credentials.'
Assert-True ($script:state.Credentials.subject -ccontains "${prefix}:ref:refs/heads/microbuild") 'Single-string branch argument must be trusted.'
Assert-True ($script:state.Credentials.subject -ccontains "${prefix}:ref:refs/heads/trunk") 'Default branch must be retained with a single-string argument.'

Reset-State
& $target -Branches trunk -WarningAction SilentlyContinue
Assert-True ($script:state.Credentials.Count -eq 2) 'Explicit default branch must not duplicate default trust.'
Assert-True ($script:state.Credentials.Count -eq 3) 'Explicit default branch must not duplicate default trust.'

Reset-State
& $target -Branches @('feature/widget', 'feature-widget', ('long-' + ('x' * 150))) -WarningAction SilentlyContinue
$names = @($script:state.Credentials.name)
Assert-True (($names | Select-Object -Unique).Count -eq 5) 'Sanitized branch names must remain unique.'
Assert-True (($names | Select-Object -Unique).Count -eq 6) 'Sanitized branch names must remain unique.'
foreach ($name in $names) {
Assert-True ($name.Length -le 120 -and $name -cmatch '^[A-Za-z0-9._-]+$') 'Credential names must satisfy Entra limits.'
Assert-True ($name.StartsWith('github-ExampleOrg-ExampleRepo-')) 'Sanitized names must retain repository names.'
Expand All @@ -153,7 +168,7 @@ Assert-True ($script:state.Writes.Count -eq 0) 'Sanitized names must remain idem
Reset-State
$script:state.Credentials = @(@{ name = 'unrelated'; issuer = 'other'; subject = 'other'; audiences = @('other') })
& $target -WarningAction SilentlyContinue
Assert-True ($script:state.Credentials[0].name -eq 'unrelated' -and $script:state.Credentials.Count -eq 3) 'Unrelated trust must be preserved.'
Assert-True ($script:state.Credentials[0].name -eq 'unrelated' -and $script:state.Credentials.Count -eq 4) 'Unrelated trust must be preserved.'

Reset-State
$script:state.Tenant = 'wrong-tenant'
Expand Down
Loading