Skip to content

Fix empty Slack summary in payload-agent-analyze notifications#80941

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
not-stbenjam:slack-notifications
Jun 23, 2026
Merged

Fix empty Slack summary in payload-agent-analyze notifications#80941
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
not-stbenjam:slack-notifications

Conversation

@not-stbenjam

@not-stbenjam not-stbenjam commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • agentic-ci --no-streaming mixes non-JSON header lines (e.g. ▶ Backend: local) into stdout alongside Claude's stream-json output
  • jq aborts on the first non-JSON line and never reaches the {"type":"result"} record, so SUMMARY is always empty
  • Slack notifications show "No summary available." instead of Claude's analysis summary
  • Fix: pre-filter with grep -E '^\{' to pass only JSON lines to jq

Test plan

  • Verified jq fails silently on mixed JSON/non-JSON input (exit code 5, no output)
  • Verified fix extracts result correctly from mixed input
  • End-to-end test with agentic-ci run --no-streaming confirms old extraction returns empty, fixed extraction returns the summary

🤖 Generated with Claude Code

Summary by CodeRabbit

This PR fixes the Slack notification message sent by the openshift-claude-payload-agent CI step, which is part of OpenShift's release engineering infrastructure for automated payload analysis.

Problem: Slack notifications displayed "No summary available." instead of showing Claude's analysis findings because the extraction logic failed to parse the agent's output.

Root Cause: The agentic-ci --no-streaming command outputs mixed content to stdout—both non-JSON header lines (like ▶ Backend: local) and JSON stream records. The extraction command piped this directly to jq, which aborts on the first non-JSON line and never processes the {"type":"result"} record containing the summary.

Solution: Line 579 now pre-filters the output with grep -E '^\{' to pass only JSON lines to jq. This ensures the summary extraction succeeds even with mixed input, allowing Slack notifications to display Claude's analysis findings.

The fix affects the Slack summary phase of the Claude payload analysis workflow in OpenShift CI, ensuring that release engineers receive Claude's analysis summary in Slack notifications for rejected OCP payloads.

agentic-ci --no-streaming mixes non-JSON header lines (e.g.
"▶ Backend: local") into stdout alongside stream-json output.
jq aborts on the first non-JSON line and never reaches the
{"type":"result"} record, leaving SUMMARY empty and Slack
showing "No summary available."

Pre-filter with grep to pass only JSON lines to jq.

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

coderabbitai Bot commented Jun 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: Enterprise

Run ID: 9f33cbac-b1a9-4cb6-b89d-7a1655bd0ffa

📥 Commits

Reviewing files that changed from the base of the PR and between dbf4fab and 2aa80ff.

📒 Files selected for processing (1)
  • ci-operator/step-registry/openshift/claude/payload/agent/openshift-claude-payload-agent-commands.sh

Walkthrough

A single line in the Slack-summary phase of the Claude payload agent script is updated to pre-filter SLACK_LOG with grep for lines starting with { before piping into jq to extract SUMMARY, replacing direct jq parsing of the raw log file.

Changes

Slack Summary Extraction Fix

Layer / File(s) Summary
SLACK_LOG pre-filtering for SUMMARY
ci-operator/step-registry/openshift/claude/payload/agent/openshift-claude-payload-agent-commands.sh
SUMMARY extraction now greps SLACK_LOG for lines beginning with { before passing to jq (selecting .type == "result" and extracting .result), replacing the prior direct jq invocation over the whole log file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • openshift/release#80680: Modifies the same openshift-claude-payload-agent-commands.sh Slack-summary path, specifically how Slack log output is produced and recorded — directly upstream of the parsing logic changed here.

Suggested labels

lgtm, ok-to-test

Suggested reviewers

  • sosiouxme
  • dgoodwin
🚥 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 accurately describes the main change: fixing empty Slack summaries in payload-agent notifications by filtering JSON lines before jq processing.
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 Custom check for Ginkgo test names is not applicable; PR modifies only a bash shell script with no test code or test file changes.
Test Structure And Quality ✅ Passed This PR does not include any Ginkgo test code. It adds a bash shell script for a CI operator step and supporting documentation files. The custom check for Ginkgo test structure and quality is not a...
Microshift Test Compatibility ✅ Passed This PR does not add any Ginkgo e2e tests (It, Describe, Context, When, etc.). The changes are a bash script modification and non-Ginkgo unit tests. The MicroShift compatibility check is not applic...
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies a shell script that fixes Slack notification summary extraction. It contains no Ginkgo e2e tests, so the SNO test compatibility check does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies a CI operator step script to fix JSON output filtering for Slack notifications. It contains no deployment manifests, operator code, controllers, or any scheduling constraints, maki...
Ote Binary Stdout Contract ✅ Passed PR modifies a bash shell script in the CI step registry, not an OTE binary. The OTE Binary Stdout Contract applies to compiled Go binaries with process-level code (main, TestMain, etc.), not shell...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies a shell script (openshift-claude-payload-agent-commands.sh), not Ginkgo e2e tests. The check for IPv6/disconnected network compatibility applies only to e2e test additions and is n...
No-Weak-Crypto ✅ Passed PR introduces no weak crypto, custom crypto implementations, or insecure secret comparisons. It's a bash log-filtering fix with grep and jq.
Container-Privileges ✅ Passed PR contains only a bash script fix for JSON parsing and YAML metadata updates. No container privilege escalation, privileged mode, hostPID/Network/IPC, SYS_ADMIN capability, or allowPrivilegeEscala...
No-Sensitive-Data-In-Logs ✅ Passed The change adds a grep filter that reduces (not increases) exposed data by filtering to JSON-only lines before jq processing. No new logging, tokens, or sensitive data exposure mechanisms are intro...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 23, 2026
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci openshift-ci Bot requested review from petr-muller and stbenjam June 23, 2026 18:32
@stbenjam

Copy link
Copy Markdown
Member

/ok-to-test
/approve

(Automated: Extending self-approval rights and ok-to-test to my bot account.)

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 23, 2026
@stbenjam

Copy link
Copy Markdown
Member

/pj-rehearse

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

@stbenjam: 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 rehearsals-ack Signifies that rehearsal jobs have been acknowledged and removed rehearsals-ack Signifies that rehearsal jobs have been acknowledged labels Jun 23, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@not-stbenjam: 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
periodic-ci-openshift-release-main-payload-agent-analyze N/A periodic Registry content 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 added the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2026
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: not-stbenjam, petr-muller, stbenjam

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

@petr-muller

Copy link
Copy Markdown
Member

@openshift-merge-bot openshift-merge-bot Bot added rehearsals-ack and removed rehearsals-ack labels 3 hours ago

wtf

@stbenjam

Copy link
Copy Markdown
Member

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@stbenjam: 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 Jun 23, 2026
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@not-stbenjam: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 21bcc67 into openshift:main Jun 23, 2026
10 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants