Skip to content

CNTRLPLANE-3757: review-agent: trigger periodic via gangway instead of running inline#81366

Merged
openshift-merge-bot[bot] merged 4 commits into
openshift:mainfrom
enxebre:review-agent-periodic-trigger
Jul 2, 2026
Merged

CNTRLPLANE-3757: review-agent: trigger periodic via gangway instead of running inline#81366
openshift-merge-bot[bot] merged 4 commits into
openshift:mainfrom
enxebre:review-agent-periodic-trigger

Conversation

@enxebre

@enxebre enxebre commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • The review-agent presubmit aborts itself when the agent pushes commits to the PR branch. This splits the architecture so the presubmit only triggers a periodic job via gangway and posts a PR comment with the job link.
  • Adds a periodic-review-agent periodic job (cron: @yearly, triggered only via gangway) that runs the full hypershift-review-agent workflow.
  • Adds a lightweight hypershift-review-agent-trigger step/workflow that triggers the periodic via gangway API and comments on the PR.
  • Updates all presubmit configs (openshift + openshift-priv) to use the trigger workflow.
  • Follows the jira-agent pattern for MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR gangway parameter passing.

Test plan

  • Verify make update generates correct periodic and presubmit job definitions
  • Trigger /test address-review-comments on a test PR and confirm it triggers the periodic via gangway and posts a comment
  • Confirm the periodic job receives the PR number and runs the review agent against it

🤖 Generated with Claude Code

Summary by CodeRabbit

This PR updates the OpenShift CI infrastructure for HyperShift review-agents so presubmits no longer execute the full hypershift-review-agent inline. Instead, presubmit jobs now invoke a new lightweight hypershift-review-agent-trigger workflow that uses Gangway to start a separate scheduled job and then posts a PR comment linking to the resulting job run.

Practically:

  • openshift and openshift-priv presubmit configs are updated so the address-review-comments step/workflow switches from hypershift-review-agent to hypershift-review-agent-trigger across main and multiple release branches, while preserving the existing “skip if only changed” behavior.
  • In ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml, a new scheduled periodic-review-agent job is added with an @yearly cron; the trigger workflow is intended to run the full hypershift-review-agent workflow via Gangway when kicked off.

To support Gangway-driven targeting, the review-agent process logic was updated to follow the jira-agent multistage override pattern:

  • Added MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR and changed PR selection to derive the target PR number from that value (or fall back to PULL_NUMBER), removing the previous direct REVIEW_AGENT_TARGET_PR override.

The PR also introduces the trigger step/workflow plumbing:

  • New hypershift-review-agent-trigger step + workflow that calls the Gangway periodic execution endpoint (with retries/polling) and extracts JOB_ID/job_url.
  • Adds logic to comment on the PR with the job link via GitHub REST (when GitHub App credentials are available), otherwise skipping the comment.
  • Adds step registry metadata and ownership (OWNERS / metadata JSON) for the new trigger step and workflow.

enxebre and others added 3 commits July 2, 2026 00:35
The review-agent presubmit has a design flaw: when the agent pushes
commits to the PR branch, the presubmit job aborts itself. This change
splits the architecture:

- Add a periodic-review-agent periodic job (cron: @Yearly, triggered
  only via gangway) that runs the full hypershift-review-agent workflow
- Add a lightweight hypershift-review-agent-trigger step that:
  1. Triggers the periodic job via gangway API with the PR number
  2. Posts a comment on the PR with a link to the triggered job
- Update all presubmit configs (openshift + openshift-priv) to use
  the trigger workflow instead of running the agent inline

The gangway token is read from the hypershift-team-claude-prow secret.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The REVIEW_AGENT_TARGET_PR env var should not have a hardcoded default.
The periodic job receives the PR number from gangway via
MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR, and the process
script already fails fast if no PR number is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Declare MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR in the ref
YAML and apply it in the script, matching the jira-agent pattern for
gangway API overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
openshift-ci Bot requested review from bryan-cox and celebdor July 1, 2026 23:22
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds a new Gangway-backed HyperShift review-agent trigger workflow, updates the review-agent process step to accept a multistage PR override, and repoints address-review-comments jobs in CI configs to the new trigger workflow.

Changes

HyperShift review-agent trigger flow

Layer / File(s) Summary
Trigger definitions
ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-ref.yaml, ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-workflow.yaml, ci-operator/step-registry/hypershift/review-agent/trigger/OWNERS, ci-operator/step-registry/hypershift/review-agent/trigger/*.metadata.json
Adds the new trigger step registry entry, workflow, ownership files, and metadata wiring for hypershift-review-agent-trigger.
Process PR override
ci-operator/step-registry/hypershift/review-agent/process/hypershift-review-agent-process-commands.sh, ci-operator/step-registry/hypershift/review-agent/process/hypershift-review-agent-process-ref.yaml
Adds MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR, exports it as REVIEW_AGENT_TARGET_PR, and updates PR selection/error handling in the process step.
Trigger execution flow
ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh
Adds the trigger script that launches Gangway periodic execution, polls for job details, and posts a PR comment with the job link when GitHub credentials are available.
CI job rewiring
ci-operator/config/openshift/hypershift/*.yaml, ci-operator/config/openshift-priv/hypershift/*.yaml
Switches address-review-comments jobs to hypershift-review-agent-trigger and adds a yearly periodic-review-agent job in the main HyperShift config.

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

Suggested labels: lgtm

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 No Ginkgo test definitions or titles were added/modified; the PR only changes CI YAML, bash scripts, and step-registry metadata.
Test Structure And Quality ✅ Passed PR only changes CI YAML, step-registry scripts, and metadata; no Ginkgo test code or assertions are touched, so this check is not applicable.
Microshift Test Compatibility ✅ Passed PASS: The PR only changes CI YAML, step-registry metadata, and shell scripts; no new Ginkgo e2e tests or MicroShift-sensitive APIs were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Go/Ginkgo e2e tests were added; the PR only changes ci-operator YAML and shell scripts, so SNO test compatibility is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Touched files are CI configs and gangway scripts; no nodeSelector, affinity, topology spread, replica, or PDB changes were introduced.
Ote Binary Stdout Contract ✅ Passed No OTE binary or TestMain/main setup code changed; only CI step scripts/YAML, so stdout-contract violations are not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes CI YAML/bash step-registry files, and scans found no It/Describe or IPv4-only test code.
No-Weak-Crypto ✅ Passed No weak-crypto patterns were added; the scripts use standard RS256 JWT signing with SHA-256, and no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto appeared.
Container-Privileges ✅ Passed Touched CI configs and step-registry YAMLs contain no privileged/securityContext flags; only workflow refs, resources, and credentials were added.
No-Sensitive-Data-In-Logs ✅ Passed New logs only print PR/job metadata and file paths; token values are not echoed, and sensitive curl calls are wrapped with set +x.
Title check ✅ Passed The title clearly summarizes the main change: switching review-agent from inline execution to a Gangway-triggered periodic job.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh (1)

96-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

JOB_STATUS is computed but never used.

Shellcheck flags this (SC2034). Consider wiring it into the final summary output for better observability instead of discarding it.

♻️ Proposed fix
 echo "=== Trigger Complete ==="
 echo "Job ID: ${JOB_ID}"
 echo "Job URL: ${JOB_URL:-pending}"
+echo "Job Status: ${JOB_STATUS:-unknown}"

Also applies to: 136-138

🤖 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/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh`
around lines 96 - 97, The script computes JOB_STATUS in the trigger flow but
never uses it, which triggers the unused-variable warning; update the
review-agent trigger logic so JOB_STATUS is included in the final summary/output
instead of being discarded. Make the change in the STATUS_BODY parsing and the
related summary emission paths in hypershift-review-agent-trigger-commands.sh,
including the duplicate status handling later in the script, so the collected
job status is surfaced consistently.

Source: Linters/SAST tools

🤖 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/hypershift/openshift-hypershift-main.yaml`:
- Around line 574-578: Regenerate the periodic job definitions for the
hypershift main config so the missing periodic-review-agent job is added to the
generated periodics file. Update the generated job output associated with the
hypershift-review-agent workflow and ensure the PERIODIC_JOB_NAME target
periodic-ci-openshift-hypershift-main-periodic-review-agent is present in
ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-periodics.yaml.

In
`@ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh`:
- Around line 57-75: The trigger loop in
hypershift-review-agent-trigger-commands.sh is turning tracing back on too
early, so parsing RESPONSE with echo/sed/jq can leak the API response body into
logs. Update the retry block around the curl call in the trigger logic to keep
set -x disabled while capturing and parsing RESPONSE, matching the safer pattern
already used in the later polling loop, and only re-enable tracing after the
sensitive response handling is complete.
- Around line 41-45: All curl invocations in
hypershift-review-agent-trigger-commands.sh need explicit timeout handling so
the step fails fast instead of hanging indefinitely. Update the token exchange,
Gangway trigger/poll, and PR comment request paths to pass both connect and
overall timeouts, and keep the existing retry logic in the surrounding shell
flow. Use the existing curl call sites in the script as the targets, especially
the token exchange block and the Gangway/PR comment helper invocations, and
apply the same timeout pattern consistently everywhere curl is used.

---

Nitpick comments:
In
`@ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh`:
- Around line 96-97: The script computes JOB_STATUS in the trigger flow but
never uses it, which triggers the unused-variable warning; update the
review-agent trigger logic so JOB_STATUS is included in the final summary/output
instead of being discarded. Make the change in the STATUS_BODY parsing and the
related summary emission paths in hypershift-review-agent-trigger-commands.sh,
including the duplicate status handling later in the script, so the collected
job status is surfaced consistently.
🪄 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: 6993c18c-c735-4f44-963a-003ef8a842a2

📥 Commits

Reviewing files that changed from the base of the PR and between b56d627 and ded45ce.

📒 Files selected for processing (16)
  • ci-operator/config/openshift-priv/hypershift/openshift-priv-hypershift-main.yaml
  • ci-operator/config/openshift-priv/hypershift/openshift-priv-hypershift-release-4.22.yaml
  • ci-operator/config/openshift-priv/hypershift/openshift-priv-hypershift-release-4.23.yaml
  • ci-operator/config/openshift-priv/hypershift/openshift-priv-hypershift-release-5.0.yaml
  • ci-operator/config/openshift-priv/hypershift/openshift-priv-hypershift-release-5.1.yaml
  • ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml
  • ci-operator/config/openshift/hypershift/openshift-hypershift-release-4.22.yaml
  • ci-operator/config/openshift/hypershift/openshift-hypershift-release-4.23.yaml
  • ci-operator/config/openshift/hypershift/openshift-hypershift-release-5.0.yaml
  • ci-operator/config/openshift/hypershift/openshift-hypershift-release-5.1.yaml
  • ci-operator/step-registry/hypershift/review-agent/process/hypershift-review-agent-process-commands.sh
  • ci-operator/step-registry/hypershift/review-agent/process/hypershift-review-agent-process-ref.yaml
  • ci-operator/step-registry/hypershift/review-agent/trigger/OWNERS
  • ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh
  • ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-ref.yaml
  • ci-operator/step-registry/hypershift/review-agent/trigger/hypershift-review-agent-trigger-workflow.yaml

Comment on lines +41 to +45
curl -s -X POST \
-H "Authorization: Bearer ${JWT}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/app/installations/${INSTALL_ID}/access_tokens" \
| jq -r '.token'

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Add timeouts to all curl calls.

None of the curl invocations (token exchange, Gangway trigger/poll, PR comment) set --max-time/--connect-timeout. If Gangway or GitHub's API hangs, the retry loops (and the whole trigger step) can block indefinitely instead of failing fast and retrying.

🔧 Proposed fix (apply pattern to each curl call)
-  RESPONSE=$(curl -s -X POST -d "${POST_DATA}" \
+  RESPONSE=$(curl -s --max-time 30 -X POST -d "${POST_DATA}" \
     -H "Authorization: Bearer $(cat "${TOKEN_FILE}")" \
     "${GANGWAY_API}/v1/executions/${PERIODIC_JOB_NAME}" \
     -w "\n%{http_code}")

Also applies to: 59-62, 88-91, 122-126

🤖 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/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh`
around lines 41 - 45, All curl invocations in
hypershift-review-agent-trigger-commands.sh need explicit timeout handling so
the step fails fast instead of hanging indefinitely. Update the token exchange,
Gangway trigger/poll, and PR comment request paths to pass both connect and
overall timeouts, and keep the existing retry logic in the surrounding shell
flow. Use the existing curl call sites in the script as the targets, especially
the token exchange block and the Gangway/PR comment helper invocations, and
apply the same timeout pattern consistently everywhere curl is used.

Comment on lines +57 to +75
for ((i=1; i<=MAX_RETRIES; i++)); do
set +x
RESPONSE=$(curl -s -X POST -d "${POST_DATA}" \
-H "Authorization: Bearer $(cat "${TOKEN_FILE}")" \
"${GANGWAY_API}/v1/executions/${PERIODIC_JOB_NAME}" \
-w "\n%{http_code}")
set -x
HTTP_STATUS=$(echo "$RESPONSE" | tail -1)
JSON_BODY=$(echo "$RESPONSE" | sed '$d')

if [ "$HTTP_STATUS" -eq 200 ]; then
JOB_ID=$(echo "$JSON_BODY" | jq -r '.id')
echo "Job triggered successfully. Job ID: ${JOB_ID}"
break
else
echo "[$i/$MAX_RETRIES] Gangway API returned HTTP $HTTP_STATUS. Retrying in ${RETRY_INTERVAL}s..."
sleep "$RETRY_INTERVAL"
fi
done

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.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Re-enabling set -x turns tracing on that was never active, tracing response bodies.

The script starts with set -euo pipefail (no -x), so tracing is off by default. Inside the trigger loop, set -x at line 63 re-enables tracing immediately, before the response is parsed (lines 64-65), causing the traced echo "$RESPONSE" | ... commands to print the full API response body to logs. The second polling loop (lines 85-105) correctly keeps tracing off for the entire block — apply the same pattern here instead of toggling -x on mid-loop.

As per coding guidelines, "Be cautious with set -x (debug tracing) - it logs all executed commands with their arguments. Variable expansions in traced commands will expose their values in logs" and "Keep the tracing-disabled scope minimal (only around sensitive operations)".

🔒 Proposed fix
 for ((i=1; i<=MAX_RETRIES; i++)); do
   set +x
   RESPONSE=$(curl -s -X POST -d "${POST_DATA}" \
     -H "Authorization: Bearer $(cat "${TOKEN_FILE}")" \
     "${GANGWAY_API}/v1/executions/${PERIODIC_JOB_NAME}" \
     -w "\n%{http_code}")
-  set -x
   HTTP_STATUS=$(echo "$RESPONSE" | tail -1)
   JSON_BODY=$(echo "$RESPONSE" | sed '$d')
+  set -x

Also applies to: 105-105, 127-127

🤖 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/hypershift/review-agent/trigger/hypershift-review-agent-trigger-commands.sh`
around lines 57 - 75, The trigger loop in
hypershift-review-agent-trigger-commands.sh is turning tracing back on too
early, so parsing RESPONSE with echo/sed/jq can leak the API response body into
logs. Update the retry block around the curl call in the trigger logic to keep
set -x disabled while capturing and parsing RESPONSE, matching the safer pattern
already used in the later polling loop, and only re-enable tracing after the
sensitive response handling is complete.

Source: Coding guidelines

- Suppress SC2034 for JOB_STATUS (used for debugging)
- Add generated metadata files for trigger ref and workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@enxebre
enxebre force-pushed the review-agent-periodic-trigger branch from 76728a0 to 6ce8e55 Compare July 1, 2026 23:52
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@enxebre: 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-hypershift-main-address-review-comments openshift/hypershift presubmit Ci-operator config changed
pull-ci-openshift-hypershift-release-5.0-address-review-comments openshift/hypershift presubmit Ci-operator config changed
pull-ci-openshift-hypershift-release-4.22-address-review-comments openshift/hypershift presubmit Ci-operator config changed
pull-ci-openshift-hypershift-release-4.23-address-review-comments openshift/hypershift presubmit Ci-operator config changed
pull-ci-openshift-hypershift-release-5.1-address-review-comments openshift/hypershift presubmit Ci-operator config changed
periodic-ci-openshift-hypershift-main-periodic-review-agent N/A periodic Periodic 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 Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

@enxebre enxebre changed the title review-agent: trigger periodic via gangway instead of running inline CNTRLPLANE-3757: review-agent: trigger periodic via gangway instead of running inline Jul 2, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 2, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@enxebre: This pull request references CNTRLPLANE-3757 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • The review-agent presubmit aborts itself when the agent pushes commits to the PR branch. This splits the architecture so the presubmit only triggers a periodic job via gangway and posts a PR comment with the job link.
  • Adds a periodic-review-agent periodic job (cron: @yearly, triggered only via gangway) that runs the full hypershift-review-agent workflow.
  • Adds a lightweight hypershift-review-agent-trigger step/workflow that triggers the periodic via gangway API and comments on the PR.
  • Updates all presubmit configs (openshift + openshift-priv) to use the trigger workflow.
  • Follows the jira-agent pattern for MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR gangway parameter passing.

Test plan

  • Verify make update generates correct periodic and presubmit job definitions
  • Trigger /test address-review-comments on a test PR and confirm it triggers the periodic via gangway and posts a comment
  • Confirm the periodic job receives the PR number and runs the review agent against it

🤖 Generated with Claude Code

Summary by CodeRabbit

This PR updates the OpenShift CI infrastructure for HyperShift review-agents so presubmits no longer execute the full hypershift-review-agent inline. Instead, presubmit jobs now invoke a new lightweight hypershift-review-agent-trigger workflow that uses Gangway to start a separate scheduled job and then posts a PR comment linking to the resulting job run.

Practically:

  • openshift and openshift-priv presubmit configs are updated so the address-review-comments step/workflow switches from hypershift-review-agent to hypershift-review-agent-trigger across main and multiple release branches, while preserving the existing “skip if only changed” behavior.
  • In ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml, a new scheduled periodic-review-agent job is added with an @yearly cron; the trigger workflow is intended to run the full hypershift-review-agent workflow via Gangway when kicked off.

To support Gangway-driven targeting, the review-agent process logic was updated to follow the jira-agent multistage override pattern:

  • Added MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR and changed PR selection to derive the target PR number from that value (or fall back to PULL_NUMBER), removing the previous direct REVIEW_AGENT_TARGET_PR override.

The PR also introduces the trigger step/workflow plumbing:

  • New hypershift-review-agent-trigger step + workflow that calls the Gangway periodic execution endpoint (with retries/polling) and extracts JOB_ID/job_url.
  • Adds logic to comment on the PR with the job link via GitHub REST (when GitHub App credentials are available), otherwise skipping the comment.
  • Adds step registry metadata and ownership (OWNERS / metadata JSON) for the new trigger step and workflow.

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 openshift-eng/jira-lifecycle-plugin repository.

@enxebre

enxebre commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

/pj-rehearse ack

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@enxebre: 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 Jul 2, 2026
@sdminonne

sdminonne commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

/lgtm

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

/lgtm

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

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre, jparrill, sdminonne

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-merge-bot
openshift-merge-bot Bot merged commit 9b64dda into openshift:main Jul 2, 2026
18 checks passed
krisnababu pushed a commit to oharan2/release that referenced this pull request Jul 3, 2026
…f running inline (openshift#81366)

* review-agent: trigger periodic via gangway instead of running inline

The review-agent presubmit has a design flaw: when the agent pushes
commits to the PR branch, the presubmit job aborts itself. This change
splits the architecture:

- Add a periodic-review-agent periodic job (cron: @Yearly, triggered
  only via gangway) that runs the full hypershift-review-agent workflow
- Add a lightweight hypershift-review-agent-trigger step that:
  1. Triggers the periodic job via gangway API with the PR number
  2. Posts a comment on the PR with a link to the triggered job
- Update all presubmit configs (openshift + openshift-priv) to use
  the trigger workflow instead of running the agent inline

The gangway token is read from the hypershift-team-claude-prow secret.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: remove hardcoded PR default from process step

The REVIEW_AGENT_TARGET_PR env var should not have a hardcoded default.
The periodic job receives the PR number from gangway via
MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR, and the process
script already fails fast if no PR number is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: follow jira-agent pattern for gangway param override

Declare MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR in the ref
YAML and apply it in the script, matching the jira-agent pattern for
gangway API overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: fix shellcheck warning and add registry metadata

- Suppress SC2034 for JOB_STATUS (used for debugging)
- Add generated metadata files for trigger ref and workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
smulje pushed a commit to smulje/release that referenced this pull request Jul 9, 2026
…f running inline (openshift#81366)

* review-agent: trigger periodic via gangway instead of running inline

The review-agent presubmit has a design flaw: when the agent pushes
commits to the PR branch, the presubmit job aborts itself. This change
splits the architecture:

- Add a periodic-review-agent periodic job (cron: @Yearly, triggered
  only via gangway) that runs the full hypershift-review-agent workflow
- Add a lightweight hypershift-review-agent-trigger step that:
  1. Triggers the periodic job via gangway API with the PR number
  2. Posts a comment on the PR with a link to the triggered job
- Update all presubmit configs (openshift + openshift-priv) to use
  the trigger workflow instead of running the agent inline

The gangway token is read from the hypershift-team-claude-prow secret.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: remove hardcoded PR default from process step

The REVIEW_AGENT_TARGET_PR env var should not have a hardcoded default.
The periodic job receives the PR number from gangway via
MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR, and the process
script already fails fast if no PR number is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: follow jira-agent pattern for gangway param override

Declare MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR in the ref
YAML and apply it in the script, matching the jira-agent pattern for
gangway API overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: fix shellcheck warning and add registry metadata

- Suppress SC2034 for JOB_STATUS (used for debugging)
- Add generated metadata files for trigger ref and workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SachinNinganure pushed a commit to SachinNinganure/release that referenced this pull request Jul 20, 2026
…f running inline (openshift#81366)

* review-agent: trigger periodic via gangway instead of running inline

The review-agent presubmit has a design flaw: when the agent pushes
commits to the PR branch, the presubmit job aborts itself. This change
splits the architecture:

- Add a periodic-review-agent periodic job (cron: @Yearly, triggered
  only via gangway) that runs the full hypershift-review-agent workflow
- Add a lightweight hypershift-review-agent-trigger step that:
  1. Triggers the periodic job via gangway API with the PR number
  2. Posts a comment on the PR with a link to the triggered job
- Update all presubmit configs (openshift + openshift-priv) to use
  the trigger workflow instead of running the agent inline

The gangway token is read from the hypershift-team-claude-prow secret.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: remove hardcoded PR default from process step

The REVIEW_AGENT_TARGET_PR env var should not have a hardcoded default.
The periodic job receives the PR number from gangway via
MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR, and the process
script already fails fast if no PR number is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: follow jira-agent pattern for gangway param override

Declare MULTISTAGE_PARAM_OVERRIDE_REVIEW_AGENT_TARGET_PR in the ref
YAML and apply it in the script, matching the jira-agent pattern for
gangway API overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* review-agent: fix shellcheck warning and add registry metadata

- Suppress SC2034 for JOB_STATUS (used for debugging)
- Add generated metadata files for trigger ref and workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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.

4 participants