Command Palette

Search for a command to run...

Назад к скиллам
скилл № 82581

prow-job-analyze-resource

Analyze Kubernetes resource lifecycle in Prow CI job artifacts by parsing audit logs and pod logs from GCS, generating interactive HTML reports with timelines

БесплатноЗапускает вложенные скрипты
openshift-engот openshift-eng★ 123 звезды на GitHub

Установить prow-job-analyze-resource в Claude Code и Claude Desktop

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

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

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

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

Prow Job Analyze Resource

This skill analyzes the lifecycle of Kubernetes resources during Prow CI job execution by downloading and parsing artifacts from Google Cloud Storage.

When to Use This Skill

Use this skill when the user wants to:

  • Debug Prow CI test failures by tracking resource state changes
  • Understand when and how a Kubernetes resource was created, modified, or deleted during a test
  • Analyze resource lifecycle across audit logs and pod logs from ephemeral test clusters
  • Generate interactive HTML reports showing resource events over time
  • Search for specific resources (pods, deployments, configmaps, etc.) in Prow job artifacts

Prerequisites

Read SCRIPTS.md for the bundled helper inventory and standalone usage examples.

Before starting, verify these prerequisites:

  1. gcloud CLI Installation

  2. gcloud Authentication (Optional)

    • The test-platform-results-public bucket is publicly accessible
    • No authentication is required for read access
    • Skip authentication checks

Input Format

The user will provide:

  1. Prow job URL - Prow UI (/view/gs/<bucket>/) or gcsweb (/gcs/<bucket>/)

    • Example: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results-public/pr-logs/pull/30393/pull-ci-openshift-origin-main-okd-scos-e2e-aws-ovn/1978913325970362368/
    • <bucket> is any non-empty segment after /gs/ or /gcs/
    • Use parse_url.py's bucket and gcs_base_path for artifact reads. Keep the URL bucket as-is, including prow-artifact-archive.
    • URL may or may not have trailing slash
  2. Resource specifications - Comma-delimited list in format [namespace:][kind/]name

    • Supports regex patterns for matching multiple resources
    • Examples:
      • pod/etcd-0 - pod named etcd-0 in any namespace
      • openshift-etcd:pod/etcd-0 - pod in specific namespace
      • etcd-0 - any resource named etcd-0 (no kind filter)
      • pod/etcd-0,configmap/cluster-config - multiple resources
      • resource-name-1|resource-name-2 - multiple resources using regex OR
      • e2e-test-project-api-.* - all resources matching the pattern

Implementation Steps

Step 1: Parse and Validate URL

  1. Extract bucket path

    • Run parse_url.py (or find /gs/<bucket>/ or /gcs/<bucket>/ in the URL)
    • Extract everything after the bucket name as the object path
    • If not found, error: "URL must contain '/gs//' or '/gcs//'"
  2. Extract build_id

    • Search for pattern /(\d{10,})/ in the bucket path
    • build_id must be at least 10 consecutive decimal digits
    • Handle URLs with or without trailing slash
    • If not found, error: "Could not find build ID (10+ digits) in URL"
  3. Extract prowjob name

    • Find the path segment immediately preceding build_id
    • Example: In .../pull-ci-openshift-origin-main-okd-scos-e2e-aws-ovn/1978913325970362368/
    • Prowjob name: pull-ci-openshift-origin-main-okd-scos-e2e-aws-ovn
  4. Construct GCS paths

    • Use parse_url.py output: bucket, bucket_path, gcs_base_path
    • Keep the URL bucket as-is, including prow-artifact-archive
    • Ensure gcs_base_path ends with /

Step 2: Parse Resource Specifications

For each comma-delimited resource spec:

  1. Parse format [namespace:][kind/]name

    • Split on : to get namespace (optional)
    • Split remaining on / to get kind (optional) and name (required)
    • Store as structured data: {namespace, kind, name}
  2. Validate

    • name is required
    • namespace and kind are optional
    • Examples:
      • pod/etcd-0 → {kind: "pod", name: "etcd-0"}
      • openshift-etcd:pod/etcd-0 → {namespace: "openshift-etcd", kind: "pod", name: "etcd-0"}
      • etcd-0 → {name: "etcd-0"}

Step 3: Create Working Directory

  1. Check for existing artifacts first

    • Check if .work/prow-job-analyze-resource/{build_id}/logs/ directory exists and has content
    • If it exists with content:
      • Use AskUserQuestion tool to ask:
        • Question: "Artifacts already exist for build {build_id}. Would you like to use the existing download or re-download?"
        • Options:
          • "Use existing" - Skip to artifact parsing step (Step 6)
          • "Re-download" - Continue to clean and re-download
      • If user chooses "Re-download":
        • Remove all existing content: rm -rf .work/prow-job-analyze-resource/{build_id}/logs/
        • Also remove tmp directory: rm -rf .work/prow-job-analyze-resource/{build_id}/tmp/
        • This ensures clean state before downloading new content
      • If user chooses "Use existing":
        • Skip directly to Step 6 (Parse Audit Logs)
        • Still need to download prowjob.json if it doesn't exist
  2. Create directory structure

    mkdir -
    
Полный SKILL.md на GitHub

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

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

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

Вложенные файлы

  • CHANGELOG.md
  • README.md
  • SCRIPTS.md
  • create_context_html_files.py
  • create_inline_html_files.py
  • generate_html_report.py
  • generate_report.py
  • parse_all_logs.py
  • parse_audit_logs.py
  • parse_pod_logs.py
  • parse_url.py
  • prow_job_resource_grep.sh
  • report_template.html
  • test_parse_url.py

FAQ

Что делает скилл prow-job-analyze-resource?

Analyze Kubernetes resource lifecycle in Prow CI job artifacts by parsing audit logs and pod logs from GCS, generating interactive HTML reports with timelines

Как установить скилл prow-job-analyze-resource?

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

Скилл prow-job-analyze-resource запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить prow-job-analyze-resource с