feat(ci): add /check-release-rollback skill#35620
Conversation
Adds a Claude Code slash command that checks whether a dotCMS release can be safely rolled back to a previous version. Given two version strings (e.g. 26.04.28-02_7149dce → 26.04.11-02_9650131) the skill: - Extracts all merged PRs between the two commits via git log - Fetches title + labels for each PR via gh CLI - Classifies each as: Safe / Not Safe / Conflicting / Unlabeled - Outputs a structured report with linked PRs and risk notes - Returns a clear YES / NO / CONDITIONAL verdict - Optionally saves the report as a .txt file Motivated by the Lennox production incident (ticket #36966) where a manual version of this check was performed and revealed PRs labeled "Not Safe To Rollback" blocking a rollback from 26.04.28-02. Usage: /check-release-rollback <current-version> <target-version> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ Issue Linking RequiredThis PR could not be linked to an issue. All PRs must be linked to an issue for tracking purposes. How to fix this:Option 1: Add keyword to PR body (Recommended - auto-removes this comment)
Why is this required?Issue linking ensures proper tracking, documentation, and helps maintain project history. It connects your code changes to the problem they solve.--- This comment was automatically generated by the issue linking workflow |
|
Claude finished @dsilvam's task in 2m 21s —— View job ReviewA few real issues — most importantly one that likely prevents the skill from registering at all. 1. Missing YAML frontmatter on Every other skill in ---
name: check-release-rollback
description: Check whether a dotCMS release can be safely rolled back to a previous version by inspecting all PRs merged between the two versions for rollback safety labels. Trigger when the user asks to verify rollback safety between two release versions.
---2. "Canonical source" claim is misleading Step 4 says: "Label constants (canonical source:
If the categorize.ts file is changed, this skill won't follow. Either (a) drop the "canonical source" framing and own the constants explicitly, or (b) actually mirror them. The narrowed 3. Step 3 date window can miss backport PRs TARGET_DATE=$(git log -1 --format="%aI" <target-sha>)
CURRENT_DATE=$(git log -1 --format="%aI" <current-sha>)
gh pr list ... --search "merged:>=${TARGET_DATE} merged:<=${CURRENT_DATE}"
Fix: use commit date 4. For long release windows (months between LTS lines) you can blow past 500. Cross-referencing with 5. CONFLICTING verdict is more permissive than NOT_SAFE A PR with both 6. Step 6 writes to cwd
Minor
Approvals are already on the PR — none of the above blocks merge except #1, which I'd verify before shipping by running |
- Remove hardcoded /Users/... fallback path; use git rev-parse --show-toplevel - Fix classification order: CONFLICTING → NOT_SAFE → SAFE → UNLABELED (CONFLICTING was previously unreachable due to overlapping NOT_SAFE rule) - Implement case-insensitive label matching (lowercase both sides) - Redefine YES verdict: no NOT_SAFE + no CONFLICTING; CI/infra unlabeled PRs no longer block YES (avoids unreachable YES in practice) - Replace per-PR gh pr view loop with single gh pr list date-range call to avoid rate limiting on large release windows - Reference canonical ROLLBACK_UNSAFE_LABELS from categorize.ts as single source of truth for label constants - Restructure as thin slash command + SKILL.md (follows repo pattern) - Add input format validation with clear error message on bad input - Add explicit failure path if SHA unresolvable after git fetch - Document the "last #NNNNN = merged PR" extraction choice Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Adds a new Claude Code slash command
.claude/commands/check-release-rollback.mdthat automates rollback safety checks between any two dotCMS releases.What it does
Given two version strings (e.g.
26.04.28-02_7149dce→26.04.11-02_9650131):git logghCLI.txtfileUsage:
Motivation
During a customer's production incident (ticket #36966), a manual rollback safety check was performed and revealed multiple PRs labeled
AI: Not Safe To Rollbackblocking the rollback from26.04.28-02. This skill automates that process so any engineer or support agent can run it in seconds.Related:
Test plan
/check-release-rollback 26.04.28-02_7149dce 26.04.11-02_9650131and verify output matches the manually produced report🤖 Generated with Claude Code