Skip to content

WIP: Replace eval step bash with prow-agent-eval CLI - #83130

Draft
smg247 wants to merge 2 commits into
openshift:mainfrom
smg247:prow-agent-eval-cli
Draft

WIP: Replace eval step bash with prow-agent-eval CLI#83130
smg247 wants to merge 2 commits into
openshift:mainfrom
smg247:prow-agent-eval-cli

Conversation

@smg247

@smg247 smg247 commented Aug 7, 2026

Copy link
Copy Markdown
Member

Bake the prow-agent-eval binary into the agentic-dev image and replace hundreds of lines of bash in the init, judge, and cleanup steps with CLI invocations. The CLI handles case discovery, metadata exchange, fixture SHA resolution, judge execution, and report generation.

Summary by CodeRabbit

This PR updates the OpenShift Jira Solver evaluation workflow to use the prow-agent-eval CLI.

  • Adds prow-agent-eval to the agentic-dev image.
  • Uses the CLI for case discovery, metadata exchange, fixture SHA resolution, judging, cleanup, and report generation.
  • Replaces custom Bash evaluation and cleanup logic.
  • Preserves optional case selection and Jira Solver configuration overrides.
  • Uses an absolute path for the ai-helpers evaluation cases.
  • Adds the UPSTREAM_REPO parameter and updates step documentation.
  • Includes a rehearsal command for the Jira Solver evaluation job.

Bake the prow-agent-eval binary into the agentic-dev image and replace
hundreds of lines of bash in the init, judge, and cleanup steps with
CLI invocations. The CLI handles case discovery, metadata exchange,
fixture SHA resolution, judge execution, and report generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 Aug 7, 2026
@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Aug 7, 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: 02040755-7774-40ae-b9ed-0d3b24e59963

📥 Commits

Reviewing files that changed from the base of the PR and between 95dc59f and 0d4524a.

📒 Files selected for processing (2)
  • ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh
  • ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-commands.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-commands.sh
  • ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh

Walkthrough

The Jira Solver evaluation image now includes prow-agent-eval. Initialization, judging, report generation, pull request closure, and branch deletion use the CLI.

Changes

Jira Solver evaluation workflow

Layer / File(s) Summary
Provide the evaluation CLI
ci-operator/config/openshift/release/openshift-release-main__jira-solver-eval.yaml
The image adds the prow-agent-eval base image, build stage, executable, and build input.
Initialize evaluation cases
ci-operator/step-registry/openshift/agentic/trt/eval/init/*
The init step adds UPSTREAM_REPO, selects or generates configuration, exports GITHUB_TOKEN, supports an optional case, and invokes prow-agent-eval init.
Run evaluation judges and reports
ci-operator/step-registry/openshift/agentic/trt/eval/judge/*
The judge step delegates post-agent state collection, judging, and JUnit XML, YAML, and HTML report generation to prow-agent-eval.
Clean up evaluation resources
ci-operator/step-registry/openshift/agentic/trt/eval/cleanup/*
The cleanup step delegates pull request closure and branch deletion to prow-agent-eval and ignores cleanup failures.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InitStep
  participant ProwAgentEval
  participant JudgeStep
  participant CleanupStep
  participant SharedDir
  participant ArtifactDir
  participant GitHub

  InitStep->>ProwAgentEval: init evaluation cases
  ProwAgentEval->>SharedDir: write case metadata
  JudgeStep->>ProwAgentEval: judge evaluation
  ProwAgentEval->>SharedDir: collect post-agent state
  ProwAgentEval->>ArtifactDir: write evaluation reports
  CleanupStep->>ProwAgentEval: cleanup evaluation resources
  ProwAgentEval->>GitHub: close pull requests and delete branches
Loading

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error The new judge path enables xtrace and invokes a CLI that logs the last 200 characters of raw make/test output without redaction; this may expose tokens, URLs, or customer data. Redact secrets and sensitive values before logging or storing build/test output. Prefer fixed pass/fail messages in judge logs and reports.
✅ Passed checks (14 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: replacing evaluation-step Bash scripts with the prow-agent-eval CLI.
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.
Stable And Deterministic Test Names ✅ Passed The PR changes only YAML and shell step files; no Ginkgo test files or It, Describe, Context, or When title expressions appear in the added lines.
Test Structure And Quality ✅ Passed The PR changes only three shell scripts and four YAML files; no Ginkgo test files or Ginkgo constructs appear in the complete PR diff.
Microshift Test Compatibility ✅ Passed The pull request changes only evaluation scripts and YAML configuration. No new Ginkgo tests or MicroShift-incompatible API, namespace, or feature references were found.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes only CI configuration, YAML documentation, and shell scripts; no new Go files or Ginkgo test declarations were added, so SNO compatibility review is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only a CI image build and evaluation shell/ref files; it adds no deployment, operator, controller, replica, affinity, topology, node-selection, toleration, or PDB constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only YAML and Bash; it adds no Go source, OTE entrypoint, or openshift-tests extension, so the OTE stdout contract is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR changes only eval shell scripts and YAML files; the complete PR diff adds no Ginkgo e2e tests, IPv4 assumptions, or external connectivity markers.
No-Weak-Crypto ✅ Passed The full PR diff contains no MD5, SHA-1, DES/3DES, RC4, Blowfish, ECB, custom crypto, or secret-value comparisons; scripts only load GITHUB_TOKEN and invoke prow-agent-eval.
Container-Privileges ✅ Passed Changed manifests add no privileged, host namespace, SYS_ADMIN, or allowPrivilegeEscalation settings; the image switches from build-time USER root to runtime USER vscode.
✨ 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 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smg247

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 Aug 7, 2026
@smg247

smg247 commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

/pj-rehearse pull-ci-openshift-release-main-jira-solver-eval-jira-solver-eval

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

@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.

🧹 Nitpick comments (4)
ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh (3)

46-55: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use an array for the optional --case argument.

Line 55 relies on unquoted expansion to drop the empty flag. A value of EVAL_CASE that contains a space or a glob character then splits or expands. An array passes the flag as one argument and satisfies SC2086.

♻️ Proposed change
-CASE_FLAG=""
+CASE_ARGS=()
 if [[ -n "${EVAL_CASE:-}" ]]; then
-    CASE_FLAG="--case=${EVAL_CASE}"
+    CASE_ARGS+=("--case=${EVAL_CASE}")
 fi
 
 prow-agent-eval init \
     --config="${EVAL_CONFIG}" \
     --shared-dir="${SHARED_DIR}" \
     --mode=solve \
-    ${CASE_FLAG}
+    "${CASE_ARGS[@]}"

Note: with set -o nounset on Bash 4.3 and earlier, "${CASE_ARGS[@]}" on an empty array errors. Use "${CASE_ARGS[@]+"${CASE_ARGS[@]}"}" if the image ships an older Bash.

🤖 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
`@ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh`
around lines 46 - 55, Replace the CASE_FLAG string in the prow-agent-eval init
invocation with an array of optional arguments, appending the complete --case
value as one element when EVAL_CASE is non-empty. Expand that array safely in
the command, using the nounset-compatible form if required by the supported Bash
version, so values containing spaces or glob characters are preserved.

Source: Linters/SAST tools


22-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

The eval config template is inlined twice. Both step scripts embed the same fallback eval.yaml and the same unescaped sed substitution for UPSTREAM_REPO. The two copies can drift, and drift makes the judge step score against a configuration that differs from the one the run used. Ship eval.yaml in the agentic-dev image, or generate it once in the init step and write it to ${SHARED_DIR} for the judge step to read.

  • ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh#L22-L40: keep a single source for the config. If you keep the fallback here, write the resolved config to ${SHARED_DIR}/eval.yaml and drop the sed by using an unquoted heredoc.
  • ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-commands.sh#L14-L39: remove the duplicated heredoc and sed, and read the config that the init step wrote to ${SHARED_DIR}.
🤖 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
`@ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh`
around lines 22 - 40, The eval configuration is duplicated between the init and
judge scripts, allowing the two steps to use different settings. In
ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh
lines 22-40, keep the fallback heredoc as the single source, write the resolved
configuration to ${SHARED_DIR}/eval.yaml using an unquoted heredoc, and remove
the sed substitution. In
ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-commands.sh
lines 14-39, remove the duplicated heredoc and sed logic and read
${SHARED_DIR}/eval.yaml produced by the init step.

13-16: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Do not enable tracing at line 16; restore the previous state instead.

The script never enables -x at the top. Line 16 turns tracing on for the remainder of the step. The guideline asks for -x off by default and for tracing to be enabled only when needed. Replace set -x with set +x, or save and restore the prior shell options.

♻️ Proposed change
 set +x
 GITHUB_TOKEN=$(cat "${SHARED_DIR}/gh-upstream-token")
 export GITHUB_TOKEN
-set -x
+# Keep tracing off; the token is exported into the environment.

As per coding guidelines: "default to set -euo pipefail without -x; only enable tracing when needed; and disable tracing around sensitive operations."

🤖 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
`@ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh`
around lines 13 - 16, Update the tracing control surrounding GITHUB_TOKEN
retrieval in the script so tracing remains disabled afterward; replace the
trailing set -x with set +x, or explicitly save and restore the prior shell
tracing state while preserving the sensitive-operation protection.

Source: Coding guidelines

ci-operator/step-registry/openshift/agentic/trt/eval/cleanup/openshift-agentic-trt-eval-cleanup-commands.sh (1)

19-20: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Log a warning when cleanup fails, and confirm UPSTREAM_REPO is still needed.

|| true hides the exit code. A failed cleanup leaves pull requests and branches open on the upstream repository with no clear signal in the job log. Print an explicit warning instead. Also confirm whether the CLI reads UPSTREAM_REPO from the environment; the script no longer passes it, and the ref still declares it at lines 6-8.

♻️ Proposed change
-prow-agent-eval cleanup \
-    --shared-dir="${SHARED_DIR}" || true
+if ! prow-agent-eval cleanup --shared-dir="${SHARED_DIR}"; then
+    echo "WARNING: prow-agent-eval cleanup failed; PRs or branches may remain open."
+fi
🤖 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
`@ci-operator/step-registry/openshift/agentic/trt/eval/cleanup/openshift-agentic-trt-eval-cleanup-commands.sh`
around lines 19 - 20, Update the cleanup command invocation to detect failure
and emit an explicit warning while preserving the job’s non-failing behavior; do
not silently suppress the exit status with bare `|| true`. Verify whether
`prow-agent-eval cleanup` consumes `UPSTREAM_REPO` from the environment, and
remove its declaration if unused or pass it explicitly if required.
🤖 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.

Nitpick comments:
In
`@ci-operator/step-registry/openshift/agentic/trt/eval/cleanup/openshift-agentic-trt-eval-cleanup-commands.sh`:
- Around line 19-20: Update the cleanup command invocation to detect failure and
emit an explicit warning while preserving the job’s non-failing behavior; do not
silently suppress the exit status with bare `|| true`. Verify whether
`prow-agent-eval cleanup` consumes `UPSTREAM_REPO` from the environment, and
remove its declaration if unused or pass it explicitly if required.

In
`@ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh`:
- Around line 46-55: Replace the CASE_FLAG string in the prow-agent-eval init
invocation with an array of optional arguments, appending the complete --case
value as one element when EVAL_CASE is non-empty. Expand that array safely in
the command, using the nounset-compatible form if required by the supported Bash
version, so values containing spaces or glob characters are preserved.
- Around line 22-40: The eval configuration is duplicated between the init and
judge scripts, allowing the two steps to use different settings. In
ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh
lines 22-40, keep the fallback heredoc as the single source, write the resolved
configuration to ${SHARED_DIR}/eval.yaml using an unquoted heredoc, and remove
the sed substitution. In
ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-commands.sh
lines 14-39, remove the duplicated heredoc and sed logic and read
${SHARED_DIR}/eval.yaml produced by the init step.
- Around line 13-16: Update the tracing control surrounding GITHUB_TOKEN
retrieval in the script so tracing remains disabled afterward; replace the
trailing set -x with set +x, or explicitly save and restore the prior shell
tracing state while preserving the sensitive-operation protection.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 58051196-1903-47a5-a746-7b1f1901c08b

📥 Commits

Reviewing files that changed from the base of the PR and between acd3e34 and 95dc59f.

📒 Files selected for processing (7)
  • ci-operator/config/openshift/release/openshift-release-main__jira-solver-eval.yaml
  • ci-operator/step-registry/openshift/agentic/trt/eval/cleanup/openshift-agentic-trt-eval-cleanup-commands.sh
  • ci-operator/step-registry/openshift/agentic/trt/eval/cleanup/openshift-agentic-trt-eval-cleanup-ref.yaml
  • ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-commands.sh
  • ci-operator/step-registry/openshift/agentic/trt/eval/init/openshift-agentic-trt-eval-init-ref.yaml
  • ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-commands.sh
  • ci-operator/step-registry/openshift/agentic/trt/eval/judge/openshift-agentic-trt-eval-judge-ref.yaml

The inline eval config used a relative `cases` path which resolved
against /tmp (where the config is written), not ai-helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smg247

smg247 commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

/pj-rehearse pull-ci-openshift-release-main-jira-solver-eval-jira-solver-eval

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@smg247: 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]
@smg247: 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-release-main-jira-solver-eval-images openshift/release presubmit Ci-operator config changed
pull-ci-openshift-release-main-jira-solver-eval-jira-solver-eval openshift/release presubmit Ci-operator config changed
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 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@smg247: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/openshift/release/main/jira-solver-eval-jira-solver-eval 0d4524a link unknown /pj-rehearse pull-ci-openshift-release-main-jira-solver-eval-jira-solver-eval

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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