Skip to content

Update MTPHelpSnapshotTests snapshot for --progress option changes - #54949

Closed
MichaelSimons wants to merge 9 commits into
mainfrom
michaelsimons/known-build-error-skill
Closed

MichaelSimons wants to merge 9 commits into
mainfrom
michaelsimons/known-build-error-skill

Conversation

@MichaelSimons

Copy link
Copy Markdown
Member

Summary

Regenerates the MTPHelpSnapshotTests.VerifyMTPHelpOutput Verify snapshot to match the current dotnet test --help output. This test is failing across all legs on the main CI build.

Changes to snapshot

  • --no-progress reference updated to --progress off in the --ansi platform option description
  • New --progress platform option added (control whether progress is reported to screen)
  • --ansi removed from Extension Options (it was duplicated from Platform Options)
  • {arch} (process architecture) placeholder added to --report-trx-filename description

Failing build

https://dev.azure.com/dnceng-public/public/_build/results?buildId=1477619

Fixes #54948

MichaelSimons and others added 9 commits June 17, 2026 10:33
Add a new agent skill for creating and validating Known Build Error
GitHub issues. The skill guides the agent through an interactive
workflow:

1. Gather build/PR input from the user
2. Fetch failures using AzDO and Helix MCP tools
3. Let the user select which failures to track
4. Draft ErrorMessage/ErrorPattern JSON with quality guidance
5. Validate patterns against actual build logs
6. Check pattern specificity to avoid false positives
7. File the GitHub issue with proper template and label

Includes:
- SKILL.md with full workflow instructions
- references/pattern-quality.md with pattern writing guidance
- scripts/Validate-KnownIssuePattern.ps1 for local validation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Step 2b to check for existing Known Build Error issues before
  creating a new one. Searches both the repo and dotnet/dnceng for
  similar patterns and suggests updating existing issues when appropriate.
- Add Validate-KnownIssuePattern.sh bash script for Linux/macOS users
  who may not have PowerShell installed.
- Update SKILL.md to reference both scripts with platform-specific examples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update BuildRetry recommendations to cover race conditions, concurrency
issues, and other flaky test categories beyond just infrastructure
failures. Frame the decision as intermittent vs deterministic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the Validation Results section from the issue body template —
Build Analysis infrastructure handles validation and injects results
automatically. Use the canonical template with the guidance comments
and build break warning that the system expects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Clarify that Build Analysis only runs on PR validation builds, not
  CI/rolling builds. The absence of known issue matches on a CI build
  does NOT mean the pattern is wrong or that no known issue exists.
- Add guidance to detect build type via sourceBranch (refs/pull vs
  refs/heads).
- Fix double-numbering: instruct the agent not to include numbers in
  ask_user choices since the UI adds its own numbering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After filing a known build error, prompt the user to create more from
the same build's remaining failures without restarting the skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrite Validate-KnownIssuePattern.sh to fix:
- Single-quote escaping bug in parse_array_or_single (sed command
  used literal single quotes inside a single-quoted string)
- Replace all echo piped to grep with printf to handle lines
  starting with - or containing backslashes
- Extract line_contains/line_matches_regex helper functions that
  use printf and grep -- for safe argument passing
- Use set +e around grep regex validation to properly detect
  exit code 2 (regex error) vs 1 (no match)
- Use printf throughout for output to avoid echo portability issues

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The MTP help output was updated to include a new --progress option and
remove the duplicate --ansi from Extension Options. The snapshot file
was not regenerated, causing test failures across all legs.

Changes:
- --no-progress reference updated to --progress off
- New --progress platform option added
- --ansi removed from Extension Options (was duplicated from Platform Options)
- {arch} placeholder added to --report-trx-filename description

Fixes #54948

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 23, 2026 19:35
@MichaelSimons
MichaelSimons requested a review from a team as a code owner June 23, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the dotnet test --help Verify snapshot to match the current Microsoft.Testing.Platform help output, and (additionally) introduces a new GitHub skill for drafting/validating “Known Build Error” issue patterns.

Changes:

  • Regenerates MTPHelpSnapshotTests.VerifyMTPHelpOutput verified snapshot to reflect --progress help updates and TRX placeholder changes.
  • Adds .github/skills/create-known-build-error documentation plus Bash/PowerShell helper scripts to validate ErrorMessage / ErrorPattern matching.
  • Adds a pattern quality reference doc for writing safer/more specific Known Build Error patterns.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/dotnet.Tests/CommandTests/Test/snapshots/MTPHelpSnapshotTests.VerifyMTPHelpOutput.verified.txt Updates the expected dotnet test --help output snapshot (progress/ansi/TRX placeholder text).
.github/skills/create-known-build-error/SKILL.md Adds a workflow guide for creating/validating Known Build Error GitHub issues.
.github/skills/create-known-build-error/scripts/Validate-KnownIssuePattern.sh Adds a Bash helper to validate candidate patterns against sample error text.
.github/skills/create-known-build-error/scripts/Validate-KnownIssuePattern.ps1 Adds a PowerShell helper to validate candidate patterns against sample error text.
.github/skills/create-known-build-error/references/pattern-quality.md Adds guidance on writing high-quality, low-false-positive Known Build Error patterns.

Comment on lines +1 to +10
---
name: create-known-build-error
description: >-
Create and validate Known Build Error GitHub issues for flaky or infrastructure
build/test failures. USE FOR: creating known build error issues, validating
ErrorMessage/ErrorPattern JSON against real build failures, checking pattern
specificity to avoid false positives, filing issues with the Known Build Error
label. DO NOT USE FOR: investigating CI failures themselves (use ci-analysis),
debugging test crashes (use ci-crash-dump), general build troubleshooting.
---
Comment on lines +31 to +35
The script validates that the pattern matches the error text using the same
matching rules as the Build Analysis system:
- ErrorMessage: case-insensitive substring match, per line
- ErrorPattern: case-insensitive regex match, per line
- Multi-line: pass JSON array syntax ["pat1","pat2"]
Comment on lines +7 to +11
using the same matching rules as the Build Analysis system:
- ErrorMessage: case-insensitive String.Contains, per line
- ErrorPattern: Regex with Singleline | IgnoreCase flags, per line
- Multi-line: all entries must match consecutively in order


# Compile regexes
$regexes = @()
$regexOptions = [System.Text.RegularExpressions.RegexOptions]::Singleline -bor [System.Text.RegularExpressions.RegexOptions]::IgnoreCase
Rules:
- All entries must match in the order specified
- Each entry matches against a single line
- Lines must appear consecutively in the log
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.

MTPHelpSnapshotTests.VerifyMTPHelpOutput snapshot mismatch (--progress option added)

2 participants