Skip to content

USHIFT-7335: Trim prow-job-analyzer prose and make it less prescriptive#239

Draft
pmtk wants to merge 3 commits into
openshift-eng:mainfrom
pmtk:trim-prose-less-prescriptive
Draft

USHIFT-7335: Trim prow-job-analyzer prose and make it less prescriptive#239
pmtk wants to merge 3 commits into
openshift-eng:mainfrom
pmtk:trim-prose-less-prescriptive

Conversation

@pmtk

@pmtk pmtk commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Documentation
    • Improved guidance for producing consistent, schema-compliant CI root-cause analysis reports, including stricter JSON output formatting and clearer investigation principles and evidence correlation.
    • Clarified expected field formats and rules for root cause, confidence, analysis gaps, scenarios, and multiple independent failures.
    • Documented where Prow job output and infrastructure/hypervisor errors are captured within CI artifacts, and updated evidence pointers.
    • Refined component timeline guidance to improve fault attribution accuracy.
  • Chores
    • Bumped the MicroShift CI plugin version (manifest and marketplace metadata) to 1.4.4.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pmtk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 695f6632-8ddd-45a9-8c54-06bc82319eae

📥 Commits

Reviewing files that changed from the base of the PR and between a075e82 and e719d23.

📒 Files selected for processing (4)
  • .claude-plugin/marketplace.json
  • plugins/microshift-ci/.claude-plugin/plugin.json
  • plugins/microshift-ci/agents/prow-job-analyzer.md
  • plugins/microshift-ci/agents/references/microshift-ci-primer.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • plugins/microshift-ci/agents/references/microshift-ci-primer.md
  • plugins/microshift-ci/agents/prow-job-analyzer.md

Walkthrough

The Prow job analyzer prompt now has stricter JSON output, investigation, schema, and root-cause classification guidance. The MicroShift CI primer adds build-log evidence details and revises sosreport and component timeline documentation. Plugin metadata versions are updated to 1.4.4.

Changes

MicroShift CI guidance

Layer / File(s) Summary
Analysis workflow and JSON contract
plugins/microshift-ci/agents/prow-job-analyzer.md
Investigation principles, source correlation, JSON-only output, and field formatting requirements are reorganized and tightened.
Analysis classification rubric
plugins/microshift-ci/agents/prow-job-analyzer.md
Raw error, root cause, confidence, and multiple-failure rules are condensed and clarified.
Artifact evidence and plugin release metadata
plugins/microshift-ci/agents/references/microshift-ci-primer.md, .claude-plugin/marketplace.json, plugins/microshift-ci/.claude-plugin/plugin.json
Documents Prow output in build-log.txt, removes the SKIP_SOS note, revises component timeline wording, and updates plugin versions to 1.4.4.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ai-Attribution ⚠️ Warning PR commits use Co-Authored-By: Claude Opus 4.6 and no Assisted-by/Generated-by Red Hat trailer is present. Replace the AI Co-Authored-By trailers with the required Red Hat Assisted-by or Generated-by trailer(s) on each AI-assisted commit.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: trimming and loosening the prow-job-analyzer guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Weak-Crypto ✅ Passed PASS: Only markdown/JSON version updates changed; targeted diff scan found no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto/comparison code.
Container-Privileges ✅ Passed PR changes are docs/version metadata only; no manifests or privileged settings (privileged, hostPID/Network/IPC, allowPrivilegeEscalation, SYS_ADMIN) appear in the diff.
No-Sensitive-Data-In-Logs ✅ Passed The diff only bumps plugin versions; no logging code or new sensitive data appears in the changed files.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets or credential-like literals were found in the touched files; the only regex hit was a path fragment, not a secret.
No-Injection-Vectors ✅ Passed PASS: The PR only changes markdown prompts and plugin version JSONs; no executable code or dangerous APIs matching the injection-vector list were added.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch trim-prose-less-prescriptive

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 markdownlint-cli2 (0.23.0)
plugins/microshift-ci/agents/prow-job-analyzer.md

markdownlint-cli2 v0.23.0 (markdownlint v0.41.0)
Finding: :plugins/microshift-ci/agents/prow-job-analyzer.md :plugins/microshift-ci/agents/references/microshift-ci-primer.md !node_modules/** !two-node-toolbox/**
Linting: 2 file(s)
Summary: 0 error(s)
AggregateError: Unable to import module 'markdownlint-cli2-formatter-pretty'.
at importModule (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:92:11)
at async Promise.all (index 0)
at async outputResults (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:879:9)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:1072:5)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
[errors]: [
Error: Cannot find module 'markdownlint-cli2-formatter-pretty'
Require stack:
- /usr/local/lib/node_modules/markdownlint-cli2/node_modules/markdownlint/lib/resolve-module.cjs
at Module._r

... [truncated 1163 characters] ...

node:internal/modules/esm/resolve:271:11)
at moduleResolve (node:internal/modules/esm/resolve:861:10)
at defaultResolve (node:internal/modules/esm/resolve:988:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:697:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:714:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:746:52)
at #resolve (node:internal/modules/esm/loader:679:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:599:35)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///markdownlint-cli2-formatter-pretty'
}
]
}

plugins/microshift-ci/agents/references/microshift-ci-primer.md

markdownlint-cli2 v0.23.0 (markdownlint v0.41.0)
Finding: :plugins/microshift-ci/agents/prow-job-analyzer.md :plugins/microshift-ci/agents/references/microshift-ci-primer.md !node_modules/** !two-node-toolbox/**
Linting: 2 file(s)
Summary: 0 error(s)
AggregateError: Unable to import module 'markdownlint-cli2-formatter-pretty'.
at importModule (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:92:11)
at async Promise.all (index 0)
at async outputResults (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:879:9)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:1072:5)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
[errors]: [
Error: Cannot find module 'markdownlint-cli2-formatter-pretty'
Require stack:
- /usr/local/lib/node_modules/markdownlint-cli2/node_modules/markdownlint/lib/resolve-module.cjs
at Module._r

... [truncated 1163 characters] ...

node:internal/modules/esm/resolve:271:11)
at moduleResolve (node:internal/modules/esm/resolve:861:10)
at defaultResolve (node:internal/modules/esm/resolve:988:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:697:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:714:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:746:52)
at #resolve (node:internal/modules/esm/loader:679:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:599:35)
at node:internal/modules/esm/loader:628:32
at TracingChannel.tracePromise (node:diagnostics_channel:362:14) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///markdownlint-cli2-formatter-pretty'
}
]
}


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
plugins/microshift-ci/agents/prow-job-analyzer.md (1)

25-147: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Run the repository markdownlint flow before committing.

Per CONTRIBUTING.md and the Markdown coding guidelines, lint the Markdown files with the repo’s configured markdownlint-cli2 invocation (scripts/lint-markdown.sh or the configured .markdownlint-cli2.jsonc command), not only npx markdownlint-cli2 '**/*.md' in this environment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/microshift-ci/agents/prow-job-analyzer.md` around lines 25 - 147, Run
the repository-configured Markdown lint flow for the updated agents
documentation before committing, using scripts/lint-markdown.sh or the command
specified by .markdownlint-cli2.jsonc rather than a standalone npx
markdownlint-cli2 invocation.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/microshift-ci/agents/prow-job-analyzer.md`:
- Line 57: Update the validator in validate-rca-output.py to enforce the
documented output contract: reject entries containing keys outside the specified
fields, and require both analysis_gaps and scenarios to be arrays rather than
null. Keep validation of all existing required fields unchanged.
- Line 37: Update the sosreport workflow guidance near the journal-first
instructions so extraction is not limited to journal-detected crashes or
restarts. Require extracting the relevant sosreport whenever pod/container
evidence is needed, including product-versus-test diagnosis or inspecting
previous.log after multiple container creations, while retaining journal files
as the initial source and preferring the on-failure report matched by timestamp.

In `@plugins/microshift-ci/agents/references/microshift-ci-primer.md`:
- Around line 148-149: Correct the artifact-path documentation around the
artifact table in the microshift-ci primer: clarify that
<ARTIFACTS_DIR>/build-log.txt is located at the artifact root, while
<STEP>/build-log.txt remains under the scenario-info/<scenario>/ step paths.
Update the surrounding scope statement so it does not incorrectly apply the
scenario directory prefix to the root-level entry.

---

Outside diff comments:
In `@plugins/microshift-ci/agents/prow-job-analyzer.md`:
- Around line 25-147: Run the repository-configured Markdown lint flow for the
updated agents documentation before committing, using scripts/lint-markdown.sh
or the command specified by .markdownlint-cli2.jsonc rather than a standalone
npx markdownlint-cli2 invocation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 63f13b8f-5518-4a27-b927-3ba7661e4d24

📥 Commits

Reviewing files that changed from the base of the PR and between b529abe and a075e82.

📒 Files selected for processing (2)
  • plugins/microshift-ci/agents/prow-job-analyzer.md
  • plugins/microshift-ci/agents/references/microshift-ci-primer.md

Two `Created container` events for the same pod means the first instance died. Read `previous.log` for the exit reason before concluding a single-startup narrative.

## Glossary
Journal files (`journal_*.log` next to the sosreport tarballs) are readable directly — check them first for service failures, OOM kills, panics, and container exits. Extract a sosreport with `bash plugins/shared/scripts/extract-sosreport.sh <tarball>` only when the journal shows crashes or restarts — pod and container logs (especially `previous.log`) exist exclusively inside the tarball. Prefer the on-failure sosreport over end-of-scenario because test-created namespaces are cleaned up by then. Match sosreport to failure by timestamp.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not restrict sosreport extraction to journal-detected crashes.

Line 33 requires pod logs to distinguish product failures from test timing issues, and line 35 specifically requires previous.log after detecting multiple container creations. Those signals may appear in build or pod artifacts without an explicit journal crash/restart entry, so this restriction can stop the investigation before the required evidence is read.

-Extract a sosreport ... only when the journal shows crashes or restarts
+Extract a sosreport when the investigation requires pod/container logs,
+including crashes, restarts, readiness flaps, or repeated container creation
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Journal files (`journal_*.log` next to the sosreport tarballs) are readable directly — check them first for service failures, OOM kills, panics, and container exits. Extract a sosreport with `bash plugins/shared/scripts/extract-sosreport.sh <tarball>` only when the journal shows crashes or restarts — pod and container logs (especially `previous.log`) exist exclusively inside the tarball. Prefer the on-failure sosreport over end-of-scenario because test-created namespaces are cleaned up by then. Match sosreport to failure by timestamp.
Journal files (`journal_*.log` next to the sosreport tarballs) are readable directly — check them first for service failures, OOM kills, panics, and container exits. Extract a sosreport when the investigation requires pod/container logs, including crashes, restarts, readiness flaps, or repeated container creation — pod and container logs (especially `previous.log`) exist exclusively inside the tarball. Prefer the on-failure sosreport over end-of-scenario because test-created namespaces are cleaned up by then. Match sosreport to failure by timestamp.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@plugins/microshift-ci/agents/prow-job-analyzer.md` at line 37, Update the
sosreport workflow guidance near the journal-first instructions so extraction is
not limited to journal-detected crashes or restarts. Require extracting the
relevant sosreport whenever pod/container evidence is needed, including
product-versus-test diagnosis or inspecting previous.log after multiple
container creations, while retaining journal files as the initial source and
preferring the on-failure report matched by timestamp.

Comment thread plugins/microshift-ci/agents/prow-job-analyzer.md
Comment thread plugins/microshift-ci/agents/references/microshift-ci-primer.md
pmtk and others added 3 commits July 24, 2026 09:32
Restructure the agent definition from ~275 to ~148 lines (46% reduction).
Research shows instruction compliance decays exponentially with count and
~65% of typical prompt instructions are redundant — specifying them
consumes instruction-following capacity and reduces output predictability.

Key changes:
- Replace 4-step prescriptive workflow with 7 investigation principles
- Remove Glossary, Important Files, Important Links, Tips sections
- Eliminate content duplicated with the primer reference file
  (SOS Report section, journal patterns, container restart detection)
- Consolidate sosreport extraction from 3 mentions to 1
- Reduce RAW_ERROR examples from 5 to 3
- Cut ROOT_CAUSE "How it differs" prose (contrastive table teaches this)
- Replace aggressive emphasis (MUST/NEVER/CRITICAL) with calm directives

All 16 JSON output fields retained — schema, example, severity rubric,
and downstream-critical rules (RAW_ERROR determinism, ROOT_CAUSE
consistency, CONFIDENCE calibration) are preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Absorb Important Files entries (build-log.txt, step diagram URL)
  from the analyzer into the primer's evidence table — this is the
  reference file, so file-location info belongs here
- Remove SKIP_SOS paragraph (development-only detail, irrelevant to
  CI artifact analysis)
- Rephrase behavioral instruction in journal section to factual
  reference ("supports fault attribution" vs "reconstruct before
  attributing") — behavioral guidance belongs in the agent definition,
  not the reference file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pmtk
pmtk force-pushed the trim-prose-less-prescriptive branch from a075e82 to e719d23 Compare July 24, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant