Monitors .NET runtime CI test pipelines on Azure DevOps. Use this skill when asked to monitor CI pipeline test results, triage CI test failures across ADO pipelines, or generate CI test monitoring reports.
73
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
High
Do not use without reviewing
This skill automates monitoring CI test pipelines on Azure DevOps (dnceng-public/public), triaging failures, and coordinating with GitHub dotnet/runtime issue tracking.
The list of pipelines and their cached definition IDs is maintained in
pipelines.md in this skill directory.
Deterministic steps are scripted. Agent does triage.
scripts/) handle all deterministic work: DB setup,
build fetching, test failure extraction (including errorMessage and
stackTrace from the ADO API), Helix log downloading, and report
generation.monitor.db.Use these scripts — do NOT write ad-hoc replacements. Do NOT create new files
in scripts/ — only the committed scripts below belong there. For ad-hoc
queries during triage (e.g., DB lookups, grouping), prefer python -c '...'
inline. If a query is too complex for inline (escaping issues, multi-line),
write a temp file under temp/ (e.g., temp/_query.py). The temp/
directory is gitignored; the user will clean it up when no longer needed.
| Script | Step | What it does |
|---|---|---|
setup_and_fetch_builds.py | 2 | Creates monitor.db (including test_results table), fetches latest build for every pipeline, populates pipelines table. |
extract_failed_tests.py | 3 | Reads failing pipelines from DB. Calls AzDO Test Results API for each failing build. INSERTs one row per failed test method into test_results (test_name, run_name, pipeline_name, Helix info, console URL, error_message, stack_trace from API). Strips .WorkItemExecution suffix. Skips generic "Helix Work Item failed" messages (stores empty — agent fills from console log). Requires ADO_TOKEN env var or az cli. |
fetch_helix_logs.py | 3 | Fetches Helix console logs, saves full log files to helix-logs/ directory, UPDATEs each test_results row with exit_code and console_log_path. No auth needed. |
validate_results.py | 5 | Validates monitor.db completeness and integrity. 24 checks: data completeness, referential integrity, data quality, content accuracy, debug log completeness. Exits 1 on failure. |
generate_report.py | 6 | Reads monitor.db, generates report to logs/ directory. Pure formatting — no judgment. Run only after DB validation passes. |
End-to-end pipeline:
cd .github/skills/ci-pipeline-monitor
# Step 0: Prerequisites (agent)
pip install requests
# Obtain ADO_TOKEN — see Step 0 section below for full logic
# Step 1: Resolve pipeline definitions (agent)
# Agent compares Pipeline Details against Cached Mapping in pipelines.md,
# resolves missing def IDs via AzDO Definitions API, updates pipelines.md
# Step 2: Fetch latest builds (deterministic)
python scripts/setup_and_fetch_builds.py --pipelines pipelines.md --db scripts/monitor.db
# Step 3: Extract failed tests + fetch logs (deterministic)
python scripts/extract_failed_tests.py --db scripts/monitor.db
python scripts/fetch_helix_logs.py --db scripts/monitor.db
# Step 4: Triage (agent — non-deterministic)
# Agent reads test_results table, classifies (exit code + error message),
# groups by root cause, searches GitHub, populates failures table,
# UPDATEs test_results.failure_id for every row
# Step 5: Validate DB before report (deterministic)
python scripts/validate_results.py --db scripts/monitor.db --pipelines pipelines.md --log logs/ci-pipeline-monitor-*.log
# Step 5a: If validation fails, fix issues in DB, re-validate (up to 3 retries,
# only while failure count decreases). Log remaining WARNs and proceed.
# Step 6: Generate report (deterministic — only after DB is clean)
# Pass --validation-warnings if Step 5a had unresolved failures
python scripts/generate_report.py --db scripts/monitor.db [--validation-warnings]Created by setup_and_fetch_builds.py. Populated by scripts (Steps 2-3) and
agent (Step 4). Validated by validate_results.py (Step 5). Read by
generate_report.py (Step 6).
CREATE TABLE pipelines (
name TEXT PRIMARY KEY,
build_id INTEGER,
build_number TEXT,
result TEXT NOT NULL, -- succeeded | failed | inconclusive | skipped
skip_reason TEXT
);
-- Every individual test failure from Step 3 (before grouping).
-- One row per failed test method per pipeline. Populated by scripts.
CREATE TABLE test_results (
id INTEGER PRIMARY KEY AUTOINCREMENT,
pipeline_name TEXT NOT NULL,
build_id INTEGER NOT NULL,
run_name TEXT NOT NULL, -- AzDO test run name (leg name)
test_name TEXT NOT NULL, -- fully qualified, .WorkItemExecution stripped
helix_job_id TEXT,
helix_work_item TEXT,
console_log_url TEXT,
exit_code INTEGER, -- from console log (script-extracted)
console_log_path TEXT, -- path to full console log file on disk (in helix-logs/)
error_message TEXT, -- initially from AzDO Test Results API; may be enriched/overwritten by agent with console-log snippet
stack_trace TEXT, -- initially from AzDO Test Results API; may be enriched/overwritten by agent with console-log snippet
failure_id INTEGER, -- NULL until Step 4 assigns a group
FOREIGN KEY (failure_id) REFERENCES failures(id)
);
CREATE TABLE failures (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL,
scope TEXT, -- e.g. "arm64, x86"
test_name TEXT NOT NULL,
work_item TEXT,
failure_category TEXT, -- timeout, crash_sigsegv, test_failure, etc.
exit_codes TEXT,
failing_since_date TEXT,
failing_since_build TEXT,
console_log_url TEXT,
source_test_result_id INTEGER, -- which test_results row the error_message/stack_trace came from
error_message TEXT, -- verbatim from log
stack_trace TEXT, -- verbatim from log
summary TEXT, -- agent-written
analysis TEXT, -- agent-written
github_issue_number INTEGER, -- NULL if NEW
github_issue_url TEXT,
github_issue_state TEXT, -- OPEN | CLOSED
github_issue_assigned TEXT,
labels TEXT,
milestone TEXT DEFAULT '11.0.0'
);
CREATE TABLE failure_pipelines (
failure_id INTEGER NOT NULL REFERENCES failures(id),
pipeline_name TEXT NOT NULL,
build_id INTEGER,
build_number TEXT,
PRIMARY KEY (failure_id, pipeline_name)
);
CREATE TABLE failure_tests (
failure_id INTEGER NOT NULL REFERENCES failures(id),
pipeline_name TEXT NOT NULL,
run_name TEXT NOT NULL,
test_name TEXT NOT NULL
);All output goes in logs/ (sibling of scripts/).
logs/ci-pipeline-monitor-<timestamp>.log) — always generated.
⚠️ Write incrementally by appending after each API call and decision.
Do NOT compose the log from memory at the end of the run — this defeats
the crash-recovery purpose. If the process crashes mid-run, the log must
contain everything up to the crash point. Use file append operations
(Python open(..., 'a') or PowerShell Add-Content) to write each log
entry immediately after the action it describes. Follow
log-template.md. Log every API call URL + response
summary, every decision with reasoning, timestamps, and errors.logs/test-report-<timestamp>.md) — always generated
via generate_report.py.Run before anything else. See references/prerequisites.md
for full details.
pip install requestsADO_TOKEN env var is set (required for Step 3).⚠️ Do NOT proceed to Step 3 without a valid ADO_TOKEN. The Test Results
API returns 203 (sign-in HTML) without auth, even on dnceng-public.
Compare the Pipeline Details table (source of truth) against the Cached
Definition ID Mapping table in pipelines.md:
For each pipeline in Pipeline Details that is not marked Private or skip in its Notes column:
— as the
Def ID, resolve it via the AzDO Definitions API:
GET https://dev.azure.com/dnceng-public/public/_apis/build/definitions?name={pipeline_name}&api-version=7.1For pipelines in the Cached Mapping table that are no longer in Pipeline Details, leave them (stale rows are harmless — the script only processes pipelines present in the Cached Mapping table).
Do NOT re-resolve IDs that are already populated with a numeric value.
python scripts/setup_and_fetch_builds.py --pipelines pipelines.md --db scripts/monitor.dbCreates DB, fetches latest build per pipeline, populates pipelines table,
outputs failing build IDs.
python scripts/extract_failed_tests.py --db scripts/monitor.db
python scripts/fetch_helix_logs.py --db scripts/monitor.dbExtracts individual failed test methods and downloads their full Helix console logs to disk.
⚠️ Every individual failure must be INSERT'd into test_results immediately.
extract_failed_tests.py: inserts one row per failed test method (test_name,
run_name, pipeline_name, helix_job_id, helix_work_item, console_log_url,
error_message, stack_trace from the ADO API). The API provides useful
error/stack for most xUnit assertion failures. For crashes and timeouts,
the API returns a generic "Helix Work Item failed" message — these are
stored as empty so the agent can extract the real error from the console log.fetch_helix_logs.py: downloads the full console log to helix-logs/
(a separate directory — NOT mixed with logs/) and UPDATEs the
corresponding test_results row with exit_code and console_log_path.
Uses console_log_path IS NULL as the sentinel for unprocessed rows.test_results contains the complete raw inventory of every
failure with its exit code, a path to the full console log on disk, and
API-provided error/stack where available. failure_id is NULL — it is
populated by the agent in Step 4.See references/triage-workflow.md for full instructions.
⚠️ INSERT into failures table immediately after triaging each failure group.
python scripts/validate_results.py --db scripts/monitor.db --pipelines pipelines.md --log logs/ci-pipeline-monitor-<timestamp>.logRuns 24 checks across data completeness, referential integrity, data quality, and content accuracy. Exits 1 on failure.
For the full list of checks, see references/validation-checks.md.
If any checks fail after Step 5:
Read the validator output — each FAIL line includes the specific test_results IDs, failure IDs, or field names that failed.
For each fixable failure (e.g., truncated stack trace, missing error_message):
console_log_pathRe-run the validator:
python scripts/validate_results.py --db scripts/monitor.db --pipelines pipelines.md --log <log_path>If failures decreased, repeat from step 1 (up to 3 total retries). If failures did NOT decrease (same or more), stop retrying.
If checks still fail after retries, log each as a WARN in the debug log with clickable links and move on:
[WARN] Validation error persists after retry — <check description>
Pipeline: [<name> <build_number>](<ado_test_results_tab_url>)
Console Log: [Console Log](<helix_url>)
Field: <field_name>, failure_id=<N>Stop retrying when failure count stops decreasing or after 3 attempts. Log remaining WARNs and proceed to report generation. Some failures (e.g., LLM output truncation) may not be fixable programmatically.
# If validation passed (Step 5/5a exit code 0):
python scripts/generate_report.py --db scripts/monitor.db
# If validation had unresolved warnings (Step 5/5a exit code 1):
python scripts/generate_report.py --db scripts/monitor.db --validation-warningsReads DB, outputs report following report-template.md. Only run after
DB validation (Step 5/5a) is complete so the report is generated once.
failing_since_date/failing_since_build from failures tableado-pipelines_* and ado-testplan_* MCP tools are banned:
ado-testplan_show_test_results_from_build_id returns 1M+ rows and times out.ado-pipelines_get_builds, get_build_log, get_build_status,
get_build_changes, get_build_log_by_id/_apis/build/builds/{id}/timeline):
extract_failed_tests.py.powershell with requests for any direct API calls.| Step | Tools | Purpose |
|---|---|---|
| 0 | powershell | Install dependencies, obtain ADO_TOKEN |
| 1 | powershell, edit | Resolve def IDs via AzDO API, update pipelines.md |
| 2-3 | powershell | Run scripts |
| 4 | powershell, github-mcp-server-search_issues, github-mcp-server-issue_read | Read logs, search GitHub, INSERT failures |
| 5 | powershell | Run validate_results.py |
| 5a | powershell, view | Fix validation failures, re-validate (up to 3 retries) |
| 6 | powershell | Run generate_report.py |
| 7 | github-mcp-server-list_commits, get_commit, search_pull_requests, get_file_contents | Trace regressions |
File I/O tools (view, edit, create, grep, glob) always allowed.
test_results — this is the
complete inventory. No failure may exist only in JSON output or in memory.ADO_TOKEN to
each sub-agent for AzDO Test Results API. Helix API needs no auth.failingSince builds may be purged (>90 days). Link to the latest
failed build instead of generating a dead URL.ADO_TOKEN. The token is valid ~60 minutes.references/triage-workflow.md.references/verbatim-rules.md.ba10a6e
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.