From ci
Fetches recently reverted PRs from the Sippy API, categorizes root causes, and recommends preventive measures like new presubmit jobs or process changes.
How this command is triggered — by the user, by Claude, or both
Slash command
/ci:analyze-pr-reverts [limit]The summary Claude sees in its command listing — used to decide when to auto-load this command
## Name ci:analyze-pr-reverts ## Synopsis ## Description The `ci:analyze-pr-reverts` command fetches recently reverted pull requests from the Sippy API and analyzes them to identify common failure patterns, the most affected repositories, and recommends concrete preventive measures such as new presubmit jobs, org-wide CodeRabbit review rules, or process changes. This command is intended to be run periodically (e.g., monthly) to track revert trends over time. ## Implementation 1. **Fetch Revert PRs from Sippy API**: Query the Sippy API for PRs with "revert" in the title. - ...
ci:analyze-pr-reverts
/ci:analyze-pr-reverts [limit]
The ci:analyze-pr-reverts command fetches recently reverted pull requests from the Sippy API and analyzes them to identify common failure patterns, the most affected repositories, and recommends concrete preventive measures such as new presubmit jobs, org-wide CodeRabbit review rules, or process changes.
This command is intended to be run periodically (e.g., monthly) to track revert trends over time.
Fetch Revert PRs from Sippy API: Query the Sippy API for PRs with "revert" in the title.
curl -s 'https://sippy.dptools.openshift.org/api/pull_requests?release=Presubmits&filter=%7B%22items%22%3A%5B%7B%22columnField%22%3A%22title%22%2C%22operatorValue%22%3A%22contains%22%2C%22value%22%3A%22revert%22%7D%5D%2C%22linkOperator%22%3A%22and%22%7D&sortField=merged_at&sort=desc&limit=<LIMIT>'
merged_at, link, author, titleDeduplicate: Remove duplicate entries (same PR URL appearing multiple times).
Scrape PR Details: For each unique PR URL, fetch details using gh:
gh pr view <url> --json title,body,files,labels
Extract from each PR:
If a PR cannot be fetched (permissions, deleted, etc.), note it and continue.
Categorize Each Revert: Classify each revert into one or more of these root cause categories based on the PR description and the original PR that was reverted:
Generate Statistics:
e2e-metal-ipi-ovn-ipv6, e2e-aws-ovn-microshift)Generate Preventive Recommendations: Based on the patterns found, produce actionable recommendations in three areas:
For each pattern of reverts caused by missing platform coverage, recommend specific presubmit or payload jobs that should be added. Common recommendations include:
/payload-job e2e-metal-ipi-ovn-ipv6 to presubmit or require it before mergeBe specific about which repos need which jobs based on the data.
Recommend new review rules for the openshift/coderabbit repository's .coderabbit.yaml configuration. The coderabbit repo contains org-wide review guidelines that apply to all OpenShift repositories.
The existing .coderabbit.yaml already has checks for:
Based on the revert patterns, recommend NEW pre_merge_checks.custom_checks entries. For example:
0.0.0.0, 127.0.0.1) in network-related code, recommend dual-stack testingFor each recommendation, provide the complete YAML block that could be added to .coderabbit.yaml in the same format as the existing checks (name, mode, instructions).
Format the Report: Output a well-structured markdown report with the following sections:
## PR Revert Analysis Report
### Date Range: [earliest] to [latest merged_at]
### Summary
### Reverts by Repository
### Reverts by Root Cause Category
### Repeat Reverts (PRs reverted more than once)
### Most Common Failing Job Profiles
### Detailed Revert List (table with: repo, PR link, category, brief reason)
### Recommendations
#### New Presubmit Jobs
#### New CodeRabbit Review Rules
#### Process Improvements
All PR links in the report MUST use full GitHub URLs (e.g., https://github.com/openshift/machine-config-operator/pull/5703), never shorthand references like #5703 which would resolve relative to whatever repo the reader is viewing.
.coderabbit.yamlBasic usage (fetches last 50 revert PRs):
/ci:analyze-pr-reverts
With custom limit:
/ci:analyze-pr-reverts 100
$1 (optional): Maximum number of revert PRs to fetch from the Sippy API. Defaults to 50.GitHub CLI (gh): Must be installed and authenticated
gh auth statusNetwork access: Must be able to reach sippy.dptools.openshift.org
gh (private repos, deleted PRs, permission issues). These are noted in the report but don't block analysis.Azure/ARO-HCP) may have limited gh access. Include them in stats but note if details couldn't be fetched.warning not error) to avoid blocking legitimate PRs while the rules are tuned.ci:revert-pr - Create a revert PR for a breaking changenpx claudepluginhub shivprakashmuley/ai-helpers --plugin ci/analyze-pr-revertsFetches recently reverted PRs from the Sippy API, categorizes root causes, and recommends preventive measures like new presubmit jobs or process changes.
/rollbackCreates a GitHub revert PR to roll back a shipped feature or fix that caused a production incident. Supports PR number, issue number, or "last" for the most recent merge.
/coderabbit-rules-from-pr-reviewsAnalyzes human review comments on recent merged PRs to identify recurring patterns and propose CodeRabbit rules for the repo's .coderabbit.yaml, then optionally opens a PR with the changes.
/pr-reviewReviews PR or branch with CodeRabbit-style analysis: line-by-line code review, security scanning, test coverage, risk assessment, and one-click fixes.
/distill-standardsMines merged PRs for review feedback and conventions, then distills them into .claude/standards.md. Also supports absorbing a single PR or regenerating from the last N PRs.
/pr-fixClassifies PR review comments by priority and guides root-cause analysis of CI errors using a 3-stage approach.