Skip to content

Commit c726c3a

Browse files
radicalCopilot
andauthored
Add /create-issue command for failing-test triage (#15780)
* Extract Aspire.TestTools shared library Move TrxReader from GenerateTestSummary into a new Aspire.TestTools library and add GitHubCli and GitHubActionsApi wrappers with a fixture-based testing layer that reads canned responses from disk when ASPIRE_FAILING_TEST_ISSUE_FIXTURE_DIR is set. Register the project in Aspire.slnx. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add CreateFailingTestIssue tool New dotnet-run CLI tool that resolves a GitHub Actions run URL, downloads TRX test-failure artifacts, parses failing tests, matches them to source files, groups by test class, and generates per-class issue bodies with structured metadata. Supports --create to file or reopen GitHub issues and --force-new to always create fresh issues. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refactor DownloadFailingJobLogs and GenerateTestSummary to use Aspire.TestTools Replace the inline GitHubCli and TrxReader copies in DownloadFailingJobLogs with references to the shared Aspire.TestTools library. Update GenerateTestSummary to depend on Aspire.TestTools for TrxReader. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Rename and update failing-test issue template Rename 40_blocking_clean_ci.yml to 50_failing_test.yml and update fields to match the structured metadata produced by the CreateFailingTestIssue tool. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add /create-issue workflow for failing-test triage GitHub Actions workflow triggered by /create-issue comment commands on issues and PRs. Validates permissions (admin, maintain, or write), resolves the CI run, and invokes the CreateFailingTestIssue tool. Handles empty results gracefully with zero-byte JSON check. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add tests for failing-test tooling 18 fixture-driven tests covering run resolution, TRX parsing, issue generation, existing-issue search and reopen, --force-new, PR URL resolution fallback, and the /create-issue workflow JS logic. Also adds tests for DownloadFailingJobLogs and GenerateTestSummary via the shared fixture layer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update ci-test-failures skill docs and project metadata Document the /create-issue workflow, CreateFailingTestIssue tool, and fixture-based testing in the skill guide. Add diagnostics.log to .gitignore and reference the new tool in AGENTS.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address review feedback: use --output flag and CreateTempSubdirectory - Use --output flag with explicit build step in workflow to avoid stdout corruption from dotnet build noise - Replace Path.Combine(Path.GetTempPath(), ...) with Directory.CreateTempSubdirectory() in FailingTestIssueCommand and TestTrxBuilder per repo conventions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Post comment on failure for all /create-issue error paths - Change 'Create or update' step condition to run even when resolve step fails (continue-on-error already set), so the tool's error JSON is always surfaced as a PR comment - Add catch-all 'Post failure comment on unexpected error' step that fires on any unexpected failure (SDK restore, build crash, etc.) and links to the workflow run - Skip the catch-all when extract-command or verify-permission already posted their own error comment to avoid duplicates Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Make error details collapsible when over 30 lines Wrap the error details code block in a <details> element when the content exceeds 30 lines to keep long failing-test issues readable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * /create-issue: show failures on no-args, add /disable-test hint on success When /create-issue is used without arguments on a PR, discover test failures from the latest CI run and list them as copy-pasteable commands. Usage help is shown below the list. When /create-issue successfully creates, updates, or reopens a failing-test issue, the success comment now includes a suggested /disable-test command with the issue URL. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR feedback: process lifecycle, zip validation, indentation - Terminate gh processes on cancellation to prevent orphaned OS processes - Add 5-minute default timeout via linked CancellationTokenSource - Observe stderrTask in catch block to prevent unobserved faulted tasks - Validate zip entries for path traversal before extraction - Fix extra indentation on ResolveWorkflowAsync Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Move permission check before command parsing; harden workflow - Verify write access before extracting/reflecting user input (security) - Move checkout after permission check to skip work for unauthorized users - Add persist-credentials: false to checkout - Add top-level permissions: {} to restrict defaults - Add permission comments and job name (zizmor pedantic clean) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6002e23 commit c726c3a

30 files changed

+5548
-258
lines changed

.github/ISSUE_TEMPLATE/40_blocking_clean_ci.yml renamed to .github/ISSUE_TEMPLATE/50_failing_test.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
name: Failing test on CI
2-
description: Create a report about a failing test
1+
name: Failing test
2+
description: Create a report about a failing test.
33
title: "[Failing test]: "
4-
labels: [ 'blocking-clean-ci' ]
4+
labels: [ "failing-test" ]
55
body:
66
- type: markdown
77
attributes:
88
value: |
9-
Test(s) failing on an Azure DevOps CI run. This issue will track the failures on Azure DevOps runs using the [Known Issues infrastructure](https://github.com/dotnet/arcade/blob/main/Documentation/Projects/Build%20Analysis/KnownIssues.md).
10-
Fill in the `Build information` block. And `Error message template` needs to be filled in by using either `ErrorMessage` or `ErrorPattern` to enable automatic tracking of failing builds.
9+
Test(s) failing on a GitHub Actions CI run. This issue tracks the failure using the known-issues style format.
10+
Fill in the `Build information` block. `Fill in the error message template` should use either `ErrorMessage` or `ErrorPattern` so the issue stays actionable.
1111
- type: checkboxes
1212
attributes:
1313
label: Is there an existing issue for this?
14-
description: Please search to see if an issue already exists for the failure you encountered ([aspire/issues](https://github.com/microsoft/aspire/issues)). More information on our issue management policies is available [here](https://aka.ms/aspnet/issue-policies).
14+
description: Please search [aspire/issues](https://github.com/microsoft/aspire/issues) before filing a new failing-test issue.
1515
options:
1616
- label: I have searched the existing issues
1717
required: true
1818
- type: textarea
1919
attributes:
2020
label: Build information
2121
value: |
22-
Build:
23-
Build error leg or test failing:
24-
Pull Request: N/A
22+
Build:
23+
Build error leg or test failing:
2524
validations:
2625
required: true
2726
- type: textarea
@@ -47,7 +46,30 @@ body:
4746
required: false
4847
- type: textarea
4948
attributes:
50-
label: Other info
51-
description: Any other useful information about the failure
49+
label: Error details
50+
description: Include the failing error message and stack trace in the same style as existing failing-test issues.
51+
value: |
52+
```yml
53+
Error Message:
54+
Stack Trace:
55+
```
5256
validations:
5357
required: false
58+
- type: textarea
59+
attributes:
60+
label: Standard output
61+
description: Paste the relevant standard output inside the existing collapsible details block format.
62+
value: |
63+
<details>
64+
<summary>Standard Output</summary>
65+
66+
```yml
67+
```
68+
69+
</details>
70+
validations:
71+
required: false
72+
- type: markdown
73+
attributes:
74+
value: |
75+
<!-- failing-test-signature: v1:manual -->

0 commit comments

Comments
 (0)