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★ 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:
gcloud CLI Installation
- Check if installed:
which gcloud - If not installed, provide instructions for the user's platform
- Installation guide: https://cloud.google.com/sdk/docs/install
- Check if installed:
gcloud Authentication (Optional)
- The
test-platform-results-publicbucket is publicly accessible - No authentication is required for read access
- Skip authentication checks
- The
Input Format
The user will provide:
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'sbucketandgcs_base_pathfor artifact reads. Keep the URL bucket as-is, includingprow-artifact-archive. - URL may or may not have trailing slash
- Example:
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 namespaceopenshift-etcd:pod/etcd-0- pod in specific namespaceetcd-0- any resource named etcd-0 (no kind filter)pod/etcd-0,configmap/cluster-config- multiple resourcesresource-name-1|resource-name-2- multiple resources using regex ORe2e-test-project-api-.*- all resources matching the pattern
Implementation Steps
Step 1: Parse and Validate URL
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//'"
- Run
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"
- Search for pattern
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
Construct GCS paths
- Use
parse_url.pyoutput:bucket,bucket_path,gcs_base_path - Keep the URL bucket as-is, including
prow-artifact-archive - Ensure
gcs_base_pathends with/
- Use
Step 2: Parse Resource Specifications
For each comma-delimited resource spec:
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}
- Split on
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
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
- Remove all existing 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
- Use AskUserQuestion tool to ask:
- Check if
Create directory structure
mkdir -
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…