From 197e5fd9084901d06e1779a9679b7c263c5f9d95 Mon Sep 17 00:00:00 2001 From: Patryk Matuszak Date: Mon, 3 Aug 2026 14:12:21 +0200 Subject: [PATCH] CI Doctor: --prepared --prepared means that the artifacts were already prefetch and there is no need to waste tokens on running deterministic commands --- .claude-plugin/marketplace.json | 4 ++-- plugins/lvms-ci/.claude-plugin/plugin.json | 2 +- plugins/lvms-ci/skills/doctor/SKILL.md | 14 +++++++++----- .../microshift-ci/.claude-plugin/plugin.json | 2 +- plugins/microshift-ci/skills/doctor/SKILL.md | 18 +++++++++++++----- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index dcb9175f..c8bf7d0c 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -58,7 +58,7 @@ "name": "lvms-ci", "source": "./plugins/lvms-ci", "description": "LVMS CI Automation", - "version": "1.3.2" + "version": "1.4.0" }, { "name": "mcp-atlassian", @@ -70,7 +70,7 @@ "name": "microshift-ci", "source": "./plugins/microshift-ci", "description": "MicroShift CI Automation", - "version": "1.5.4" + "version": "1.6.0" }, { "name": "microshift-dev", diff --git a/plugins/lvms-ci/.claude-plugin/plugin.json b/plugins/lvms-ci/.claude-plugin/plugin.json index b0a36bb9..23eb869f 100644 --- a/plugins/lvms-ci/.claude-plugin/plugin.json +++ b/plugins/lvms-ci/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "lvms-ci", "description": "LVMS CI Automation", - "version": "1.3.2", + "version": "1.4.0", "author": { "name": "knarra" }, diff --git a/plugins/lvms-ci/skills/doctor/SKILL.md b/plugins/lvms-ci/skills/doctor/SKILL.md index d4548ce5..fb563d7c 100644 --- a/plugins/lvms-ci/skills/doctor/SKILL.md +++ b/plugins/lvms-ci/skills/doctor/SKILL.md @@ -21,6 +21,7 @@ Accepts a comma-separated list of release versions (or `main`), runs analysis fo ## Arguments +- `--prepared` (optional): Artifacts have already been collected by an external script. When set, skip Step 1. Read the prepare summary from `/prepare-summary.json` instead. - `` (required): Comma-separated list of release versions (e.g., `main` or `4.20,4.21,4.22,main`) ## Work Directory @@ -37,20 +38,23 @@ Compute once at the start by running `date +%y%m%d` and substituting into the pa **Goal**: Deterministically collect all failed jobs and download their artifacts before any LLM analysis. -**Actions**: - 1. Determine today's `` by running `date +%y%m%d` and substituting into `/tmp/lvm-operator-ci-claude-workdir.`. Use this value in all subsequent commands. -2. Run the prepare script: + +**If `--prepared` was passed**: the prepare script was already run externally. Read the prepare summary using `Read /prepare-summary.json`. Parse the JSON to get the workdir, release info (job counts, file paths), and PR info. Then skip to Step 2. + +**Otherwise** run the prepare script: + +1. Run: ```text bash plugins/lvms-ci/scripts/doctor.sh prepare --component lvm-operator --workdir --pull-requests ``` -3. The script deterministically: +2. The script deterministically: - For each release: fetches failed periodic jobs, downloads artifacts, writes `/jobs/release--jobs.json` - For PRs: fetches PRs with failures, downloads artifacts, writes `/jobs/prs-jobs.json` and `/jobs/prs-status.json` - Outputs a JSON summary listing all releases, job counts, and file paths -4. Read the JSON output to know which releases have jobs to analyze and how many +3. Read the JSON output to know which releases have jobs to analyze and how many **Job JSON field names** (use these exactly — do NOT guess alternatives like `job_name`): diff --git a/plugins/microshift-ci/.claude-plugin/plugin.json b/plugins/microshift-ci/.claude-plugin/plugin.json index 065ede04..6dc275de 100644 --- a/plugins/microshift-ci/.claude-plugin/plugin.json +++ b/plugins/microshift-ci/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "microshift-ci", "description": "MicroShift CI Automation", - "version": "1.5.4", + "version": "1.6.0", "author": { "name": "ggiguash" }, diff --git a/plugins/microshift-ci/skills/doctor/SKILL.md b/plugins/microshift-ci/skills/doctor/SKILL.md index eb470c80..f28c689b 100644 --- a/plugins/microshift-ci/skills/doctor/SKILL.md +++ b/plugins/microshift-ci/skills/doctor/SKILL.md @@ -20,6 +20,7 @@ Accepts a comma-separated list of MicroShift release versions, runs analysis for ## Arguments +- `--prepared` (optional): Artifacts and graphs have already been collected by an external script. When set, skip Steps 1 and 1b. Read the prepare summary from `/prepare-summary.json` instead. - `` (required): Comma-separated list of release versions (e.g., `4.19,4.20,4.21,4.22`) ## Work Directory @@ -36,20 +37,23 @@ Compute once at the start by running `date +%y%m%d` and substituting into the pa **Goal**: Deterministically collect all failed jobs and download their artifacts before any LLM analysis. -**Actions**: - 1. Determine today's `` by running `date +%y%m%d` and substituting into `/tmp/microshift-ci-claude-workdir.`. Use this value in all subsequent commands. -2. Run the prepare script: + +**If `--prepared` was passed**: the prepare script was already run externally. Read the prepare summary using `Read /prepare-summary.json`. Parse the JSON to get the workdir, release info (job counts, file paths), PR info, and source checkout paths. Then skip to Step 2. + +**Otherwise** run the prepare script: + +1. Run: ```text bash plugins/microshift-ci/scripts/doctor.sh prepare --component microshift --workdir --pull-requests --repo openshift/microshift ``` -3. The script deterministically: +2. The script deterministically: - For each release: fetches failed periodic jobs, downloads artifacts, writes `/jobs/release--jobs.json` - For rebase PRs: fetches PRs with failures, downloads artifacts, writes `/jobs/prs-jobs.json` and `/jobs/prs-status.json` - Outputs a JSON summary listing all releases, job counts, and file paths -4. Read the JSON output to know which releases have jobs to analyze and how many +3. Read the JSON output to know which releases have jobs to analyze and how many **Job JSON field names** (use these exactly — do NOT guess alternatives like `job_name`): @@ -68,6 +72,10 @@ Compute once at the start by running `date +%y%m%d` and substituting into the pa ### Step 1b: Generate PCP Performance Graphs +**If `--prepared` was passed**: skip this step entirely (graphs were already generated externally). Proceed to Step 2. + +**Otherwise**: + **Goal**: Generate performance graphs from PCP archives for all jobs that have pmlogs. **Actions**: