Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

validate-bug

БесплатноБез исполняемых скриптовНе проверен

Diagnose and fix jira/invalid-bug on PRs by running the same 7 checks as the jira-lifecycle-plugin

openshift-engот openshift-eng★ 123 звезды на GitHub

Об этом скилле

JIRA Bug Validator — Implementation Guide

IMPORTANT FOR AI: This is a procedural skill. Execute each phase in order. Do not skip steps. Do not invent field IDs — use only the documented custom field IDs below.

This skill replicates the validation logic of the jira-lifecycle-plugin (Prow external plugin) that applies the jira/invalid-bug label to PRs in OpenShift repositories.

Custom Field Reference

Field Custom Field ID JQL Name
Target Version customfield_10855 "Target Version"
Release Note Text customfield_10783 —
Release Note Type customfield_10785 —
Severity customfield_10840 —

The 7 Validation Checks

The jira-lifecycle-plugin runs these checks in order. A bug must pass ALL checks to get jira/valid-bug.

# Check What it validates
1 Bug is open Status is not "Closed"
2 Target version matches branch Bug's Target Version matches the expected version for the PR's base branch
3 Bug in valid state Status is one of: NEW, ASSIGNED, POST
4 Release notes set Release note text is non-empty and doesn't match the default template, OR release note type is "Release Note Not Required"
5 Dependent bug states Each dependent (linked via "Blocks") is in an allowed state
6 Dependent bug target versions Each dependent targets an allowed version
7 Dependents exist At least one "Blocks" link exists to a bug in the same project

Checks 5-7 only apply to release branches (release-4.X), not main/master.

Branch-to-Version Mapping

The plugin config follows a mechanical pattern:

Target version (what the bug on the PR's branch must target):

  • release-4.X → 4.X.z (prefix match — 4.X.0 also accepted)
  • main / master → 5.0.0 (prefix match — 5.0 also accepted). Update when main targets a new major version — check openshift/release/core-services/jira-lifecycle-plugin/config.yaml for the current value.

Dependent target version (what the "Blocks" linked bug must target):

  • release-4.X → 4.(X+1).0 or 4.(X+1).z

Valid states for the bug itself (all branches):

  • NEW, ASSIGNED, POST

Valid states for dependent bugs (varies by branch — check openshift/release/core-services/jira-lifecycle-plugin/config.yaml for current boundaries):

  • release-4.22 and newer: MODIFIED, ON_QA, VERIFIED
  • release-4.6 through release-4.21: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA)

Dependent bug checks (checks 5-7):

  • Required for release-4.X branches
  • NOT required for main / master (config sets exclude_defaults: true)

Release notes:

  • Required by default (require_release_notes: true)
  • Default template text (must NOT match this): "Cause: What actions or circumstances cause this bug to present.\r\nConsequence: What happens when the bug presents.\r\nFix: What was done to fix the bug.\r\nResult: Bug doesn't present anymore."

Prerequisites

  • gh CLI authenticated with GitHub
  • Jira MCP server configured (Atlassian Rovo MCP)
  • cloudId: use redhat.atlassian.net

Detailed Implementation Steps

Phase 1: Resolve Input

Parse the argument to determine input type:

  1. PR URL — matches https://github.com/{org}/{repo}/pull/{number}

    • Extract org, repo, and PR number from the URL
    • Run: gh pr view {number} --repo {org}/{repo} --json title,baseRefName,state
    • Extract JIRA key from PR title using regex: first match of [A-Z]+-[0-9]+ (e.g., OCPBUGS-85778)
    • Extract base branch from baseRefName (e.g., release-4.20, main)
  2. PR number — plain integer

    • Determine repo from current git remote: gh repo view --json nameWithOwner -q .nameWithOwner
    • Then same as PR URL flow above
  3. JIRA key — matches [A-Z]+-[0-9]+

    • Require --branch argument (no PR context to infer branch)
    • If --branch not provided, error: "JIRA key input requires --branch (e.g., --branch release-4.20)"

Validate the JIRA key project:

  • Must be a bug project: OCPBUGS, DFBUGS, or PROJQUAY
  • If not, warn: "Project {PROJECT} is not a bug project. The jira-lifecycle-plugin only validates bugs in OCPBUGS, DFBUGS, and PROJQUAY."

Compute expected values from branch:

  • Parse branch name to extract version number
  • Compute expected_target_version, expected_dependent_versions, valid_states, dependent_valid_states, dependents_required using the mapping above

Phase 2: Gather Data

Fetch the primary bug:

Call executeRead with name: "getJiraIssue", cloudId, and the rest in inputs — the primary getJiraIssue tool's schema omits view, so schema-validating clients drop it silently and return no issuelinks:

  • cloudId: redhat.atlassian.net
  • inputs.issueIdOrKey: the JIRA key
  • `in
Полный SKILL.md на GitHub

Установить validate-bug в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл validate-bug?

Diagnose and fix jira/invalid-bug on PRs by running the same 7 checks as the jira-lifecycle-plugin

Как установить скилл validate-bug?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл validate-bug запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить validate-bug с