一键导入
analyze-pr-builds
Analyze all failed builds for a GitHub pull request. Use when user provides a GitHub PR URL and wants to understand why builds are failing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze all failed builds for a GitHub pull request. Use when user provides a GitHub PR URL and wants to understand why builds are failing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze the root cause inside a failed prowjob. Use when user mentions to analyze a prowjob failure or adds a prowjob url
Analyze root causes for all the recent ci-failures. Use when user mentions to analyze recent ci failures
Analyze the root cause inside a failed prowjob when a user mentions a failure or adds a prowjob URL.
Analyze root causes for all the recent CI failures (failing prowjobs that have not reached the testing stage).
Analyze all failed builds for a GitHub pull request and identify root causes.
Unified flake analysis combining PR-based flakefinder data with periodic lane failure rates. Use when the user wants an overview of test flakiness across the project.
| name | analyze-pr-builds |
| description | Analyze all failed builds for a GitHub pull request. Use when user provides a GitHub PR URL and wants to understand why builds are failing. |
| allowed-tools | ["Read","Bash(go run:*)","Bash(grep:*)"] |
This skill analyzes all currently-failing builds for a GitHub pull request, identifies root causes, and presents a concise summary.
It works for any repo served by prow.ci.kubevirt.io (currently the kubevirt GitHub org).
If not already inside the ci-health repository, cd into it first (e.g. cd kubevirt.io/ci-health from the github.com directory).
Two commands to run sequentially:
$ go run ./cmd/ci-failures analyze-pr https://github.com/kubevirt/kubevirt/pull/17287
This downloads build logs, k8s-reporter artifacts, and container logs for every currently-failing job in the PR. Output files go to the session directory.
$ go run ./cmd/ci-failures summarize-session
This reads all session YAML files and emits a single condensed YAML to stdout containing just the key fields needed for analysis. This replaces the need to read individual files.
After running both commands:
summarize-session stdout output. The structure is:
jobs: list of failed jobs, each with:
job_name: the Prow job namejob_url: link to the Prow job UIbuild_id: the build numberresult: the Prow build result from finished.json — one of SUCCESS, FAILURE, ABORTED, ERRORpassed: boolean from finished.jsoncategory: error category (external, internal, pr-build, needs-investigation, prow-aborted, prow-error)category_reason: explanation of the categorizationerror_snippets: list of {error_text, link} — one-line error text and link to the log linek8s_analyses: list of k8s analysis results per build, each with:
build_id, job_name, total_findingsfindings: list of {detector, severity, kind, namespace, name, reason, message}container_log_files: list of {pod_name, container_name, namespace, cached_path, size_bytes} for grep cross-referencinggrep on the cached virt-controller and virt-handler logs to find the actual rejection reason. Example: grep -i "testvmi-xxxxx" <cached_path>Jobs with category: prow-aborted were killed by Prow before completing (e.g., superseded by a newer commit). Jobs with category: prow-error failed to schedule. In both cases:
Before presenting results, analyze how failures correlate across jobs to distinguish PR-related issues from flakes and infra events:
When the same test fails in multiple different jobs for this PR, it strengthens the "PR-related" signal — the PR likely broke something that is exercised across environments. This is especially strong when the test passes consistently in periodic lanes but fails in all of this PR's presubmit runs.
When each job has different failures with no common tests, suspect independent flakes or separate infra events rather than a PR-caused issue. No single code change typically causes unrelated tests to fail in unrelated ways.
When many unrelated tests fail together in a single job but pass in other jobs, suspect an infrastructure flake in that specific run — node issues, network blips, storage problems. Check the k8s analysis for that build for corroborating evidence (NotReady nodes, CrashLoopBackOff, etcd issues).
If the PR has been retried and the same tests fail every time, it's almost certainly PR-related. If different tests fail on each retry, it's flaky infrastructure.
Present a concise summary to the user:
link for the most relevant error in each groupAfter the root-cause summary, suggest follow-up analyses when appropriate: