-
Notifications
You must be signed in to change notification settings - Fork 223
NO-ISSUE: Release manager helper using Claude skills #6351
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
Open
ggiguash
wants to merge
10
commits into
openshift:main
Choose a base branch
from
ggiguash:release-manager-claude
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,241
−7
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8040af8
Script to list microshift prow jobs for a release
ggiguash ba278cd
Develop a skill for per-release CI analysis
ggiguash 19ae9b7
Develop a skill for multiple release CI analysis summary
ggiguash 686a165
Relax allowed permissions to avoid unnecessary prompts
ggiguash 4ad2289
Address AI review comments
ggiguash 2c393b2
Develop a skill for rebase PR test analysis
ggiguash 02f361e
Update analyze-ci-for-release-manager to support rebase PR analysis
ggiguash 2597467
Fix openshift-ci-analysis agent file name
ggiguash d918754
Address AI Comments
ggiguash 1b459d9
Harden bash permissions
ggiguash 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
File renamed without changes.
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,260 @@ | ||
| --- | ||
| name: Analyze CI for Pull Requests | ||
| argument-hint: [--rebase] [--limit N] | ||
| description: Analyze CI for open MicroShift pull requests and produce a summary of failures | ||
| allowed-tools: Skill, Bash, Read, Write, Glob, Grep, Agent | ||
| --- | ||
|
|
||
| # analyze-ci-for-pull-requests | ||
|
|
||
| ## Synopsis | ||
| ``` | ||
| /analyze-ci-for-pull-requests [--rebase] [--limit N] | ||
| ``` | ||
|
|
||
| ## Description | ||
| Fetches all open MicroShift pull requests, identifies failed Prow CI jobs for each PR, analyzes each failure using the `openshift-ci-analysis` agent, and produces a text summary report. | ||
|
|
||
| This command orchestrates the analysis workflow by: | ||
|
|
||
| 1. Fetching the list of open PRs and their failed jobs using `.claude/scripts/microshift-prow-jobs-for-pull-requests.sh --mode detail` | ||
| 2. Filtering to only PRs that have at least one failed job | ||
| 3. Analyzing each failed job individually using the `openshift-ci-analysis` agent | ||
| 4. Aggregating results into a summary report saved to `/tmp` | ||
|
|
||
| ## Arguments | ||
| - `--rebase` (optional): Only analyze rebase PRs (titles containing `NO-ISSUE: rebase-release-`) | ||
| - `--limit N` (optional): Limit analysis to first N failed jobs total (useful for quick checks, default: all failed jobs) | ||
|
|
||
| ## Implementation Steps | ||
|
|
||
| ### Step 1: Fetch Open PRs and Their Job Results | ||
|
|
||
| **Goal**: Get the list of open PRs with failed Prow jobs. | ||
|
|
||
| **Actions**: | ||
| 1. Execute `.claude/scripts/microshift-prow-jobs-for-pull-requests.sh --mode detail` to get all open PRs and their job statuses. If `--rebase` was specified, add `--filter "NO-ISSUE: rebase-release-"` to only include rebase PRs | ||
| 2. Parse the output to identify PRs with failed jobs (lines containing `✗`) | ||
| 3. For each failed job, extract: | ||
| - PR number and title (from the `=== PR #NNN: ... ===` header lines) | ||
| - PR URL (line following the header) | ||
| - Job name (first column) | ||
| - Job URL (last column, the Prow URL) | ||
| 4. Apply `--limit N` if specified | ||
|
|
||
| **Example Commands**: | ||
| ```bash | ||
| # All open PRs | ||
| bash .claude/scripts/microshift-prow-jobs-for-pull-requests.sh --mode detail 2>/dev/null | ||
|
|
||
| # Rebase PRs only | ||
| bash .claude/scripts/microshift-prow-jobs-for-pull-requests.sh --mode detail --filter "NO-ISSUE: rebase-release-" 2>/dev/null | ||
| ``` | ||
|
|
||
| **Expected Output Format**: | ||
| ``` | ||
| === PR #6313: USHIFT-6636: Change test-agent impl to align with greenboot-rs === | ||
| https://github.com/openshift/microshift/pull/6313 | ||
|
|
||
| JOB STATUS URL | ||
| pull-ci-openshift-microshift-main-e2e-aws-tests ✗ https://prow.ci.openshift.org/view/gs/... | ||
| pull-ci-openshift-microshift-main-e2e-aws-tests-arm ✗ https://prow.ci.openshift.org/view/gs/... | ||
| ... | ||
| ``` | ||
|
|
||
| **Error Handling**: | ||
| - If no open PRs found, report "No open pull requests found" and exit successfully | ||
| - If no failed jobs across all PRs, report "All PR jobs are passing" and exit successfully | ||
| - If `microshift-prow-jobs-for-pull-requests.sh` fails, report error and exit | ||
|
|
||
| ### Step 2: Analyze Each Failed Job Using openshift-ci-analysis Agent | ||
|
|
||
| **Goal**: Get detailed root cause analysis for each failed job. | ||
|
|
||
| **Actions**: | ||
| 1. For each failed job URL from Step 1: | ||
| - Call the `openshift-ci-analysis` agent with the job URL **in parallel** | ||
| - Capture the analysis result (failure reason, error summary) | ||
| - Store all intermediate analysis files in `/tmp` | ||
|
|
||
| 2. Progress reporting: | ||
| - Show "Analyzing job X/Y: <job-name> (PR #NNN)" for each job | ||
| - Use the Agent tool to invoke `openshift-ci-analysis` for each URL | ||
| - **Run all job analyses in parallel** to maximize efficiency | ||
|
|
||
| **Data Collection**: | ||
| For each job analysis, extract: | ||
| - Job name | ||
| - Job URL | ||
| - PR number and title | ||
| - Failure type (build failure, test failure, infrastructure issue) | ||
| - Primary error/root cause | ||
| - Affected test scenarios (if applicable) | ||
|
|
||
| **File Storage**: | ||
| All intermediate analysis files are stored in `/tmp` with naming pattern: | ||
| - `/tmp/analyze-ci-prs-job-<N>-pr<PR>-<job-name-suffix>.txt` | ||
|
|
||
| ### Step 3: Aggregate Results and Identify Patterns | ||
|
|
||
| **Goal**: Find common failure patterns across all PRs and jobs. | ||
|
|
||
| **Actions**: | ||
| 1. Collect results from all parallel job analyses | ||
| - Read individual job analysis files from `/tmp` | ||
| - Extract key findings from each analysis | ||
|
|
||
| 2. Group failures by PR: | ||
| - List each PR with its failed jobs and root causes | ||
|
|
||
| 3. Identify common errors across PRs: | ||
| - Count occurrences of similar error messages | ||
| - Group jobs with identical root causes (e.g., same infrastructure issue affecting multiple PRs) | ||
|
|
||
| ### Step 4: Generate Summary Report | ||
|
|
||
| **Goal**: Present actionable summary to the user. | ||
|
|
||
| **Actions**: | ||
| 1. Aggregate all job analysis results from parallel execution | ||
| 2. Identify common patterns and group by PR and failure type | ||
| 3. Generate summary report and save to `/tmp/analyze-ci-prs-summary.<timestamp>.txt` | ||
| 4. Display the summary to the user | ||
|
|
||
| **Report Structure**: | ||
|
|
||
| ``` | ||
| ═══════════════════════════════════════════════════════════════ | ||
| MICROSHIFT OPEN PULL REQUESTS - FAILED JOBS ANALYSIS | ||
| ═══════════════════════════════════════════════════════════════ | ||
|
|
||
| OVERVIEW | ||
| Total Open PRs: 6 | ||
| PRs with Failures: 2 | ||
| Total Failed Jobs: 9 | ||
| Analysis Date: 2026-03-15 | ||
| Report: /tmp/analyze-ci-prs-summary.20260315-143022.txt | ||
|
|
||
| PER-PR BREAKDOWN | ||
|
|
||
| PR #6313: USHIFT-6636: Change test-agent impl to align with greenboot-rs | ||
| https://github.com/openshift/microshift/pull/6313 | ||
| Jobs: 8 passed, 7 failed | ||
|
|
||
| Failed Jobs: | ||
| 1. pull-ci-openshift-microshift-main-e2e-aws-tests | ||
| Status: FAILURE | ||
| Root Cause: [summarized from openshift-ci-analysis] | ||
| URL: https://prow.ci.openshift.org/view/gs/... | ||
|
|
||
| 2. pull-ci-openshift-microshift-main-e2e-aws-tests-arm | ||
| Status: FAILURE | ||
| Root Cause: [summarized] | ||
| URL: https://prow.ci.openshift.org/view/gs/... | ||
|
|
||
| ... (more failed jobs) | ||
|
|
||
| PR #6116: USHIFT-6491: Improve gitops test | ||
| https://github.com/openshift/microshift/pull/6116 | ||
| Jobs: 15 passed, 2 failed | ||
|
|
||
| Failed Jobs: | ||
| 1. pull-ci-openshift-microshift-main-e2e-aws-tests-bootc-periodic | ||
| Status: FAILURE | ||
| Root Cause: [summarized] | ||
| URL: https://prow.ci.openshift.org/view/gs/... | ||
|
|
||
| COMMON PATTERNS (across PRs) | ||
| If the same failure pattern appears in multiple PRs, list it here | ||
| with the affected PRs and jobs. | ||
|
|
||
| ═══════════════════════════════════════════════════════════════ | ||
|
|
||
| Individual job reports: /tmp/analyze-ci-prs-job-*.txt | ||
| ``` | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Example 1: Analyze All Failed PR Jobs | ||
|
|
||
| ``` | ||
| /analyze-ci-for-pull-requests | ||
| ``` | ||
|
|
||
| **Behavior**: | ||
| - Fetches all open PRs and their Prow job results | ||
| - Identifies PRs with failed jobs | ||
| - Analyzes each failed job | ||
| - Presents aggregated summary grouped by PR | ||
|
|
||
| ### Example 2: Analyze Only Rebase PRs | ||
|
|
||
| ``` | ||
| /analyze-ci-for-pull-requests --rebase | ||
| ``` | ||
|
|
||
| **Behavior**: | ||
| - Only includes PRs with `NO-ISSUE: rebase-release-` in the title | ||
| - Useful for release manager workflow to check rebase CI status | ||
|
|
||
| ### Example 3: Quick Analysis (First 5 Failed Jobs) | ||
|
|
||
| ``` | ||
| /analyze-ci-for-pull-requests --limit 5 | ||
| ``` | ||
|
|
||
| **Behavior**: | ||
| - Analyzes only first 5 failed jobs across all PRs | ||
| - Useful for quick health check | ||
|
|
||
| ## Performance Considerations | ||
|
|
||
| - **Execution Time**: Depends on number of failed jobs; parallel execution helps significantly | ||
| - **Network Usage**: Each job analysis fetches logs from GCS | ||
| - **Parallelization**: All job analyses run in parallel for maximum efficiency | ||
| - **Use --limit**: For quick checks, use --limit flag to analyze a subset | ||
| - **File Storage**: All intermediate and report files are stored in `/tmp` directory | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - `.claude/scripts/microshift-prow-jobs-for-pull-requests.sh` script must exist and be executable | ||
| - `openshift-ci-analysis` agent must be available | ||
| - `gh` CLI must be authenticated with access to openshift/microshift | ||
| - Internet access to fetch job data from GCS | ||
| - Bash shell | ||
|
|
||
| ## Error Handling | ||
|
|
||
| ### No Open PRs | ||
| ``` | ||
| No open pull requests found. | ||
| ``` | ||
|
|
||
| ### No Failed Jobs | ||
| ``` | ||
| All open PR jobs are passing! ✓ | ||
| No failures to analyze. | ||
| ``` | ||
|
|
||
| ### Script Not Found | ||
| ``` | ||
| Error: Could not find .claude/scripts/microshift-prow-jobs-for-pull-requests.sh | ||
| Please ensure you're in the microshift project directory. | ||
| ``` | ||
|
|
||
| ## Related Skills | ||
|
|
||
| - **openshift-ci-analysis**: Detailed analysis of a single job (used internally) | ||
| - **analyze-ci-for-release**: Similar analysis for periodic release jobs | ||
| - **analyze-ci-for-release-manager**: Multi-release analysis with HTML output | ||
| - **analyze-ci-test-scenario**: Analyze specific test scenario results | ||
|
|
||
| ## Notes | ||
|
|
||
| - This skill focuses on **presubmit** PR jobs (not periodic/postsubmit) | ||
| - Analysis is read-only - no modifications to CI data or PRs | ||
| - Results are saved in files in /tmp directory with a timestamp | ||
| - Provide links to the jobs in the summary | ||
| - Only present a concise analysis summary for each job | ||
| - PRs with no Prow jobs (e.g., drafts without triggered tests) are skipped | ||
| - Pattern detection improves with more jobs analyzed (avoid limiting unless needed) | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language identifiers to remaining fenced code blocks (MD040).
Several fences are still unlabeled, which keeps markdownlint warnings active. Use
bashfor command snippets andtextfor output blocks.Suggested doc patch
-
+text=== PR
#6313: USHIFT-6636: Change test-agent impl to align with greenboot-rs ===#6313
...
-
+textNo open pull requests found.
Also applies to: 55-63, 126-174, 180-182, 192-194, 202-204, 229-231, 234-237, 240-243
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 11-11: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents