Add payload-agent presubmit to openshift-eng/ai-helpers#81149
Add payload-agent presubmit to openshift-eng/ai-helpers#81149not-stbenjam wants to merge 1 commit into
Conversation
WalkthroughThe CI config adds an optional ChangesAI helpers CI test step
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Hi @not-stbenjam. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ci-operator/step-registry/openshift/claude/payload/agent/openshift-claude-payload-agent-commands.sh (1)
579-579: 🎯 Functional Correctness | 🔵 TrivialUse line-robust jq parsing with
fromjson?to avoid silent failures on malformed JSONThe current
grep+ strictjqpipeline fails to extract the summary if a line starting with{contains invalid JSON, causing the parser to abort. Switching tojq's raw input mode with optional JSON conversion (fromjson?) safely skips malformed lines and reliably retrieves the first valid result record.-SUMMARY=$(grep -E '^\{' "${SLACK_LOG}" | jq -r 'select(.type == "result") | .result // empty' 2>/dev/null | head -1) || SUMMARY="" +SUMMARY=$(jq -Rr 'fromjson? | select(.type == "result") | .result // empty' "${SLACK_LOG}" 2>/dev/null | head -1) || SUMMARY=""Verification confirmed that with input containing a non-JSON brace line, the original approach returns empty while the proposed change correctly extracts
"wanted".🤖 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/claude/payload/agent/openshift-claude-payload-agent-commands.sh` at line 579, The summary extraction pipeline in the shell script is too brittle because the current `grep` plus strict `jq` parsing stops on malformed brace-prefixed lines, so update the parsing logic in the summary assignment to use line-robust `jq` raw input with `fromjson?` and keep selecting the first valid record with `.type == "result"` and `.result`. Make the change in the summary extraction block identified by the `SUMMARY=` assignment so invalid JSON lines are skipped instead of causing an empty result.
🤖 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/claude/payload/agent/openshift-claude-payload-agent-commands.sh`:
- Line 579: The summary extraction pipeline in the shell script is too brittle
because the current `grep` plus strict `jq` parsing stops on malformed
brace-prefixed lines, so update the parsing logic in the summary assignment to
use line-robust `jq` raw input with `fromjson?` and keep selecting the first
valid record with `.type == "result"` and `.result`. Make the change in the
summary extraction block identified by the `SUMMARY=` assignment so invalid JSON
lines are skipped instead of causing an empty result.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 31405c03-1f99-4a4c-b029-fe3586da6288
⛔ Files ignored due to path filters (1)
ci-operator/jobs/openshift/release/openshift-release-main-presubmits.yamlis excluded by!ci-operator/jobs/**
📒 Files selected for processing (2)
ci-operator/config/openshift/release/openshift-release-main__payload-agent.yamlci-operator/step-registry/openshift/claude/payload/agent/openshift-claude-payload-agent-commands.sh
|
/ok-to-test (Automated: Extending self-approval rights and ok-to-test to my bot account.) |
da4b36f to
ca598e0
Compare
Add an optional, always-run-false presubmit that runs the same payload analysis workflow as the existing periodic. Triggerable via `/test payload-agent` on openshift-eng/ai-helpers PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ca598e0 to
88eebfd
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: not-stbenjam, stbenjam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
`@ci-operator/config/openshift-eng/ai-helpers/openshift-eng-ai-helpers-main.yaml`:
- Around line 23-29: The new optional presubmit entry in the ci-operator config
needs its generated Prow job artifacts committed too. After updating the tests
entry in the openshift-eng-ai-helpers-main configuration, regenerate the
downstream ci-operator/jobs output using the standard CI config update flow (for
example, the make update / registry-metadata / ci-operator-config / jobs
sequence) and include those generated files in the same PR. Refer to the updated
tests stanza and the payload-agent job definition so the generated job config
stays in sync.
🪄 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: Enterprise
Run ID: 07c845a6-b314-4c07-90b8-74747019f5e4
📒 Files selected for processing (1)
ci-operator/config/openshift-eng/ai-helpers/openshift-eng-ai-helpers-main.yaml
|
@not-stbenjam: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary
openshift-eng/ai-helpersopenshift-claude-payloadworkflow as the existing periodic/test payload-agenton ai-helpers PRsTest plan
optional: trueandalways_run: false/test payload-agenton an ai-helpers PR to validate🤖 Generated with Claude Code
Summary by CodeRabbit
This PR updates the OpenShift CI configuration for
openshift-eng/ai-helpersto add a new optional presubmit job for thepayload-agentvariant. The job is wired to the existingopenshift-claude-payloadworkflow, is configured withalways_run: false, and can be manually triggered onopenshift/releasepull requests with/test payload-agent-analyze-presubmit.In practical terms, this gives the payload-agent analysis workflow a dedicated, non-blocking presubmit path so it can be validated on demand without running on every change.