Skip to content

Commit 7f37b36

Browse files
authored
Merge pull request #1391 from microsoft/dev/andarno/libtemplateUpdate
Merge latest Library.Template
2 parents 5e1a5b6 + a36864d commit 7f37b36

12 files changed

Lines changed: 167 additions & 31 deletions

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"rollForward": false
1111
},
1212
"dotnet-coverage": {
13-
"version": "18.1.0",
13+
"version": "18.4.1",
1414
"commands": [
1515
"dotnet-coverage"
1616
],
@@ -38,4 +38,4 @@
3838
"rollForward": false
3939
}
4040
}
41-
}
41+
}

.github/actions/publish-artifacts/action.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,46 @@ runs:
1414

1515
- name: 📢 Upload project.assets.json files
1616
if: always()
17-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
17+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
1818
with:
1919
name: projectAssetsJson-${{ runner.os }}
2020
path: ${{ runner.temp }}/_artifacts/projectAssetsJson
2121
continue-on-error: true
2222
- name: 📢 Upload variables
23-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
23+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
2424
with:
2525
name: variables-${{ runner.os }}
2626
path: ${{ runner.temp }}/_artifacts/Variables
2727
continue-on-error: true
2828
- name: 📢 Upload build_logs
2929
if: always()
30-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
30+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3131
with:
3232
name: build_logs-${{ runner.os }}
3333
path: ${{ runner.temp }}/_artifacts/build_logs
3434
continue-on-error: true
3535
- name: 📢 Upload testResults
3636
if: always()
37-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
37+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3838
with:
3939
name: testResults-${{ runner.os }}
4040
path: ${{ runner.temp }}/_artifacts/testResults
4141
continue-on-error: true
4242
- name: 📢 Upload coverageResults
4343
if: always()
44-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
44+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4545
with:
4646
name: coverageResults-${{ runner.os }}
4747
path: ${{ runner.temp }}/_artifacts/coverageResults
4848
continue-on-error: true
4949
- name: 📢 Upload symbols
50-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
50+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5151
with:
5252
name: symbols-${{ runner.os }}
5353
path: ${{ runner.temp }}/_artifacts/symbols
5454
continue-on-error: true
5555
- name: 📢 Upload deployables
56-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
56+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
5757
with:
5858
name: deployables-${{ runner.os }}
5959
path: ${{ runner.temp }}/_artifacts/deployables

.github/copilot-instructions.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,68 @@
1212

1313
## Testing
1414

15-
* There should generally be one test project (under the `test` directory) per shipping project (under the `src` directory). Test projects are named after the project being tested with a `.Test` suffix.
16-
* Tests should use the Xunit testing framework.
17-
* Some tests are known to be unstable. When running tests, you should skip the unstable ones by running `dotnet test --filter "TestCategory!=FailsInCloudTest"`.
15+
**IMPORTANT**: This repository uses Microsoft.Testing.Platform (MTP v2) with xunit v3. Traditional `--filter` syntax does NOT work. Use the options below instead.
16+
17+
* There should generally be one test project (under the `test` directory) per shipping project (under the `src` directory). Test projects are named after the project being tested with a `.Tests` suffix.
18+
* Tests use xunit v3 with Microsoft.Testing.Platform (MTP v2). Traditional VSTest `--filter` syntax does NOT work.
19+
* Some tests are known to be unstable. When running tests, you should skip the unstable ones by using `-- --filter-not-trait "FailsInCloudTest=true"`.
20+
21+
### Running Tests
22+
23+
**Run all tests**:
24+
```bash
25+
dotnet test --no-build -c Release
26+
```
27+
28+
**Run tests for a specific test project**:
29+
```bash
30+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release
31+
```
32+
33+
**Run a single test method**:
34+
```bash
35+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release -- --filter-method ClassName.MethodName
36+
```
37+
38+
**Run all tests in a test class**:
39+
```bash
40+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release -- --filter-class ClassName
41+
```
42+
43+
**Run tests with wildcard matching** (supports wildcards at beginning and/or end):
44+
```bash
45+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release -- --filter-method "*Pattern*"
46+
```
47+
48+
**Run tests with a specific trait** (equivalent to category filtering):
49+
```bash
50+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release -- --filter-trait "TraitName=value"
51+
```
52+
53+
**Exclude tests with a specific trait** (skip unstable tests):
54+
```bash
55+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release -- --filter-not-trait "TestCategory=FailsInCloudTest"
56+
```
57+
58+
**Run tests for a specific framework only**:
59+
```bash
60+
dotnet test --project test/Library.Tests/Library.Tests.csproj --no-build -c Release --framework net9.0
61+
```
62+
63+
**List all available tests without running them**:
64+
```bash
65+
cd test/Library.Tests
66+
dotnet run --no-build -c Release --framework net9.0 -- --list-tests
67+
```
68+
69+
**Key points about test filtering with MTP v2 / xunit v3**:
70+
- Options after `--` are passed to the test runner, not to `dotnet test`
71+
- Use `--filter-method`, `--filter-class`, `--filter-namespace` for simple filtering
72+
- Use `--filter-trait` and `--filter-not-trait` for trait-based filtering (replaces `--filter "TestCategory=..."`)
73+
- Traditional VSTest `--filter` expressions do NOT work
74+
- Wildcards `*` are supported at the beginning and/or end of filter values
75+
- Multiple simple filters of the same type use OR logic, different types combine with AND
76+
- See `--help` for query filter language for advanced scenarios
1877

1978
## Coding style
2079

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Template release notes
2+
3+
This file will describe significant changes in Library.Template as they are introduced, especially if they require special consideration when merging updates into existing repos.
4+
This file is referenced by update-library-template.prompt.md and should remain in place to facilitate future merges, whether done manually or by AI.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
description: Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.
3+
---
4+
5+
# Instructions
6+
7+
1. Run `tools\MergeFrom-Template.ps1`
8+
2. Resolve merge conflicts, taking into account conflict resolution policy below.
9+
3. Validate the changes, as described in the validation section below.
10+
4. Commiting your changes (if applicable).
11+
12+
## Conflict resolution policy
13+
14+
There may be special notes in `.github/prompts/template-release-notes.md` that describe special considerations for certain files or scenarios to help you resolve conflicts appropriately.
15+
Always refer to that file before proceeding.
16+
In particular, focus on the *incoming* part of the file, since it represents the changes from the Library.Template that you are merging into your repo.
17+
18+
Also consider that some repos choose to reject certain Library.Template patterns.
19+
For example the template uses MTPv2 for test projects, but a repo might have chosen not to adopt that.
20+
When resolving merge conflicts, consider whether it looks like the relevant code file is older than it should be given the changes the template is bringing in.
21+
Ask the user when in doubt as to whether the conflict should be resolved in favor of 'catching up' with the template or keeping the current changes.
22+
23+
### Keep Current files
24+
25+
Conflicts in the following files should always be resolved by keeping the current version (i.e. discard incoming changes):
26+
27+
* README.md
28+
29+
### Deleted files
30+
31+
Very typically, when the incoming change is to a file that was deleted locally, the correct resolution is to re-delete the file.
32+
33+
In some cases however, the deleted file may have incoming changes that should be applied to other files.
34+
The `test\Library.Tests\Library.Tests.csproj` file is very typical of this.
35+
Changes to this file should very typically be applied to any and all test projects in the repo.
36+
You are responsible for doing this in addition to re-deleting this template file.
37+
38+
## Validation
39+
40+
Validate the merge result (after resolving any conflicts, if applicable).
41+
Use #runSubagent for each step.
42+
43+
1. Verify that `dotnet restore` succeeds. Fix any issues that come up.
44+
2. Verify that `dotnet build` succeeds.
45+
3. Verify that tests succeed by running `tools\dotnet-test-cloud.ps1`.
46+
47+
While these validations are described using `dotnet` CLI commands, some repos require using full msbuild.exe.
48+
You can detect this by checking the `azure-pipelines/dotnet.yml` or `.github/workflows/build.yml` files for use of one or the other tool.
49+
50+
## Committing your changes
51+
52+
If you have to make any changes for validations to pass, consider whether they qualify as a bad merge conflict resolution or more of a novel change that you're making to work with the Library.Template update.
53+
Merge conflict resolution fixes ideally get amended into the merge commit, while novel changes would go into a novel commit after the merge commit.
54+
55+
Always author your commits using `git commit --author "🤖 Copilot <no-reply@github.com>"` (and possibly other parameters).
56+
Describe the nature of the merge conflicts you encountered and how you resolved them in your commit message.
57+
58+
Later, if asked to review pull request validation breaks, always author a fresh commit with each fix that you push, unless the user directs you to do otherwise.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
# You can define any steps you want, and they will run before the agent starts.
2727
# If you do not check out your code, Copilot will do this for you.
2828
steps:
29-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3030
with:
3131
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
3232
- name: ⚙ Install prerequisites

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
url: ${{ steps.deployment.outputs.page_url }}
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828
with:
2929
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
3030
- name: ⚙ Install prerequisites

.github/workflows/docs_validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
1919
- name: 🔗 Markup Link Checker (mlc)
20-
uses: becheran/mlc@18a06b3aa2901ca197de59c8b0b1f54fdba6b3fa # v1.0.0
20+
uses: becheran/mlc@7ec24825cefe0c9c8c6bac48430e1f69e3ec356e # v1.2.0
2121
with:
2222
args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/*,https://microsoft.github.io/vs-threading/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*,https://www.npmjs.com/package/*,https://get.dot.net/
2323
- name: ⚙ Install prerequisites

.github/workflows/libtemplate-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
contents: write
1818
pull-requests: write
1919
steps:
20-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
with:
2222
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
2323

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
66
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
7-
<MicrosoftTestingPlatformVersion>2.0.2</MicrosoftTestingPlatformVersion>
7+
<MicrosoftTestingPlatformVersion>2.1.0</MicrosoftTestingPlatformVersion>
88
<MessagePackVersion>2.5.198</MessagePackVersion>
99
<MicroBuildVersion>2.0.208</MicroBuildVersion>
1010
<RoslynVersion>4.14.0</RoslynVersion>
@@ -50,12 +50,12 @@
5050
<PackageVersion Update="System.Reflection.Metadata" Version="9.0.0" />
5151
</ItemGroup>
5252
<ItemGroup Label="Library.Template">
53-
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.1.0" />
53+
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.4.1" />
5454
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="$(MicrosoftTestingPlatformVersion)" />
5555
<PackageVersion Include="Microsoft.Testing.Extensions.HangDump" Version="$(MicrosoftTestingPlatformVersion)" />
5656
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="$(MicrosoftTestingPlatformVersion)" />
5757
<PackageVersion Include="Microsoft.VisualStudio.Internal.MicroBuild.NonShipping" Version="$(MicroBuildVersion)" />
58-
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.1" />
58+
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
5959
</ItemGroup>
6060
<ItemGroup>
6161
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(CodeAnalysisAnalyzerVersion)" />

0 commit comments

Comments
 (0)