Skip to content
MCP ThesaurusMCP Thesaurus

Lvms Ci:prow Job

CommunityGood65/100Claim

updated 7d ago

Analyzes a single Prow CI test job by downloading artifacts and running a root cause analysis agent. Accepts either a Prow job URL (downloads artifacts) or a local directory path (uses pre-downloaded artifacts). The analysis produces a structured JSON report that is formatted as human-readable prose for the user.

SourceWebsiteDocs7

What can you do with Lvms Ci:prow Job?


name: lvms-ci:prow-job argument-hint: description: Download Prow job artifacts, identify root cause of failure, and produce a structured error report user-invocable: true allowed-tools: Bash, Read, Write, Agent

lvms-ci:prow-job

Synopsis

/lvms-ci:prow-job <prow-job-url>
/lvms-ci:prow-job <artifacts-dir>

Description

Analyzes a single Prow CI test job by downloading artifacts and running a root cause analysis agent. Accepts either a Prow job URL (downloads artifacts) or a local directory path (uses pre-downloaded artifacts). The analysis produces a structured JSON report that is formatted as human-readable prose for the user.

Arguments

  • <ARGUMENTS> (required): Either a job URL or a local artifacts directory path:
    • Prow URL: https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-openshift-lvm-operator-main-e2e-aws-sno-qe-integration-tests/1984108354347208704
    • GCS web URL: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/logs/periodic-ci-openshift-lvm-operator-main-e2e-aws-sno-qe-integration-tests/1984108354347208704
    • Local artifacts directory: /tmp/lvm-operator-ci-claude-workdir.260404/artifacts/1984108354347208704 (must contain build-log.txt and finished.json)

Job Name and Job ID

The Job Name and Job ID are encoded in the URL. There are two URL formats depending on the job type:

Periodic/postsubmit jobs:

https://prow.ci.openshift.org/view/gs/test-platform-results/logs/{JOB_NAME}/{JOB_ID}
https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/logs/{JOB_NAME}/{JOB_ID}

GCS path: gs://test-platform-results/logs/{JOB_NAME}/{JOB_ID}/

Presubmit (PR) jobs:

https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_lvm-operator/{PR_NUMBER}/{JOB_NAME}/{JOB_ID}
https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_lvm-operator/{PR_NUMBER}/{JOB_NAME}/{JOB_ID}

GCS path: gs://test-platform-results/pr-logs/pull/openshift_lvm-operator/{PR_NUMBER}/{JOB_NAME}/{JOB_ID}/

To determine the GCS path from any job URL, strip the web prefix and replace with gs://:

  • Prow URL: strip https://prow.ci.openshift.org/view/gs/
  • GCS web URL: strip https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/

Work Directory

Compute once at the start by running date +%y%m%d and substituting into the path below. In all commands, replace <WORKDIR> with the computed path — do not store the work directory in a shell variable.

/tmp/lvm-operator-ci-claude-workdir.<YYMMDD>

Prerequisites

  • gsutil CLI must be installed for GCS access (uses anonymous access on public buckets; only needed for URL input — pre-downloaded artifacts skip it)
  • Internet access to fetch job data from Prow/GCS
  • Bash shell

Workflow

The user argument is: <ARGUMENTS>

  1. Determine input type and set up artifacts directory:

    • If <ARGUMENTS> is a local directory path (starts with / and contains build-log.txt): set TMP to that directory. Skip step 1. Derive JOB_URL from the build-log.txt "Link to job on registry info site" line, and extract JOB_NAME from the URL path (the path segment before the numeric job ID).
    • If <ARGUMENTS> is a URL (starts with http): set JOB_URL to <ARGUMENTS>. Extract JOB_NAME from the URL path (the path segment before the numeric job ID — e.g. periodic-ci-openshift-lvm-operator-main-e2e-aws-sno-qe-integration-tests from the URL). Create a temporary working directory with mktemp -d <WORKDIR>/openshift-ci-analysis-XXXX, set TMP to that directory, and proceed to step 1.
  2. Download all artifacts (skip if using pre-downloaded artifacts from step 0): Download all prow job artifacts using gsutil -q -m cp -r into the temporary working directory. Derive the GCS path by stripping the web prefix from the job URL (handles both Prow and GCS web URL formats):

    GCS_PATH=$(echo "${JOB_URL}" | sed -e 's|https://prow.ci.openshift.org/view/gs/|gs://|' -e 's|https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/|gs://|')
    gsutil -q -m cp -r "${GCS_PATH}/" ${TMP}/
    

    This works for both periodic (logs/...) and presubmit PR (pr-logs/pull/...) job URLs, and for both Prow and GCS web URL formats. This makes all build logs, step logs, and SOS reports available locally for analysis.

  3. Run root cause analysis: Spawn a single Agent with subagent_type=lvms-ci:prow-job-analyzer to analyze the artifacts. Build the prompt with:

    • artifacts_dir: the TMP path from step 0/1
    • job_url: the JOB_URL from step 0
    • job_name: the JOB_NAME from step 0

    Example prompt:

    Analyze this prow job:
    artifacts_dir: /tmp/lvm-operator-ci-claude-workdir.260710/artifacts/2075422415638237184
    job_url: https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-openshift-lvm-operator-main-e2e-aws-sno-qe-integration-tests/2075422415638237184
    job_name: periodic-ci-openshift-lvm-operator-main-e2e-aws-sno-qe-integration-tests
    
  4. Display results: Parse the JSON array returned by the agent. For each entry, format the output as:

    Error Severity: {severity}/5
    Stack Layer: {stack_layer}
    Step Name: {step_name}
    Error: {raw_error}
    Causal Chain:
      (for each link in causal_chain, numbered starting at 1)
      N. {link.cause}
         Evidence: {link.evidence} — "{link.quote}"
    Confidence: {confidence}
    Suggested Remediation: {remediation}
    

    If TMP is inside a <WORKDIR> structure, also save the raw JSON to: <WORKDIR>/jobs/release-<RELEASE>-job-<JOB_ID>.json (derive RELEASE and JOB_ID from the artifacts path and the JSON content).