Skip to content

Generate autodl JSON for accepted payloads#80219

Open
not-stbenjam wants to merge 1 commit into
openshift:mainfrom
not-stbenjam:autodl-always
Open

Generate autodl JSON for accepted payloads#80219
not-stbenjam wants to merge 1 commit into
openshift:mainfrom
not-stbenjam:autodl-always

Conversation

@not-stbenjam

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

Copy link
Copy Markdown
Contributor

Summary

  • The payload agent previously only produced autodl JSON when a payload was rejected and Claude performed a full analysis. Accepted payloads had no autodl record, making it impossible to measure success rates in downstream analytics.
  • Adds a deterministic generate_accepted_autodl bash function that writes the autodl JSON using the canonical payload_triage schema with empty job/candidate fields and phase: "Accepted". No Claude invocation needed — just jq.
  • Called from both early-exit paths: when all blocking jobs succeed, and when the terminal Accepted phase is detected via the release controller API.

Test plan

  • Validated generated JSON passes validate.py from ai-helpers locally
  • Run periodic-ci-openshift-release-main-claude-payload-agent-no-slack against a known accepted payload to verify the autodl artifact appears in GCS

🤖 Generated with Claude Code

Summary by CodeRabbit

This PR enhances the OpenShift payload analysis infrastructure by enabling deterministic generation of analytics records for accepted payloads.

Key Change:
The Claude payload agent previously generated analytics JSON (autodl) artifacts only when payloads were rejected and required full Claude analysis. Accepted payloads had no analytics record, preventing downstream measurement of success rates.

What's being fixed:
Added a new generate_accepted_autodl() bash function to the payload agent that deterministically generates autodl JSON for accepted payloads without invoking Claude. The function:

  • Writes payload-analysis-${PAYLOAD_TAG}-autodl.json conforming to the canonical payload_triage BigQuery schema
  • Pre-populates the JSON row with actual job/phase metadata (payload tag, version, stream, blocking job counts, analysis timestamp)
  • Sets job-candidate analysis fields to empty/zero values (since no Claude analysis was needed)
  • Marks the phase as "Accepted"

When it runs:
The function is invoked from two early-exit code paths in the polling loop:

  1. When all blocking jobs complete successfully with zero failures
  2. When the payload reaches terminal "Accepted" phase via the release controller API (after a grace period)

Impact on CI Infrastructure:
This change affects the openshift/claude/payload/agent step in the Claude payload triage workflow, enabling complete analytics coverage for both accepted and rejected payloads. This allows downstream analytics systems to accurately measure payload acceptance rates and trends.

Testing:

  • Generated JSON has been validated locally against the canonical schema validation script (validate.py)
  • A periodic CI job is configured to verify the autodl artifact appears in GCS for known accepted payloads

@coderabbitai

coderabbitai Bot commented Jun 8, 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: 4efb952e-8978-415b-ac67-d11f8dbc7296

📥 Commits

Reviewing files that changed from the base of the PR and between 0c46501 and d36861f.

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

Walkthrough

This PR adds AUTODL JSON artifact generation for accepted payloads. A new generate_accepted_autodl(phase) function writes deterministic payload triage records using jq with fixed schema fields, runtime payload/release metadata, and pre-populated empty candidate/job/revert fields, invoked during early-exit paths when blocking jobs succeed or payloads reach terminal Accepted phase.

Changes

AUTODL Payload Triage Artifact Generation

Layer / File(s) Summary
Generate accepted AUTODL artifact function and integration
ci-operator/step-registry/openshift/claude/payload/agent/openshift-claude-payload-agent-commands.sh
Adds generate_accepted_autodl(phase) function that constructs and writes payload-analysis-${PAYLOAD_TAG}-autodl.json with UTC timestamp, payload/version/stream metadata, blocking job counts, and zero-initialized candidate/job/revert fields. Function is called in two early-exit paths: when all blocking jobs succeed with zero failures, and when payload reaches terminal Accepted phase after grace period.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

lgtm, ok-to-test

Suggested reviewers

  • mtulio
🚥 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 "Generate autodl JSON for accepted payloads" directly and clearly describes the main change: adding a function to generate autodl JSON for accepted payloads without Claude analysis.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 PR modifies only a bash script, adding a generate_accepted_autodl function. No Ginkgo tests are introduced or modified; check is not applicable.
Test Structure And Quality ✅ Passed This PR modifies only bash scripts and configuration files (no Ginkgo test files). The custom check for Ginkgo test code quality is not applicable here.
Microshift Test Compatibility ✅ Passed PR does not add any new Ginkgo e2e tests. Added Go test files are unit tests for tooling (gotest2junit, junitreport), not e2e tests with Ginkgo patterns.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only a bash shell script for payload triage and adds no Ginkgo e2e tests; SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only a CI testing utility script generating JSON metadata, not deployment manifests, operators, or controllers. No scheduling constraints or topology assumptions introduced.
Ote Binary Stdout Contract ✅ Passed PR modifies only bash scripts in CI infrastructure, not OTE binaries. OTE stdout contract check is not applicable to bash script modifications.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds no new Ginkgo e2e tests. Changes are to a bash shell script and config files only; custom check for test IPv6/connectivity compatibility does not apply.
No-Weak-Crypto ✅ Passed No weak crypto algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom implementations, or non-constant-time secret comparisons found. New function uses only jq and date utilities.
Container-Privileges ✅ Passed PR adds bash function for JSON generation with no container privilege settings in YAML manifest file.
No-Sensitive-Data-In-Logs ✅ Passed New function logs only public metadata (payload_tag, version, stream, phase, job counts). Credentials protected by set +x; tokens/webhooks never echoed, only paths logged.

✏️ 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 and usage tips.

@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 8, 2026
@openshift-ci

openshift-ci Bot commented Jun 8, 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 mtulio and petr-muller June 8, 2026 13:56
@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Jun 8, 2026
The payload agent previously only produced autodl JSON when a payload
was rejected and analyzed by Claude. This meant accepted payloads had
no autodl record, making it impossible to measure success rates in
downstream analytics.

Add a deterministic bash function that generates the autodl JSON with
the canonical schema for accepted payloads — no Claude invocation
needed. The function is called from both early-exit paths (all blocking
jobs succeeded, and terminal Accepted phase detected).

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

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: not-stbenjam
Once this PR has been reviewed and has the lgtm label, please assign petr-muller for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@stbenjam

stbenjam commented Jun 8, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@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 8, 2026
@openshift-ci

openshift-ci Bot commented Jun 8, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants