Add AI-powered build failure analysis with NuGet MCP for VMR insertion PRs#6711
Open
YuliiaKovalova wants to merge 4 commits into
Open
Add AI-powered build failure analysis with NuGet MCP for VMR insertion PRs#6711YuliiaKovalova wants to merge 4 commits into
YuliiaKovalova wants to merge 4 commits into
Conversation
6afc8e5 to
6f5cabb
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an Azure DevOps “Build Failure Analysis” stage intended to run on failed Maestro/Darc insertion PR builds, extract/aggregate MSBuild errors (preferably from binlogs), optionally analyze them with GitHub Models, and post a consolidated diagnostic comment plus inline fix suggestions back to the corresponding GitHub PR.
Changes:
- Introduces a new failure-only pipeline stage + step templates to download build logs/binlogs, extract/dedupe errors, run AI analysis, and post PR feedback.
- Adds Node-based helper scripts (MCP client, merge/dedupe, AI prompt/report generator, GitHub comment + review suggestion posters) plus a small unit-test script.
- Adds a reusable template for publishing binlogs/logs as pipeline artifacts and a GitHub Actions “simulation” workflow for end-to-end validation.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/pipelines/pr.yml | Wires the new Build Failure Analysis stage into the PR pipeline. |
| eng/pipelines/templates/stages/build-failure-analysis.yml | Defines the analysis stage, artifact download, and GitHub PR resolution. |
| eng/pipelines/templates/steps/build-failure-analysis.yml | Implements binlog discovery, extraction, fallback parsing, AI analysis, and PR posting steps. |
| eng/pipelines/templates/steps/publish-binlogs.yml | Adds a reusable step template for publishing binlogs/logs as pipeline artifacts. |
| eng/build-failure-analysis/scripts/package.json | Defines Node dependencies for the analysis scripts. |
| eng/build-failure-analysis/scripts/package-lock.json | Locks transitive dependencies for reproducible installs. |
| eng/build-failure-analysis/scripts/.gitignore | Ignores node_modules for the scripts directory. |
| eng/build-failure-analysis/scripts/extract-binlog-errors.js | MCP client to extract overview/errors/warnings from a binlog. |
| eng/build-failure-analysis/scripts/merge-errors.js | Merges and deduplicates errors across multiple binlog extractions. |
| eng/build-failure-analysis/scripts/analyze-errors.js | Builds the prompt, calls GitHub Models (with fallback), and generates a markdown report. |
| eng/build-failure-analysis/scripts/post-pr-comment.js | Posts/updates a single diagnostic PR comment (marker-based update-in-place). |
| eng/build-failure-analysis/scripts/post-suggestions-azdo.js | Posts inline fix suggestions via GitHub Reviews API using PR diff-line mapping. |
| eng/build-failure-analysis/scripts/test-utils.js | Simple unit tests for shared path/linkification + merge behavior. |
| .github/workflows/build-failure-analysis-simulation.yml | Adds a GitHub Actions workflow to simulate a failure and exercise the scripts. |
Files not reviewed (1)
- eng/build-failure-analysis/scripts/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JanKrivanek
approved these changes
May 20, 2026
akoeplinger
reviewed
May 20, 2026
akoeplinger
reviewed
May 20, 2026
akoeplinger
requested changes
May 20, 2026
akoeplinger
reviewed
May 20, 2026
akoeplinger
reviewed
May 20, 2026
akoeplinger
reviewed
May 20, 2026
a670cdd to
0c003e4
Compare
Adds an agentic workflow that automatically analyzes failed Maestro insertion PR builds. When a darc-*/release-pr-* PR fails in the public AzDO pipeline, a new stage dispatches a GitHub Actions workflow where an AI agent (claude-opus-4.6) downloads the binlog, diagnoses root causes, and posts a PR comment with inline suggestions. Architecture: - eng/pipelines/pr.yml: TriggerBuildFailureAnalysis stage that dispatches the GH Actions workflow via curl on build failure - .github/workflows/build-failure-analysis.md: gh-aw agentic workflow that downloads binlogs from AzDO and delegates to agent - .github/agents/build-failure-analyst.agent.md: VMR-specific build failure analyst with insertion pattern expertise - .github/workflows/scripts/DumpBinlog/: C# MCP client using ModelContextProtocol SDK (no Node.js dependency) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0c003e4 to
906666b
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3070ec6 to
b6acbcd
Compare
Member
Author
|
the fresh output result: YuliiaKovalova#3 (comment) |
f6d1dfd to
90e650c
Compare
Integrates the official NuGet.Mcp.Server (v1.4.3) giving the agent access to nuget_fix_vulnerable_packages, nuget_update-package, and other tools for resolving NU1605/NU1608 version conflicts with concrete remediation plans. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9818a70 to
48f0741
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds AI-powered build failure analysis for the dotnet/dotnet VMR using a GitHub Actions agentic workflow — the same architecture as microsoft/testfx.
When a Maestro insertion PR fails the build, the AzDO pipeline automatically dispatches a GitHub Actions workflow where an AI agent (
claude-opus-4.6) downloads the binlog, diagnoses the root cause, and posts a summary comment with inlinesuggestionblocks. The agent also has access to the NuGet MCP Server for resolving package version conflicts.How it runs
MCP Servers available to the agent
binlog_overview,binlog_errors,binlog_warningsnuget_fix_vulnerable_packages,nuget_update-package,nuget_get-latest-package-versionTrigger conditions
The AzDO stage runs only when:
System.PullRequest.PullRequestNumber= GitHub PR number)darc-*orrelease-pr-*branchAlso available manually:
gh workflow run build-failure-analysis.md -f pr-number=1234 -f azdo-build-id=5678VMR-specific agent expertise
eng/Version.Details.xml,eng/Versions.props)Key design decisions
artifacts/log/Release/Build.binlogaggregates all errors across reposModelContextProtocolNuGet package natively (no Node.js)Files
eng/pipelines/pr.ymlTriggerBuildFailureAnalysisstage.github/workflows/build-failure-analysis.md.github/workflows/shared/build-failure-analysis-shared.md.github/agents/build-failure-analyst.agent.md.github/workflows/scripts/DumpBinlog/Prerequisites
GitHubCommentTokensecret variable in public AzDO pipeline withissues:write,pull-requests:write,actions:writeValidated end-to-end
Tested on fork simulation PR using real AzDO build artifacts from failed builds. The agent successfully downloaded binlogs, analyzed errors, and posted diagnostic comments.
Prior art