Repository navigation
Add ci:fetch-payloads and ci:analyze-payload skills #337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 19 commits into
openshift-eng:main
from
stbenjam:analyze-payload
Feb 27, 2026
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2bf1ec4
Add ci:fetch-payloads skill for querying release controller payloads
626cfc3
Fix fetch-payloads command docs: correct example and skills section
8f8ef01
feat(ci): add analyze-payload command for rejected payload investigation
7e50945
feat(ci): check for existing reverts before recommending revert
bd63667
feat(ci): align analyze-payload args with fetch-payloads
f9e5943
fix(ci): use -summary.html suffix for analyze-payload report
91eeefb
chore: run make update
0fb0569
chore: bump ci plugin version to 0.0.10
5ac629e
feat(ci): support Ready payloads in analyze-payload
88b3393
`make update`
ff9902d
feat(ci): accept full payload tag in analyze-payload
672011d
Merge remote-tracking branch 'upstream/main' into analyze-payload
54c4e41
fix(ci): use install analysis skills for install failures in analyze-…
e5c0249
fix(ci): use CLAUDE_PLUGIN_ROOT for script paths in fetch skills
f69bc52
fix(ci): remove nightly-specific language from analyze-payload skill
47faa51
Merge remote-tracking branch 'upstream/main' into analyze-payload
df88a6c
`make update`
a64d0ef
Workaround for https://github.com/anthropics/claude-code/issues/9354
1ed7c98
make update
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| --- | ||
| description: Analyze a rejected or in-progress payload with historical lookback to identify root causes of blocking job failures | ||
| argument-hint: "<payload-tag> [architecture] [--lookback N]" | ||
| --- | ||
|
|
||
| ## Name | ||
|
|
||
| ci:analyze-payload | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ``` | ||
| /ci:analyze-payload <payload-tag> [architecture] [--lookback N] | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| The `ci:analyze-payload` command analyzes a specific payload tag, investigates every failed blocking job, and produces a self-contained HTML report summarizing what went wrong. | ||
|
|
||
| It supports both **Rejected** payloads (full analysis) and **Ready** payloads (early analysis of blocking jobs that have already failed, to determine if the payload is on track for rejection). | ||
|
|
||
| It performs **historical lookback** through consecutive rejected payloads to determine when each failure first appeared. For each originating payload (where a job first started failing), it fetches the new PRs introduced in that payload as likely culprits. This distinguishes new failures from persistent/permafailing jobs and helps identify the root cause commits. | ||
|
|
||
| When a suspect PR can be correlated with high confidence (>= 90%) to a blocking job failure — based on component match, error analysis, and timing — the report will **recommend it for revert** with a rationale. The `/ci:revert-pr` command can then be used to execute the revert. | ||
|
|
||
| Failed jobs are investigated **in parallel** using subagents with the appropriate analysis skill (install failure vs test failure). | ||
|
|
||
| ### Key Features | ||
|
|
||
| - **Historical lookback**: Walks back through up to N consecutive rejected payloads (default 10) to find when each job first started failing | ||
| - **PR correlation**: Uses the `fetch-new-prs-in-payload` skill to identify PRs that landed in the originating payload for each failure | ||
| - **Parallel investigation**: Kicks off subagents for each failed blocking job using the appropriate CI analysis skill | ||
| - **Revert recommendations**: Proposes specific PRs to revert when the evidence strongly links them to a failure | ||
| - **HTML report**: Generates an attractive, self-contained HTML report with collapsible sections, color-coded severity, and executive summary | ||
|
|
||
| ## Implementation | ||
|
|
||
| Load the "Analyze Payload" skill and follow its implementation steps. The skill orchestrates: | ||
|
|
||
| 1. Fetching recent rejected payloads using the `fetch-payloads` skill | ||
| 2. Walking back through consecutive rejected payloads to build failure history | ||
| 3. Fetching new PRs in originating payloads using the `fetch-new-prs-in-payload` skill | ||
| 4. Launching parallel subagents to investigate each failed job | ||
| 5. Generating the final HTML report | ||
|
|
||
| ## Return Value | ||
|
|
||
| - **Format**: Self-contained HTML file saved to the current working directory | ||
| - **Filename**: `payload-analysis-{tag}-summary.html` | ||
| - **Contents**: | ||
| - Executive summary with overall payload health | ||
| - Summary table of all blocking jobs (pass/fail) | ||
| - Per-job failure analysis with root cause, error messages, and logs | ||
| - Failure streak length (how many consecutive payloads each job has failed) | ||
| - Originating payload and suspect PRs for each persistent failure | ||
| - Recommended reverts section with PR links, rationale, and `/ci:revert-pr` instructions | ||
| - Color-coded severity and collapsible detail sections | ||
|
|
||
| ## Examples | ||
|
|
||
| 1. **Analyze a nightly payload**: | ||
| ``` | ||
| /ci:analyze-payload 4.22.0-0.nightly-2026-02-25-152806 | ||
| ``` | ||
|
|
||
| 2. **Analyze a CI stream payload**: | ||
| ``` | ||
| /ci:analyze-payload 4.22.0-0.ci-2026-02-25-152806 | ||
| ``` | ||
|
|
||
| 3. **Analyze with specific architecture**: | ||
| ``` | ||
| /ci:analyze-payload 4.22.0-0.nightly-2026-02-25-152806 arm64 | ||
| ``` | ||
|
|
||
| 4. **Analyze with deeper lookback**: | ||
| ``` | ||
| /ci:analyze-payload 4.22.0-0.nightly-2026-02-25-152806 amd64 --lookback 20 | ||
| ``` | ||
|
|
||
| ## Arguments | ||
|
|
||
| - $1: A full payload tag (e.g., `4.22.0-0.nightly-2026-02-25-152806`). Version and stream are parsed from the tag automatically. (required) | ||
| - $2: CPU architecture (optional, default: amd64) — amd64, arm64, ppc64le, s390x, multi | ||
| - `--lookback N`: Maximum number of consecutive rejected payloads to examine (optional, default: 10) | ||
|
|
||
| ## Skills Used | ||
|
|
||
| - `fetch-payloads`: Fetches recent payloads from the release controller | ||
| - `fetch-new-prs-in-payload`: Identifies PRs new in a given payload vs its predecessor | ||
| - `prow-job-analyze-install-failure`: Analyzes install failures (used by subagents) | ||
| - `prow-job-analyze-test-failure`: Analyzes test failures (used by subagents) | ||
| - `revert-pr`: Referenced in recommendations for executing reverts of identified culprit PRs |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| description: Fetch recent release payloads from the OpenShift release controller | ||
| argument-hint: "[architecture] [version] [stream]" | ||
| --- | ||
|
|
||
| ## Name | ||
|
|
||
| ci:fetch-payloads | ||
|
|
||
| ## Synopsis | ||
|
|
||
| ``` | ||
| /ci:fetch-payloads [architecture] [version] [stream] | ||
| ``` | ||
|
|
||
| ## Description | ||
|
|
||
| The `ci:fetch-payloads` command fetches recent release payloads from the OpenShift release controller. It shows each payload's tag name, phase (Accepted/Rejected/Ready), timestamp, and blocking job results. For rejected payloads, it reports which blocking jobs failed with Prow links. | ||
|
|
||
| ## Implementation | ||
|
|
||
| 1. **Determine parameters**: Default to `amd64` architecture and `nightly` stream if the user hasn't specified them. If no version is provided, the script fetches the latest from the Sippy API. | ||
|
|
||
| 2. **Fetch payloads**: Use the `fetch-payloads` skill: | ||
| ```bash | ||
| FETCH_PAYLOADS="${CLAUDE_PLUGIN_ROOT}/skills/fetch-payloads/fetch_payloads.py" | ||
| if [ ! -f "$FETCH_PAYLOADS" ]; then | ||
| FETCH_PAYLOADS=$(find ~/.claude/plugins -type f -path "*/ci/skills/fetch-payloads/fetch_payloads.py" 2>/dev/null | sort | head -1) | ||
| fi | ||
| if [ -z "$FETCH_PAYLOADS" ] || [ ! -f "$FETCH_PAYLOADS" ]; then echo "ERROR: fetch_payloads.py not found" >&2; exit 2; fi | ||
| python3 "$FETCH_PAYLOADS" [architecture] [version] [stream] | ||
| ``` | ||
|
|
||
| Optional flags: | ||
| - `--phase Accepted|Rejected|Ready` to filter by phase | ||
| - `--limit N` to control how many results to show (default 5) | ||
|
|
||
| 3. **Present the results**: Show the user the payload list. For rejected payloads, highlight the failed blocking jobs and their Prow links. | ||
|
|
||
| ## Return Value | ||
|
|
||
| - **Format**: One block per payload with tag, phase, timestamp, URL, and job details | ||
| - **Rejected payloads**: Each failed blocking job is listed with retry count and Prow link | ||
| - **Ready payloads**: Summary of succeeded/pending/failed blocking job counts | ||
| - **Accepted payloads**: Confirmation that all blocking jobs succeeded | ||
|
|
||
| ## Examples | ||
|
|
||
| 1. **Latest nightly payloads (defaults to amd64, latest version, last 5)**: | ||
| ``` | ||
| /ci:fetch-payloads | ||
| ``` | ||
|
|
||
| 2. **Specific version and architecture**: | ||
| ``` | ||
| /ci:fetch-payloads arm64 4.18 nightly | ||
| ``` | ||
|
|
||
| 3. **Only accepted payloads**: | ||
| ``` | ||
| /ci:fetch-payloads amd64 4.23 nightly --phase Accepted | ||
| ``` | ||
|
stbenjam marked this conversation as resolved.
Resolved
|
||
|
|
||
| ## Arguments | ||
|
|
||
| - $1: CPU architecture (optional, default: amd64) — amd64, arm64, ppc64le, s390x, multi | ||
| - $2: OCP version (optional, default: latest from Sippy) — e.g., 4.18, 4.23 | ||
| - $3: Release stream (optional, default: nightly) — nightly, ci | ||
|
|
||
| ## Skills Used | ||
|
|
||
| - `fetch-payloads`: Queries the release controller API for payload tags and release details. When no version is specified, `fetch_payloads.py` obtains the latest version directly from the Sippy API. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.