Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
dbe0d8a
Onboard build failure analysis workflow
YuliiaKovalova Aug 21, 2026
b785d9c
Sanitize artifact names in workflow warnings
YuliiaKovalova Aug 21, 2026
0e84cd0
Fix compiled safe-output target expression
YuliiaKovalova Aug 21, 2026
0f34c5b
Improve Runtime build failure evidence coverage
YuliiaKovalova Aug 28, 2026
e3024a7
Clarify binlog-optional analysis flow
YuliiaKovalova Aug 28, 2026
fd210de
Classify suspicious archive paths before SIGPIPE
YuliiaKovalova Aug 28, 2026
20d48b7
Validate workflow identifiers before logging
YuliiaKovalova Aug 28, 2026
3e98e02
Harden the build failure analysis fetch step
YuliiaKovalova Aug 28, 2026
2be64bc
Harden the GITHUB_OUTPUT and download-budget guards
YuliiaKovalova Aug 28, 2026
d88f723
Bound the download retry window by wall clock, not per attempt
YuliiaKovalova Aug 28, 2026
a3f3a5a
Clear the binlog directory before extracting into it
YuliiaKovalova Aug 28, 2026
4e3ee32
Restore the loop exit dropped from the download budget guards
YuliiaKovalova Aug 28, 2026
523ffc7
Make the download deadline hard, not advisory
YuliiaKovalova Aug 28, 2026
1cd13c9
Never let a curl retry concatenate two responses
YuliiaKovalova Aug 28, 2026
e713513
Give every scratch file a private name
YuliiaKovalova Aug 28, 2026
bc97886
Close four gaps in the download guards
YuliiaKovalova Aug 28, 2026
60170bb
Describe the compressed budget as what it is
YuliiaKovalova Aug 28, 2026
a5d3ea9
Fix the ulimit unit, and let the deadline cover extraction
YuliiaKovalova Aug 28, 2026
d815fe1
Pin the shell mode the byte cap depends on, and sanitize artifact names
YuliiaKovalova Aug 28, 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
295 changes: 295 additions & 0 deletions .github/agents/build-failure-analyst.agent.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,17 @@
"version": "v0.86.2",
"sha": "6aab9e5b5c91c615506061f09bedd81a23babe3c"
}
},
"containers": {
"ghcr.io/lewing/helix.mcp:v0.8.0": {
"image": "ghcr.io/lewing/helix.mcp:v0.8.0",
"digest": "sha256:3c0a16544d922f17ebb477df4d4b0bd546815eb6b1200f4fd8291809011fc20f",
"pinned_image": "ghcr.io/lewing/helix.mcp:v0.8.0@sha256:3c0a16544d922f17ebb477df4d4b0bd546815eb6b1200f4fd8291809011fc20f"
},
"mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-binlog-mcp-amd64": {
"image": "mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-binlog-mcp-amd64",
"digest": "sha256:253736e28e0230269dfcdb70f5027da47e2e45e8526d15d6485ca08b2c2f1638",
"pinned_image": "mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-binlog-mcp-amd64@sha256:253736e28e0230269dfcdb70f5027da47e2e45e8526d15d6485ca08b2c2f1638"
}
}
}
2,630 changes: 2,630 additions & 0 deletions .github/workflows/build-failure-analysis-command.lock.yml

Large diffs are not rendered by default.

756 changes: 756 additions & 0 deletions .github/workflows/build-failure-analysis-command.md

Large diffs are not rendered by default.

2,513 changes: 2,513 additions & 0 deletions .github/workflows/build-failure-analysis.lock.yml

Large diffs are not rendered by default.

706 changes: 706 additions & 0 deletions .github/workflows/build-failure-analysis.md

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions .github/workflows/shared/build-failure-analysis-shared.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
# Shared body for the build-failure-analysis workflows.
#
# Imported by build-failure-analysis.md (check_run + workflow_dispatch
# triggers) and build-failure-analysis-command.md (slash command). Keeps the
# prompt that drives the build-failure analysis in one place. Per-trigger
# wiring (steps, env, mcp-servers, permissions) lives in each caller because
# gh-aw merges those fields from imports but each main workflow must still
# re-declare its top-level permissions.

description: "Shared body for build-failure-analysis workflows"
---

# Build Failure Analyst

You are the **build-failure analyst**. Analyze the binary logs of the Azure
DevOps build that just failed, plus its failed compile-task logs where Runtime
did not publish a matching binlog, and produce a PR review using the
safe-output tools (a later `safe_outputs` job performs the actual GitHub write).
Do **not** try to spawn a sub-agent: the `task` tool is intentionally not
available here. Work directly with the tools you do have: `binlog-mcp` to
read the logs, the `github` tools to read PR/repo context (the GitHub MCP
server is **read-only** here), the `safeoutputs` tools (`add_comment`,
`create_pull_request_review_comment`, `noop`) to post results, and a small set
of read-only `shell` commands (including `cat`).

## Instructions

1. Read the agent-context environment variables: `GH_AW_BUILD_OUTCOME`,
`GH_AW_BINLOG_LIST`, `GH_AW_BINLOG_DIR`, `GH_AW_BINLOG_PATH`,
`GH_AW_BINLOG_HOST_PATH`, `GH_AW_PR_NUMBER`, `GH_AW_PR_HEAD_SHA`,
`GH_AW_PR_MERGE_SHA`, `GH_AW_WORKSPACE`.

2. If `GH_AW_BUILD_OUTCOME == 'success'`, the build did not actually fail —
there is nothing to analyze. Call `noop` with the message
`"Build succeeded — no analysis required."` and stop.

3. Load your detailed playbook: `cat .github/agents/build-failure-analyst.agent.md`
(it is checked out with the repository config). Follow that methodology —
root-cause grouping, source-context reading via the GitHub API at
`GH_AW_PR_HEAD_SHA`, comment/suggestion formatting, and defensive behavior.
In summary:
- Start with `azdo_timeline` from the `hlx` MCP server for
`GH_AW_BINLOG_HOST_PATH` using
`filter: "failed"` to inventory **every** failed/canceled job and task.
Treat only compile/build/configure/link tasks as build evidence; Helix,
test execution, publishing, and infrastructure failures remain out of
scope. For each failed compile task that is not explained by a retrieved
binlog or by complete build diagnostics in its timeline `issues`, use
`azdo_search_log` from `hlx` against that task's `logId` with bounded
searches for compiler/MSBuild/native-build failure signatures. This is
required even when some binlogs were retrieved: Runtime job display names
and artifact names are not one-to-one, and some compile jobs publish no
`Logs_Build_*` artifact.
- Iterate **every** path in `GH_AW_BINLOG_LIST` when the list is non-empty
(newline-separated in-container binlog paths from failed/canceled build
jobs, under `GH_AW_BINLOG_DIR` = `/data/binlogs`) and query the
`binlog-mcp` MCP server (`binlog_errors`, `binlog_overview`,
`binlog_warnings`, …) with `binlog_file` set to each leg's path — a
failure usually surfaces in only one leg, so do not analyse just the
first. `binlog_errors`,
`binlog_overview`, `binlog_warnings`, … are **MCP tools** provided by the
`binlog-mcp` server: prefer calling them **directly as MCP tools** (with a
`binlog_file` argument). A CLI wrapper is also mounted and allowlisted, so
you may alternatively run `binlog-mcp <tool> --binlog_file <path>` via the
shell.
- If no binlog shows errors or failed-target/process evidence **and** the
bounded hlx task-log checks show no compile/build failure, the build work
compiled cleanly — the pipeline failure is then a **non-build**
(test/Helix/publishing/infrastructure) failure, which is **out of scope**.
Only make that clean-build conclusion when all required binlog and hlx
queries succeeded. Then **post nothing**: call `noop` with a short reason
and stop. Do **not** post a summary comment and do **not** invent fixes.
If a required query fails and the gap prevents classification, post one
incomplete-analysis summary with the Azure DevOps build link and no fix
claim or inline suggestion.
- Post exactly one summary via `add_comment` with structured data
`{"workflow_artifact":"build-failure-analysis","artifact_kind":"analysis"}`
and any inline
`suggestion` blocks via `create_pull_request_review_comment`. Both
workflows bind safe outputs deterministically to `GH_AW_PR_NUMBER`; do
not attempt to choose or override the target in a safe-output call.
- `submit_pull_request_review` is **not** a safe output for this workflow;
inline comments stand alone.

4. When you have posted the analysis for a genuine build failure (or called
`noop` for a clean-compile / non-build failure), stop.