Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"name": "ci",
"source": "./plugins/ci",
"description": "A plugin to work with OpenShift CI and analyze Prow job results",
"version": "0.0.8"
"version": "0.0.10"
},
{
"name": "teams",
Expand Down
2 changes: 2 additions & 0 deletions PLUGINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ Tools for working with OpenShift CI and analyzing Prow job results

**Commands:**
- **`/ci:add-debug-wait` `<workflow-or-job-name> [timeout]`** - Add a wait step to a CI workflow for debugging test failures
- **`/ci:analyze-payload` `[payload-tag-or-version] [architecture] [stream] [--lookback N]`** - Analyze a rejected or in-progress payload with historical lookback to identify root causes of blocking job failures
- **`/ci:analyze-prow-job-install-failure` `<prowjob-url>`** - Analyze OpenShift installation failures in Prow CI jobs
- **`/ci:analyze-prow-job-resource` `prowjob-url resource-name`** - Analyze Kubernetes resource lifecycle in Prow job artifacts
- **`/ci:analyze-prow-job-test-failure` `prowjob-url test-name [--fast]`** - Analyzes test errors from console logs and Prow CI job artifacts
- **`/ci:analyze-regression` `<regression id>`** - Analyze details about a Component Readiness regression and suggest next steps
- **`/ci:ask-sippy` `[question]`** - Ask the Sippy AI agent questions about OpenShift CI payloads, jobs, and test results
- **`/ci:check-if-jira-regression-is-ongoing` `<jira-key-or-url>`** - Check if the regression described in a Jira bug is still ongoing or has resolved
- **`/ci:extract-prow-job-must-gather` `prowjob-url`** - Extract and decompress must-gather archives from Prow job artifacts
- **`/ci:fetch-payloads` `[architecture] [version] [stream]`** - Fetch recent release payloads from the OpenShift release controller
- **`/ci:fetch-test-report` `<test-name> [release]`** - Fetch a test report from Sippy showing pass rates, test ID, and Jira component
- **`/ci:list-step` `<workflow-or-chain-name>`** - List the step for the given workflow or chain name
- **`/ci:list-unstable-tests` `<version> <keywords> [sippy-url]`** - List unstable tests with pass rate below 95%
Expand Down
24 changes: 23 additions & 1 deletion docs/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@
"name": "add-debug-wait",
"synopsis": "/ci:add-debug-wait <workflow-or-job-name> [timeout]"
},
{
"argument_hint": "[payload-tag-or-version] [architecture] [stream] [--lookback N]",
"description": "Analyze a rejected or in-progress payload with historical lookback to identify root causes of blocking job failures",
"name": "analyze-payload",
"synopsis": "/ci:analyze-payload [payload-tag-or-version] [architecture] [stream] [--lookback N]"
},
{
"argument_hint": "<prowjob-url>",
"description": "Analyze OpenShift installation failures in Prow CI jobs",
Expand Down Expand Up @@ -330,6 +336,12 @@
"name": "extract-prow-job-must-gather",
"synopsis": "bash"
},
{
"argument_hint": "[architecture] [version] [stream]",
"description": "Fetch recent release payloads from the OpenShift release controller",
"name": "fetch-payloads",
"synopsis": "/ci:fetch-payloads [architecture] [version] [stream]"
},
{
"argument_hint": "<test-name> [release]",
"description": "Fetch a test report from Sippy showing pass rates, test ID, and Jira component",
Expand Down Expand Up @@ -390,6 +402,11 @@
"hooks": [],
"name": "ci",
"skills": [
{
"description": "Analyze a rejected or in-progress payload with historical lookback to identify root causes of blocking job failures and produce an HTML report",
"id": "analyze-payload",
"name": "Analyze Payload"
},
{
"description": "Fetch JIRA issue details including status, assignee, comments, and progress classification",
"id": "fetch-jira-issue",
Expand All @@ -400,6 +417,11 @@
"id": "fetch-new-prs-in-payload",
"name": "Fetch New PRs in Payload"
},
{
"description": "Fetch recent release payloads from the OpenShift release controller",
"id": "fetch-payloads",
"name": "Fetch Payloads"
},
{
"description": "Fetch and return key data from a Prow job's prowjob.json artifact given a Prow job URL",
"id": "fetch-prowjob-json",
Expand Down Expand Up @@ -481,7 +503,7 @@
"name": "Triage Regression"
}
],
"version": "0.0.8"
"version": "0.0.10"
},
{
"commands": [
Expand Down
2 changes: 1 addition & 1 deletion plugins/ci/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ci",
"description": "Tools for working with OpenShift CI and analyzing Prow job results",
"version": "0.0.8",
"version": "0.0.10",
"author": {
"name": "openshift"
}
Expand Down
93 changes: 93 additions & 0 deletions plugins/ci/commands/analyze-payload.md
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
72 changes: 72 additions & 0 deletions plugins/ci/commands/fetch-payloads.md
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]
```
Comment thread
stbenjam marked this conversation as resolved.
Resolved

## 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
```
Comment thread
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.
Loading
Loading