-
Notifications
You must be signed in to change notification settings - Fork 227
USHIFT-6760: 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
Merged
openshift-merge-bot
merged 10 commits into
openshift:main
from
ggiguash:release-manager-claude
Mar 18, 2026
+1,244
−7
Merged
Changes from 4 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 12b7d04
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
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,223 @@ | ||
| --- | ||
| name: Analyze CI for Release Manager | ||
| argument-hint: <release1,release2,...> | ||
| description: Analyze CI for multiple MicroShift releases and produce an HTML summary | ||
| allowed-tools: Skill, Bash, Read, Write, Glob, Grep, Agent | ||
| --- | ||
|
|
||
| # analyze-ci-for-release-manager | ||
|
|
||
| ## Synopsis | ||
| ``` | ||
| /analyze-ci-for-release-manager <release1,release2,...> | ||
| ``` | ||
|
|
||
| ## Description | ||
| Accepts a comma-separated list of MicroShift release versions, runs the `analyze-ci-for-release` skill for each release, and produces a single HTML summary file consolidating all per-release results. | ||
|
|
||
| ## Arguments | ||
| - `$ARGUMENTS` (required): Comma-separated list of release versions (e.g., `4.19,4.20,4.21,4.22`) | ||
|
|
||
| ## Implementation Steps | ||
|
|
||
| ### Step 1: Parse and Validate Arguments | ||
|
|
||
| **Actions**: | ||
| 1. Split `$ARGUMENTS` by comma to get a list of release versions | ||
| 2. Trim whitespace from each version | ||
| 3. Validate that at least one release version is provided | ||
| 4. If no arguments provided, show usage and stop | ||
|
|
||
| **Error Handling**: | ||
| - If `$ARGUMENTS` is empty, display: "Usage: /analyze-ci-for-release-manager <release1,release2,...>" and stop | ||
|
|
||
| ### Step 2: Analyze Each Release | ||
|
|
||
| **Actions**: | ||
| 1. For each release version from the parsed list, invoke the `analyze-ci-for-release` skill: | ||
| ``` | ||
| Skill: analyze-ci-for-release, args: "<version>" | ||
| ``` | ||
| 2. Run releases **sequentially** (each skill invocation is a full analysis) | ||
| 3. After each skill completes, note the summary report file path it produced (typically `/tmp/analyze-ci-release-<version>-summary.*.txt`) | ||
| 4. Track which releases succeeded and which failed | ||
|
|
||
| **Progress Reporting**: | ||
| ``` | ||
| Analyzing release X/Y: <version> | ||
| ``` | ||
|
|
||
| ### Step 3: Collect Per-Release Results | ||
|
|
||
| **Actions**: | ||
| 1. After all releases are analyzed, gather all summary files: | ||
| - Look for `/tmp/analyze-ci-release-<version>-summary.*.txt` for each version | ||
| - Also look for per-job files: `/tmp/analyze-ci-release-<version>-job-*.txt` | ||
| 2. Read each summary file to extract the analysis content | ||
| 3. If a summary file is missing for a release, note it as "Analysis failed or produced no output" | ||
|
|
||
| ### Step 4: Generate HTML Summary Report | ||
|
|
||
| **Goal**: Create a single HTML file at `/tmp/microshift-ci-release-manager-<timestamp>.html` that consolidates all per-release analyses. | ||
|
|
||
| **Actions**: | ||
| 1. Generate the HTML report with the structure described below | ||
| 2. Save to `/tmp/microshift-ci-release-manager-<timestamp>.html` where `<timestamp>` is `YYYYMMDD-HHMMSS` | ||
| 3. **IMPORTANT**: Use the `Bash` tool with `cat <<'HTMLEOF' > /tmp/microshift-ci-release-manager-<timestamp>.html` (heredoc) to write the file, NOT the `Write` tool. This ensures the absolute `/tmp` path is used and avoids permission prompts. | ||
| 4. Display the file path to the user in the end. | ||
|
|
||
| **HTML Structure**: | ||
|
|
||
| The HTML file must be a self-contained, single-file document with embedded CSS. Use the following structure: | ||
|
|
||
| ```html | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>MicroShift CI Release Manager Report - YYYY-MM-DD</title> | ||
| <style> | ||
| /* Clean, professional styling */ | ||
| body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0; padding: 20px; background: #f5f5f5; color: #333; } | ||
| .container { max-width: 1200px; margin: 0 auto; } | ||
| h1 { color: #1a1a2e; border-bottom: 3px solid #e94560; padding-bottom: 10px; } | ||
| .release-section { background: white; border-radius: 8px; padding: 20px; margin: 20px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } | ||
| .release-header { display: flex; justify-content: space-between; align-items: center; } | ||
| .release-header h2 { color: #16213e; margin: 0; } | ||
| .badge { padding: 4px 12px; border-radius: 12px; font-size: 0.85em; font-weight: 600; } | ||
| .badge-ok { background: #d4edda; color: #155724; } | ||
| .badge-issues { background: #fff3cd; color: #856404; } | ||
| .badge-critical { background: #f8d7da; color: #721c24; } | ||
| .badge-nodata { background: #e2e3e5; color: #383d41; } | ||
| .summary-table { width: 100%; border-collapse: collapse; margin: 15px 0; } | ||
| .summary-table th, .summary-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #eee; } | ||
| .summary-table th { background: #f8f9fa; font-weight: 600; color: #495057; } | ||
| .summary-table tr:hover { background: #f8f9fa; } | ||
| .status-pass { color: #28a745; } | ||
| .status-fail { color: #dc3545; } | ||
| .overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 20px 0; } | ||
| .overview-card { background: white; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } | ||
| .overview-card .number { font-size: 2em; font-weight: 700; } | ||
| .overview-card .label { color: #6c757d; font-size: 0.9em; } | ||
| .content-block { white-space: pre-wrap; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.85em; background: #f8f9fa; padding: 15px; border-radius: 4px; border: 1px solid #e9ecef; overflow-x: auto; margin: 10px 0; } | ||
| .collapsible { cursor: pointer; user-select: none; } | ||
| .collapsible::before { content: '\25B6 '; font-size: 0.8em; } | ||
| .collapsible.active::before { content: '\25BC '; } | ||
| .collapsible-content { display: none; } | ||
| .collapsible-content.show { display: block; } | ||
| .toc { background: white; border-radius: 8px; padding: 20px; margin: 20px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } | ||
| .toc ul { list-style: none; padding-left: 0; } | ||
| .toc li { padding: 5px 0; } | ||
| .toc a { color: #0366d6; text-decoration: none; } | ||
| .toc a:hover { text-decoration: underline; } | ||
| .timestamp { color: #6c757d; font-size: 0.9em; } | ||
| a { color: #0366d6; } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <h1>MicroShift CI Release Manager Report</h1> | ||
| <p class="timestamp">Generated: YYYY-MM-DD HH:MM:SS UTC</p> | ||
|
|
||
| <!-- Overview cards: one per release with total failed jobs count --> | ||
| <div class="overview-grid"> | ||
| <!-- One card per release --> | ||
| <div class="overview-card"> | ||
| <div class="number status-fail">N</div> | ||
| <div class="label">Release X.YY Failed Jobs</div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Table of Contents --> | ||
| <div class="toc"> | ||
| <h3>Releases Analyzed</h3> | ||
| <ul> | ||
| <li><a href="#release-X.YY">Release X.YY</a></li> | ||
| </ul> | ||
| </div> | ||
|
|
||
| <!-- Per-release sections --> | ||
| <div class="release-section" id="release-X.YY"> | ||
| <div class="release-header"> | ||
| <h2>Release X.YY</h2> | ||
| <span class="badge badge-issues">N failed jobs</span> | ||
| </div> | ||
|
|
||
| <!-- Embed the full analysis content from analyze-ci-for-release --> | ||
| <!-- Convert the text report content into formatted HTML --> | ||
| <!-- Preserve all details: job names, failure types, patterns, severities, links --> | ||
| <div class="content-block"> | ||
| ... analysis content ... | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Repeat for each release --> | ||
| </div> | ||
|
|
||
| <script> | ||
| // Collapsible sections | ||
| document.querySelectorAll('.collapsible').forEach(function(el) { | ||
| el.addEventListener('click', function() { | ||
| this.classList.toggle('active'); | ||
| var content = this.nextElementSibling; | ||
| content.classList.toggle('show'); | ||
| }); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> | ||
| ``` | ||
|
|
||
| **Content Guidelines**: | ||
| - Do NOT re-analyze or reinterpret the data from `analyze-ci-for-release` - use its output as-is | ||
| - Convert the plain text analysis reports into HTML-formatted content, preserving all information | ||
| - Ensure all Prow job URLs from the original analysis remain clickable links in the HTML | ||
| - Use appropriate badge colors: | ||
|
Comment on lines
+244
to
+247
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Escape report content before HTML injection. Line 245/246 guidance can lead to raw analysis text being embedded directly into HTML. Require HTML-escaping first, then linkify URLs, so CI/log content cannot execute scripts in the generated report. Suggested doc patch-- Convert the plain text analysis reports into HTML-formatted content, preserving all information
-- Ensure all Prow job URLs from the original analyses remain clickable links in the HTML
+- Convert plain text analysis reports into HTML safely: **escape all content first** (`& < > " '`)
+- After escaping, linkify only trusted URL patterns (e.g., `https://prow.ci.openshift.org/...`) so links stay clickable without allowing raw HTML/JS injection🤖 Prompt for AI Agents |
||
| - `badge-ok`: 0 failed jobs | ||
| - `badge-issues`: 1+ failed jobs | ||
| - `badge-critical`: 5+ failed jobs or CRITICAL severity issues present | ||
| - `badge-nodata`: analysis failed or no data | ||
| - Make per-job details collapsible to keep the page manageable | ||
| - The overview cards should show the number of failed jobs per release at a glance | ||
|
|
||
| ### Step 5: Report Completion | ||
|
|
||
| **Actions**: | ||
| 1. Display the path to the generated HTML file | ||
| 2. Provide a brief text summary listing each release and its failed job count | ||
|
|
||
| **Example Output**: | ||
| ``` | ||
| HTML report generated: /tmp/microshift-ci-release-manager-20260315-143022.html | ||
|
|
||
| Summary: | ||
| Release 4.19: 3 failed periodic jobs | ||
| Release 4.20: 7 failed periodic jobs | ||
| Release 4.21: 0 failed periodic jobs | ||
| Release 4.22: 12 failed periodic jobs | ||
| ``` | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Example 1: Analyze Multiple Releases | ||
| ``` | ||
| /analyze-ci-for-release-manager 4.19,4.20,4.21,4.22 | ||
| ``` | ||
|
|
||
| ### Example 2: Analyze Two Releases | ||
| ``` | ||
| /analyze-ci-for-release-manager 4.21,4.22 | ||
| ``` | ||
|
|
||
| ### Example 3: Single Release (still produces HTML) | ||
| ``` | ||
| /analyze-ci-for-release-manager 4.22 | ||
| ``` | ||
|
|
||
| ## Notes | ||
| - Each release analysis uses the `analyze-ci-for-release` skill - this command does NOT duplicate that logic | ||
| - The HTML report is self-contained (no external CSS/JS dependencies) | ||
| - All intermediate files from `analyze-ci-for-release` remain available in `/tmp` | ||
| - Releases are analyzed sequentially since each invocation is resource-intensive | ||
| - The HTML file can be opened in any browser for convenient examination | ||
| - If a release analysis fails, it is noted in the report but does not block other releases | ||
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.