Skip to content

oadp-analyze-e2e-failure: give Claude explicit source-clone instructions - #84048

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
kaovilai:oadp-analyze-e2e-failure-context-enhancements
Aug 26, 2026
Merged

oadp-analyze-e2e-failure: give Claude explicit source-clone instructions#84048
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
kaovilai:oadp-analyze-e2e-failure-context-enhancements

Conversation

@kaovilai

@kaovilai kaovilai commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #83957 (as promised there).

oadp-analyze-e2e-failure runs on the generic claude-ai-helpers image, not oadp-operator's own build_root — so unlike the in-repo Claude CLI approach it replaced (which ran inside the same container as the test, with the full repo checked out via COPY ./ .), the new post-step's pod has no oadp-operator source on disk at all. It only had GCS test artifacts (JUnit, must-gather, pod logs) plus a hardcoded system-prompt description of OADP concepts.

Two concrete pieces of context were being lost as a result:

  • tests/e2e/lib/flakes.go's known-flake patterns (referenced by path in the prompt, but with no way for Claude to actually read it).
  • Velero's own source (OADP is a thin wrapper around Velero; most real backup/restore root causes live in Velero's controller code, not OADP's wrapper — the old in-repo image actually baked in a git clone of openshift/velero@oadp-dev specifically for this reason, see build/ci-Dockerfile#L36-L53).

Fix

  • claude-ai-helpers (openshift-eng/ai-helpers) is built on the standard OCP golang builder base (ships git) plus an explicit gh CLI install — it's fully capable of cloning source on demand, it just wasn't being told to.
  • Added an OADP_BRANCH env to the step (default oadp-dev, overridden per config file to match that file's own zz_generated_metadata.branch).
  • Updated the system prompt to explicitly instruct Claude to git clone --depth 1 --branch ${OADP_BRANCH} both openshift/oadp-operator and openshift/velero if artifact evidence alone isn't enough — rather than leaving it to infer the right repo/branch/URL on its own. Branch names are mirrored 1:1 between the two repos, confirmed via oadp-rebasebot/oadp-rebase's repos.yaml — the canonical source of truth for OADP ecosystem repo/branch mappings (used here purely as a reference for the branch-naming convention, no dependency added).

Testing

  • make update ran clean (ci-operator-checkconfig passed as part of it).
  • shellcheck clean on the updated oadp-analyze-e2e-failure-commands.sh.

Note

Responses generated with Claude

Summary by CodeRabbit

  • Configures OADP_BRANCH for OADP Operator AWS E2E jobs across supported release branches.
  • Updates oadp-analyze-e2e-failure to clone matching OADP Operator, Velero, cloud-provider, and other OADP ecosystem repositories when artifacts are insufficient.
  • Uses oadp-rebasebot/oadp-rebase repository mappings to select source repositories and branches.
  • Improves Claude-based analysis of known flakes and controller or plugin failures.

Follow-up to openshift#83957. The post-step runs on the generic claude-ai-helpers
image, not oadp-operator's own build_root, so unlike the in-repo
approach it replaced, the repo source isn't pre-checked-out on disk.

Add an OADP_BRANCH env (set per config file, matching
zz_generated_metadata.branch) and tell Claude explicitly, in the system
prompt, to `git clone` both openshift/oadp-operator and openshift/velero
at that branch if artifact-based evidence alone isn't enough -- rather
than leaving it to infer the right repo/branch/URL on its own. Branch
names are mirrored 1:1 between oadp-operator and velero, confirmed via
https://github.com/oadp-rebasebot/oadp-rebase/blob/oadp-dev/repos.yaml
(the canonical source of truth for OADP ecosystem repo/branch mappings).

The claude-ai-helpers image (openshift-eng/ai-helpers) is built on the
standard OCP golang builder base (has git) plus an explicit `gh` CLI
install, so it's fully capable of this -- it just wasn't being told to.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai

Copy link
Copy Markdown
Member Author

/pj-rehearse

Note

Responses generated with Claude

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@kaovilai: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@coderabbitai

coderabbitai Bot commented Aug 25, 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: Enterprise

Run ID: 40d22248-c97d-4090-bcab-4e8b115bd3b9

📥 Commits

Reviewing files that changed from the base of the PR and between cc71f8f and 4657573.

📒 Files selected for processing (1)
  • ci-operator/step-registry/oadp/analyze-e2e-failure/oadp-analyze-e2e-failure-commands.sh

Included review availability: Your plan provides up to 12 included reviews per hour; 8 remain after this review.


Walkthrough

OADP AWS E2E job configurations now set OADP_BRANCH for supported release and development branches. The failure analyzer accepts this variable and uses matching OADP, Velero, and mapped component repository branches.

Changes

OADP branch-aware E2E testing

Layer / File(s) Summary
AWS E2E branch assignments
ci-operator/config/openshift/oadp-operator/*
AWS CLI, standard, KubeVirt, HCP, and periodic E2E jobs now define matching OADP_BRANCH values for OADP 1.4, 1.5, 1.6, and development configurations.
Failure analyzer branch context
ci-operator/step-registry/oadp/analyze-e2e-failure/*
The analyzer reference adds OADP_BRANCH with an oadp-dev default. The analysis prompt uses the branch context and mapped component repositories, with a main fallback for clone failures.

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

Merge Risk: ⚪ Minimal · up to 46575

This change gives failure analysis access to the relevant OADP and Velero source branches without altering product runtime behavior; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: joeavaikath, sg-rh

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding explicit source-cloning instructions for Claude in the e2e failure analysis step.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Stable And Deterministic Test Names ✅ Passed PASS: The pull-request diff adds only static OADP_BRANCH CI environment values and source-clone guidance. It does not add or modify any Ginkgo It, Describe, Context, or When test title. The …
Test Structure And Quality ✅ Passed PASS: The pull request does not add or modify Ginkgo test code. The diff contains only YAML environment entries and changes to the analysis shell step and its reference YAML. The diff contains no Gink…
Microshift Test Compatibility ✅ Passed PASS: The pull request adds no Ginkgo test declarations and no Go files. The diff only adds OADP_BRANCH environment entries and source-cloning guidance to CI configuration and a shell post-step. There…
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS — The pull request adds no new Ginkgo e2e tests. The diff contains only CI YAML environment entries, the failure-analysis shell script, and its reference YAML; it adds no Go/test-source paths or …
Topology-Aware Scheduling Compatibility ✅ Passed PASS — The pull request changes only CI configuration environment variables, the failure-analysis shell prompt, and its step reference. The diff adds OADP_BRANCH values and source-clone guidance. It d…
Ote Binary Stdout Contract ✅ Passed PASS: The complete PR diff contains only YAML configuration and one shell post-step change. It contains no Go or OTE binary source changes, and no added OTE stdout APIs or suite setup. The YAML additi…
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The PR adds no new Ginkgo tests. The diff contains only CI YAML environment entries, step metadata, and source-clone guidance in the failure-analysis shell prompt. The added GitHub clone instruc…
No-Weak-Crypto ✅ Passed PASS: The pull-request diff adds OADP_BRANCH YAML values and source-cloning guidance only. The changed lines introduce no MD5, SHA-1, DES, 3DES, RC4, Blowfish, ECB, custom cryptography, or secret/toke…
Container-Privileges ✅ Passed No container-privilege finding was introduced. The diff adds only OADP_BRANCH environment entries, prompt text, and documentation. The changed step manifest has no privileged, hostPID, hostNetwork, ho…
No-Sensitive-Data-In-Logs ✅ Passed PASS. The PR adds branch values and source-clone guidance for public GitHub repositories. It does not add logging of passwords, tokens, API keys, PII, or customer data. The Claude output redirection a…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Stable And Deterministic Test Names

Explanation

PASS: The pull-request diff adds only static OADP_BRANCH CI environment values and source-clone guidance. It does not add or modify any Ginkgo It, Describe, Context, or When test title. The existing TEST_NAME values are unchanged and are static CI metadata.

Full details: Test Structure And Quality

Explanation

PASS: The pull request does not add or modify Ginkgo test code. The diff contains only YAML environment entries and changes to the analysis shell step and its reference YAML. The diff contains no Ginkgo constructs such as It, BeforeEach, AfterEach, Eventually, or Consistently, so the listed test-structure requirements are not applicable.

Full details: Microshift Test Compatibility

Explanation

PASS: The pull request adds no Ginkgo test declarations and no Go files. The diff only adds OADP_BRANCH environment entries and source-cloning guidance to CI configuration and a shell post-step. Therefore, the MicroShift Test Compatibility check is not applicable.

Full details: Single Node Openshift (Sno) Test Compatibility

Explanation

PASS — The pull request adds no new Ginkgo e2e tests. The diff contains only CI YAML environment entries, the failure-analysis shell script, and its reference YAML; it adds no Go/test-source paths or Ginkgo declarations such as It(), Describe(), Context(), or When(). Therefore the SNO compatibility conditions do not apply.

Full details: Topology-Aware Scheduling Compatibility

Explanation

PASS — The pull request changes only CI configuration environment variables, the failure-analysis shell prompt, and its step reference. The diff adds OADP_BRANCH values and source-clone guidance. It does not add or modify deployment manifests, operator code, controllers, replica settings, affinity, topology spread, node selectors, tolerations, or PDBs. The topology-aware scheduling check is therefore not applicable.

Full details: Ote Binary Stdout Contract

Explanation

PASS: The complete PR diff contains only YAML configuration and one shell post-step change. It contains no Go or OTE binary source changes, and no added OTE stdout APIs or suite setup. The YAML additions only set OADP_BRANCH; the shell addition extends the Claude system prompt. The shell step is not an OTE binary communicating with openshift-tests via JSON stdout.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

PASS: The PR adds no new Ginkgo tests. The diff contains only CI YAML environment entries, step metadata, and source-clone guidance in the failure-analysis shell prompt. The added GitHub clone instructions are not test implementation, so the custom check does not apply.

Full details: No-Weak-Crypto

Explanation

PASS: The pull-request diff adds OADP_BRANCH YAML values and source-cloning guidance only. The changed lines introduce no MD5, SHA-1, DES, 3DES, RC4, Blowfish, ECB, custom cryptography, or secret/token comparisons. Existing secret-redaction regexes are unchanged.

Full details: Container-Privileges

Explanation

No container-privilege finding was introduced. The diff adds only OADP_BRANCH environment entries, prompt text, and documentation. The changed step manifest has no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, or securityContext setting. It continues to reference the existing claude-ai-helpers image without changing its runtime user or privileges.

Full details: No-Sensitive-Data-In-Logs

Explanation

PASS. The PR adds branch values and source-clone guidance for public GitHub repositories. It does not add logging of passwords, tokens, API keys, PII, or customer data. The Claude output redirection and redaction logic are unchanged from the base revision. Added OADP_BRANCH values are non-sensitive branch names.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from Joeavaikath and sg-rh August 25, 2026 20:43
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2026
The prior commit only named openshift/oadp-operator and openshift/velero
explicitly. Root causes can equally live in a cloud-provider plugin or
other OADP ecosystem component (velero-plugin-for-aws, kubevirt-velero-plugin,
hypershift-oadp-plugin, etc.) that the prompt gave no guidance for at all.

Point Claude at oadp-rebasebot/oadp-rebase's repos.yaml -- the canonical
org/repo/branch mapping for the whole OADP ecosystem -- instead of trying
to enumerate every repo/branch exception (dev_branch overrides, etc.)
inline in the prompt.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai

Copy link
Copy Markdown
Member Author

/pj-rehearse

Note

Responses generated with Claude

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@kaovilai: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@kaovilai: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-oadp-operator-oadp-dev-4.23-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.23-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.23-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.23-e2e-test-hcp-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.23-e2e-test-kubevirt-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.22-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.22-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.22-e2e-test-hcp-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.22-e2e-test-kubevirt-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-4.22-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-4.22-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.4-4.18-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.4-4.18-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-5.1-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-5.1-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.5-4.20-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.5-4.20-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.5-4.20-e2e-test-hcp-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.5-4.20-e2e-test-kubevirt-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-5.0-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-5.0-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-dev-5.0-e2e-test-kubevirt-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-5.0-e2e-test-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-5.0-e2e-test-cli-aws openshift/oadp-operator presubmit Ci-operator config changed
pull-ci-openshift-oadp-operator-oadp-1.6-5.0-e2e-test-hcp-aws openshift/oadp-operator presubmit Ci-operator config changed

A total of 64 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs.

A full list of affected jobs can be found here

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2026
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai, shubham-pampattiwar, sseago

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

@kaovilai

Copy link
Copy Markdown
Member Author

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@kaovilai: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Aug 25, 2026
@kaovilai

Copy link
Copy Markdown
Member Author

/pj-rehearse pull-ci-openshift-oadp-operator-oadp-1.6-4.23-e2e-test-kubevirt-aws

The one rehearsal failure here was in e2e-test-kubevirt-aws-e2e (the actual KubeVirt e2e test container) after 1h24m — full cluster-provisioning/test timeframe, not a fast config error, and this PR's diff only touches the downstream oadp-analyze-e2e-failure post-step's env/prompt (which can't affect this test step's own pass/fail). Retesting just this one job rather than the whole batch.

Note

Responses generated with Claude

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@kaovilai: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 32693bf into openshift:main Aug 26, 2026
20 of 21 checks passed
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. lgtm Indicates that a PR is ready to be merged. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants