Skip to content

[WIP] refactor(ci): remove hardcoded job map and update version matrices in multi-version trigger#77844

Open
mgencur wants to merge 3 commits intoopenshift:mainfrom
mgencur:fix_mce_compatibility_test_trigger
Open

[WIP] refactor(ci): remove hardcoded job map and update version matrices in multi-version trigger#77844
mgencur wants to merge 3 commits intoopenshift:mainfrom
mgencur:fix_mce_compatibility_test_trigger

Conversation

@mgencur
Copy link
Copy Markdown
Contributor

@mgencur mgencur commented Apr 15, 2026

Dynamically construct job names from guest version. Update hub/MCE/guest
version maps to current releases (4.16-4.22). Extract config into env vars.

Summary by CodeRabbit

  • Chores
    • Added runtime-configurable defaults for shared/artifact paths, platform, job parallelism, and job duration.
    • Parameterized authentication and API endpoint to read bearer tokens and use a configurable Gangway endpoint.
    • Replaced static job mappings with computed job-name construction per guest/version and updated job output to reflect computed names.
    • Simplified version-compatibility mappings and made guest-version iteration dynamic for multi-version testing.

@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 Apr 15, 2026
@openshift-ci openshift-ci bot requested review from jparrill and sjenning April 15, 2026 14:00
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Replace static job mappings with computed AWS job names per guest version, simplify multi-version maps to single-entry mappings, expose runtime/config variables (dirs, batching, token path, Gangway API), and update Gangway trigger/polling to read the bearer token from a configurable path.

Changes

Cohort / File(s) Summary
Hypershift MCE trigger script
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh
Removed exported associative guest_to_job_aws; compute AWS job_name as periodic-ci-openshift-hypershift-release-${guest_version}-periodics-mce-e2e-aws-critical. Replaced multi-entry mce_to_guest/hub_to_mce with single-entry mappings (mce_to_guest[2.17]=4.22, hub_to_mce[4.22]=2.17) and derive guest list dynamically. Added exported variables: SHARED_DIR (default /tmp/shared_dir), ARTIFACT_DIR (default /tmp/artifacts), HOSTEDCLUSTER_PLATFORM (default aws), JOB_PARALLEL (default 5), JOB_DURATION (default 2.5h). Added top-level TOKEN_PATH (default /etc/mce-prow-gangway-credentials/token) and GANGWAY_API (default https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com). Gangway POST/GET now read bearer token from $(cat "${TOKEN_PATH}"); removed local GANGWAY_API override in check_jobs. Updated outputs to use ${SHARED_DIR}/${ARTIFACT_DIR}.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: refactoring to remove hardcoded job maps and updating version matrices in the multi-version trigger script.
Stable And Deterministic Test Names ✅ Passed This PR modifies only a shell script for CI job triggering, not Ginkgo test definitions. The custom check concerns Ginkgo test name stability, which is not applicable to bash script changes.
Test Structure And Quality ✅ Passed The custom check targets Ginkgo test code, which is not applicable to this PR as it modifies only a bash shell script, not Go test code.
Microshift Test Compatibility ✅ Passed PR modifies only shell scripts for CI/CD pipeline configuration and does not introduce any Ginkgo e2e tests in Go code, making the MicroShift test compatibility check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Pull request modifies CI job orchestration shell script, not Ginkgo e2e tests. No new Ginkgo e2e test constructs added, so check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies a CI test orchestration shell script, not Kubernetes deployment manifests or operator code containing scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The custom check for OTE Binary Stdout Contract is not applicable to this PR because the modified file is a bash shell script, not a Go test binary.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies CI infrastructure bash script without adding new Ginkgo e2e tests, so custom check for test compatibility is not applicable.

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

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

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mgencur
Once this PR has been reviewed and has the lgtm label, please assign rokej 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

@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Apr 15, 2026

/pj-rehearse periodic-ci-openshift-hypershift-main-mce-multi-version-aws

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

42-42: ⚠️ Potential issue | 🟠 Major

Local GANGWAY_API shadows the global variable, causing inconsistent behavior.

The local declaration here shadows the global GANGWAY_API defined on line 15. This means:

  • trigger_prow_job() always uses the hardcoded URL
  • check_jobs() (line 88) uses the configurable global variable

If GANGWAY_API is overridden via environment, jobs will be triggered against the hardcoded endpoint but status will be checked against the override—potentially different endpoints.

🔧 Proposed fix: Remove the local declaration
 function trigger_prow_job() {
-    local GANGWAY_API='https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com'
-
     local _job_name="$1"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
at line 42, The GANGWAY_API variable is being shadowed by a local declaration
which causes trigger_prow_job() to use the hardcoded URL while check_jobs() uses
the global/overridden value; remove the local declaration "local
GANGWAY_API='https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com'" so both
trigger_prow_job() and check_jobs() reference the same global GANGWAY_API (or
alternatively rename the local to a different identifier if a distinct value is
required), ensuring environment overrides take effect consistently.
🧹 Nitpick comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

180-182: Misleading comment: JOB_DURATION is not in seconds.

The comment says "sleeping for ${JOB_DURATION} seconds" but JOB_DURATION defaults to "2.5h" (hours). While sleep handles duration suffixes correctly, the comment is confusing.

📝 Suggested fix
             if ((job_count > JOB_PARALLEL)); then
-                echo "Reached $JOB_PARALLEL jobs, sleeping for ${JOB_DURATION} seconds..."
+                echo "Reached $JOB_PARALLEL jobs, sleeping for ${JOB_DURATION}..."
                 sleep "${JOB_DURATION}"

Apply the same fix to line 190.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 180 - 182, The log message incorrectly states seconds while
JOB_DURATION can include duration suffixes (e.g., "2.5h"); update the two echo
lines that reference JOB_DURATION (the one inside the if guarding job_count >
JOB_PARALLEL and the similar echo at the other occurrence around line 190) to
remove "seconds" and instead print the raw ${JOB_DURATION} (e.g., "sleeping for
${JOB_DURATION}...") so the message accurately reflects the value used by sleep.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Line 42: The GANGWAY_API variable is being shadowed by a local declaration
which causes trigger_prow_job() to use the hardcoded URL while check_jobs() uses
the global/overridden value; remove the local declaration "local
GANGWAY_API='https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com'" so both
trigger_prow_job() and check_jobs() reference the same global GANGWAY_API (or
alternatively rename the local to a different identifier if a distinct value is
required), ensuring environment overrides take effect consistently.

---

Nitpick comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 180-182: The log message incorrectly states seconds while
JOB_DURATION can include duration suffixes (e.g., "2.5h"); update the two echo
lines that reference JOB_DURATION (the one inside the if guarding job_count >
JOB_PARALLEL and the similar echo at the other occurrence around line 190) to
remove "seconds" and instead print the raw ${JOB_DURATION} (e.g., "sleeping for
${JOB_DURATION}...") so the message accurately reflects the value used by sleep.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 937dd3ea-c00a-41ac-ab52-e677ac549254

📥 Commits

Reviewing files that changed from the base of the PR and between 67862bf and 5ccb5d3.

📒 Files selected for processing (1)
  • ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh

@mgencur mgencur force-pushed the fix_mce_compatibility_test_trigger branch from 5ccb5d3 to 1817578 Compare April 15, 2026 15:05
@mgencur mgencur changed the title [WIP] Fix mce compatibility test trigger [WIP] refactor(ci): remove hardcoded job map and update version matrices in multi-version trigger Apr 15, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

167-185: ⚠️ Potential issue | 🟠 Major

Fail fast for unsupported platforms before reading $result.

The script has set -o nounset (line 3), which will cause it to exit when accessing undefined variables. Only the aws branch (line 175) assigns result, but line 184 unconditionally reads it. With any platform other than aws, the script will crash with an unbound variable error.

Add result="" at the start of the loop and use continue to skip further processing for unsupported platforms, or validate the platform earlier:

Proposed fix
         for guest_version in $guest_versions; do
+            result=""
             case $HOSTEDCLUSTER_PLATFORM in
                 aws)
                     job_name="periodic-ci-openshift-hypershift-release-${guest_version}-periodics-mce-e2e-aws-critical"
                     post_data=$(jq -n --arg mce_version "$mce_version" \
                         --arg release_image "${payload_list[$hub_version]}" \
                         '{job_execution_type: "1", pod_spec_options: {envs: {MULTISTAGE_PARAM_OVERRIDE_MCE_VERSION: $mce_version, RELEASE_IMAGE_LATEST: $release_image, MULTISTAGE_PARAM_OVERRIDE_TEST_EXTRACT: "true"}}}')
                     result=$(trigger_prow_job "$job_name" "$post_data")
                     ;;
                 agent)
-                    `#todo`
+                    echo "HOSTEDCLUSTER_PLATFORM=agent is not implemented yet" >&2
+                    continue
                     ;;
                 *)
-                    echo "not support ${HOSTEDCLUSTER_PLATFORM}"
+                    echo "unsupported HOSTEDCLUSTER_PLATFORM=${HOSTEDCLUSTER_PLATFORM}" >&2
+                    continue
                     ;;
             esac
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 167 - 185, The loop over guest_versions reads $result
unconditionally but only the aws branch assigns it, causing an unbound-variable
error under set -o nounset; fix by initializing result="" (and job_name="") at
the top of the loop (inside the for loop) and ensure unsupported branches (the
agent and *) either set result="" or use continue after echo so the code does
not proceed to read $result and compute job_id; update the case for agent to set
result="" (or perform its trigger) or add a continue in that branch and keep the
job_id/job_list append only for branches that actually trigger a job.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 14-15: The script currently defines GANGWAY_API but then hardcodes
a different Gangway URL inside the trigger_prow_job function, causing POST and
check_jobs to hit different endpoints; edit trigger_prow_job to remove the
hardcoded URL and use the GANGWAY_API variable consistently for the POST
endpoint (and any subsequent calls within trigger_prow_job), ensuring check_jobs
and trigger_prow_job both use the same GANGWAY_API value.
- Around line 25-27: The script currently assumes mce_to_guest contains entries
for every hub_to_mce mapping (variables: hub_to_mce, mce_to_guest and index
mce_version), but mce_to_guest lacks keys for the MCE versions produced (e.g.,
"2.6","2.7") so the strict set -o nounset causes an unbound variable error when
expanding ${mce_to_guest[$mce_version]}; fix by guarding the lookup—before using
${mce_to_guest[$mce_version]} check its existence with a safe test like if [ -n
"${mce_to_guest[$mce_version]:-}" ] or use the parameter-expansion existence
test ${mce_to_guest[$mce_version]+x} and continue/skip the iteration when
missing so unsupported version pairs are skipped rather than causing the script
to exit.

---

Outside diff comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 167-185: The loop over guest_versions reads $result
unconditionally but only the aws branch assigns it, causing an unbound-variable
error under set -o nounset; fix by initializing result="" (and job_name="") at
the top of the loop (inside the for loop) and ensure unsupported branches (the
agent and *) either set result="" or use continue after echo so the code does
not proceed to read $result and compute job_id; update the case for agent to set
result="" (or perform its trigger) or add a continue in that branch and keep the
job_id/job_list append only for branches that actually trigger a job.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f017b74d-5f11-4a0f-a77a-0e82f007814e

📥 Commits

Reviewing files that changed from the base of the PR and between 5ccb5d3 and 1817578.

📒 Files selected for processing (1)
  • ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh

… multi-version trigger

Dynamically construct job names from guest version. Update hub/MCE/guest
version maps to current releases (4.16-4.22). Extract config into env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mgencur mgencur force-pushed the fix_mce_compatibility_test_trigger branch from 1817578 to 9f52aaa Compare April 15, 2026 15:29
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (2)

182-184: ⚠️ Potential issue | 🟡 Minor

Misleading log message: JOB_DURATION is in hours, not seconds.

JOB_DURATION defaults to "2.5h", but the echo message says "sleeping for ${JOB_DURATION} seconds". The same issue exists on line 192.

Proposed fix
         if ((job_count > JOB_PARALLEL)); then
-            echo "Reached $JOB_PARALLEL jobs, sleeping for ${JOB_DURATION} seconds..."
+            echo "Reached $JOB_PARALLEL jobs, sleeping for ${JOB_DURATION}..."
             sleep "${JOB_DURATION}"
             job_count=1
         fi

And for line 192:

 if ((job_count > 1)); then
-    echo "Final batch, sleeping for ${JOB_DURATION} seconds..."
+    echo "Final batch, sleeping for ${JOB_DURATION}..."
     sleep "${JOB_DURATION}"
 fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 182 - 184, The log message incorrectly states seconds while
JOB_DURATION is an hours string (e.g., "2.5h"); update the echo lines that
reference JOB_DURATION (the block using job_count, JOB_PARALLEL and
JOB_DURATION) to reflect the correct unit (hours) or convert JOB_DURATION to
seconds before printing; fix both occurrences (the sleep/echo block that checks
if ((job_count > JOB_PARALLEL)) and the similar echo at line ~192) so the
message accurately shows the duration unit or the converted value.

160-178: ⚠️ Potential issue | 🟠 Major

Unset result variable will cause script failure for non-AWS platforms.

With set -o nounset (line 3), if HOSTEDCLUSTER_PLATFORM is agent or an unsupported value, result is never assigned but is referenced on line 177. This will trigger an "unbound variable" error and abort the script.

Proposed fix
         guest_versions="${mce_to_guest[$mce_version]}"
-        job_name=""
+        job_name=""
+        result=""
         for guest_version in $guest_versions; do
             case $HOSTEDCLUSTER_PLATFORM in
                 aws)
                     job_name="periodic-ci-openshift-hypershift-release-${guest_version}-periodics-mce-e2e-aws-critical"
                     post_data=$(jq -n --arg mce_version "$mce_version" \
                         --arg release_image "${payload_list[$hub_version]}" \
                         '{job_execution_type: "1", pod_spec_options: {envs: {MULTISTAGE_PARAM_OVERRIDE_MCE_VERSION: $mce_version, RELEASE_IMAGE_LATEST: $release_image, MULTISTAGE_PARAM_OVERRIDE_TEST_EXTRACT: "true"}}}')
                     result=$(trigger_prow_job "$job_name" "$post_data")
                     ;;
                 agent)
-                    `#todo`
+                    job_name="agent-platform-job-placeholder"
+                    echo "Agent platform not yet implemented, skipping"
+                    continue
                     ;;
                 *)
                     echo "not support ${HOSTEDCLUSTER_PLATFORM}"
+                    continue
                     ;;
             esac
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 160 - 178, The script fails with nounset because result is only
assigned in the aws case; initialize or set a safe default for result before the
case (e.g., result="") or ensure all case branches (agent and *) assign result
(for example an empty JSON or an error message) so the later job_id extraction
(job_id=$(echo "$result" | grep "JOB_ID###" ...)) cannot reference an unbound
variable; update the loop around guest_versions where result and job_name are
set to guarantee result is always defined regardless of HOSTEDCLUSTER_PLATFORM.
♻️ Duplicate comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

43-48: ⚠️ Potential issue | 🟠 Major

Remove the hardcoded GANGWAY_API override to use the configurable global value.

Line 44 declares a local GANGWAY_API that shadows the global configurable variable from Line 15. This causes trigger_prow_job and check_jobs to potentially use different API endpoints when GANGWAY_API is overridden externally.

Proposed fix
 function trigger_prow_job() {
-    local GANGWAY_API='https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com'
-
     local _job_name="$1"
     local _http_post_data="$2"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 43 - 48, The function trigger_prow_job currently shadows the global
GANGWAY_API by declaring a local GANGWAY_API; remove that local declaration so
trigger_prow_job uses the globally configurable GANGWAY_API (consistent with
check_jobs) — locate the trigger_prow_job function and delete the line "local
GANGWAY_API='...'" (or stop redeclaring GANGWAY_API as local) so the global
variable is used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 182-184: The log message incorrectly states seconds while
JOB_DURATION is an hours string (e.g., "2.5h"); update the echo lines that
reference JOB_DURATION (the block using job_count, JOB_PARALLEL and
JOB_DURATION) to reflect the correct unit (hours) or convert JOB_DURATION to
seconds before printing; fix both occurrences (the sleep/echo block that checks
if ((job_count > JOB_PARALLEL)) and the similar echo at line ~192) so the
message accurately shows the duration unit or the converted value.
- Around line 160-178: The script fails with nounset because result is only
assigned in the aws case; initialize or set a safe default for result before the
case (e.g., result="") or ensure all case branches (agent and *) assign result
(for example an empty JSON or an error message) so the later job_id extraction
(job_id=$(echo "$result" | grep "JOB_ID###" ...)) cannot reference an unbound
variable; update the loop around guest_versions where result and job_name are
set to guarantee result is always defined regardless of HOSTEDCLUSTER_PLATFORM.

---

Duplicate comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 43-48: The function trigger_prow_job currently shadows the global
GANGWAY_API by declaring a local GANGWAY_API; remove that local declaration so
trigger_prow_job uses the globally configurable GANGWAY_API (consistent with
check_jobs) — locate the trigger_prow_job function and delete the line "local
GANGWAY_API='...'" (or stop redeclaring GANGWAY_API as local) so the global
variable is used.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a350ed8c-ac9e-45c7-bda9-e1d2c7134d30

📥 Commits

Reviewing files that changed from the base of the PR and between 9f52aaa and e245f16.

📒 Files selected for processing (1)
  • ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh

@mgencur
Copy link
Copy Markdown
Contributor Author

mgencur commented Apr 15, 2026

/pj-rehearse periodic-ci-openshift-hypershift-main-mce-multi-version-aws

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@mgencur: 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]
@mgencur: 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-hypershift-main-mce-multi-version-aws 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

161-179: ⚠️ Potential issue | 🟠 Major

Guard $result for non-AWS branches to prevent nounset abort.

In agent/unsupported branches, result is never assigned, but Line 178 always expands $result. With set -o nounset, this exits the script.

Proposed fix
     for mce_version in $mce_versions; do
         guest_versions="${mce_to_guest[$mce_version]}"
         job_name=""
+        result=""
         for guest_version in $guest_versions; do
             case $HOSTEDCLUSTER_PLATFORM in
                 aws)
                     job_name="periodic-ci-openshift-hypershift-release-${guest_version}-periodics-mce-e2e-aws-critical"
                     post_data=$(jq -n --arg mce_version "$mce_version" \
                         --arg release_image "${payload_list[$hub_version]}" \
                         '{job_execution_type: "1", pod_spec_options: {envs: {MULTISTAGE_PARAM_OVERRIDE_MCE_VERSION: $mce_version, RELEASE_IMAGE_LATEST: $release_image, MULTISTAGE_PARAM_OVERRIDE_TEST_EXTRACT: "true"}}}')
                     result=$(trigger_prow_job "$job_name" "$post_data")
                     ;;
                 agent)
-                    `#todo`
+                    echo "Platform ${HOSTEDCLUSTER_PLATFORM} is not implemented yet; skipping."
+                    continue
                     ;;
                 *)
-                    echo "not support ${HOSTEDCLUSTER_PLATFORM}"
+                    echo "not support ${HOSTEDCLUSTER_PLATFORM}, skipping"
+                    continue
                     ;;
             esac
             job_id=$(echo "$result" | grep "JOB_ID###" | cut -d'#' -f4 || true)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 161 - 179, The loop assumes $result is set after the case but in
non-AWS branches (case patterns "agent" or default) it isn’t, causing nounset
failures when expanding result; ensure result is always defined before using it
by either setting a default (e.g. empty) at the top of the loop or by moving the
job_id extraction/echo that references result inside the aws branch (the block
that calls trigger_prow_job and sets job_name). Update references to result,
job_name, HOSTEDCLUSTER_PLATFORM and trigger_prow_job accordingly so job_id is
only parsed when trigger_prow_job was invoked or result has been initialized.
♻️ Duplicate comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

14-15: ⚠️ Potential issue | 🟠 Major

Remove local GANGWAY_API shadowing so overrides work consistently.

Line 45 re-hardcodes GANGWAY_API, which bypasses the configurable value from Line 15. Trigger and polling can hit different endpoints when overridden.

Proposed fix
 function trigger_prow_job() {
-    local GANGWAY_API='https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com'
-
     local _job_name="$1"
     local _http_post_data="$2"

Also applies to: 45-45

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 14 - 15, The GANGWAY_API default is being redefined later which
shadows any overrides; remove the second hardcoded assignment so the script uses
the initial default/overridden GANGWAY_API (referenced as GANGWAY_API and
${GANGWAY_API:-...}) everywhere (including the trigger and polling code paths)
and ensure any uses reference the single variable instead of assigning a new
value; if needed, replace the later assignment with a simple reference to
GANGWAY_API or parameter expansion to preserve external overrides.
🧹 Nitpick comments (1)
ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh (1)

8-13: Create fallback directories when using default paths.

When running outside ci-operator, default /tmp/shared_dir and /tmp/artifacts may not exist, causing later writes to fail.

Proposed fix
 export SHARED_DIR=${SHARED_DIR:-/tmp/shared_dir}
 export ARTIFACT_DIR=${ARTIFACT_DIR:-/tmp/artifacts}
 export HOSTEDCLUSTER_PLATFORM=${HOSTEDCLUSTER_PLATFORM:-"aws"}
 export JOB_PARALLEL=${JOB_PARALLEL:-"5"}
 export JOB_DURATION=${JOB_DURATION:-"2.5h"}
+
+mkdir -p "${SHARED_DIR}" "${ARTIFACT_DIR}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 8 - 13, The script sets SHARED_DIR and ARTIFACT_DIR defaults but
doesn't ensure those paths exist; after the exports for SHARED_DIR and
ARTIFACT_DIR, add directory creation using mkdir -p "$SHARED_DIR"
"$ARTIFACT_DIR" and check the command's exit status (or use set -e) so writes
won't fail later; if mkdir fails, print a short error message and exit non‑zero
to fail fast.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 17-25: The matrices mce_to_guest and hub_to_mce currently contain
only a single mapping, which disables multi-version coverage; update the
declarations for mce_to_guest and hub_to_mce to include the full set of versions
(e.g., map each MCE key to the latest three HostedCluster guest versions in
mce_to_guest and map each hub version to the MCE and two older MCE versions in
hub_to_mce) so the script iterates over multiple hub/MCE/guest combinations;
locate the arrays named mce_to_guest and hub_to_mce and expand their entries to
the intended multi-version lists.

---

Outside diff comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 161-179: The loop assumes $result is set after the case but in
non-AWS branches (case patterns "agent" or default) it isn’t, causing nounset
failures when expanding result; ensure result is always defined before using it
by either setting a default (e.g. empty) at the top of the loop or by moving the
job_id extraction/echo that references result inside the aws branch (the block
that calls trigger_prow_job and sets job_name). Update references to result,
job_name, HOSTEDCLUSTER_PLATFORM and trigger_prow_job accordingly so job_id is
only parsed when trigger_prow_job was invoked or result has been initialized.

---

Duplicate comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 14-15: The GANGWAY_API default is being redefined later which
shadows any overrides; remove the second hardcoded assignment so the script uses
the initial default/overridden GANGWAY_API (referenced as GANGWAY_API and
${GANGWAY_API:-...}) everywhere (including the trigger and polling code paths)
and ensure any uses reference the single variable instead of assigning a new
value; if needed, replace the later assignment with a simple reference to
GANGWAY_API or parameter expansion to preserve external overrides.

---

Nitpick comments:
In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`:
- Around line 8-13: The script sets SHARED_DIR and ARTIFACT_DIR defaults but
doesn't ensure those paths exist; after the exports for SHARED_DIR and
ARTIFACT_DIR, add directory creation using mkdir -p "$SHARED_DIR"
"$ARTIFACT_DIR" and check the command's exit status (or use set -e) so writes
won't fail later; if mkdir fails, print a short error message and exit non‑zero
to fail fast.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 67c35192-0aa7-46fc-bd23-5534eec6999f

📥 Commits

Reviewing files that changed from the base of the PR and between e245f16 and 8332ab9.

📒 Files selected for processing (1)
  • ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh

Comment on lines +17 to 25
# Each MCE supports the latest three HostedCluster versions
declare -A mce_to_guest=(
[2.4]="4.14"
[2.5]="4.14 4.15"
[2.6]="4.14 4.15 4.16"
[2.7]="4.14 4.15 4.16 4.17"
[2.8]="4.14 4.15 4.16 4.17 4.18"
[2.9]="4.15 4.16 4.17 4.18 4.19"
[2.17]="4.22"
)

# Each MCE is available on the latest hub version and two versions back
declare -A hub_to_mce=(
[4.14]="2.4 2.5 2.6"
[4.15]="2.5 2.6 2.7"
[4.16]="2.6 2.7 2.8"
[4.17]="2.7 2.8 2.9"
[4.18]="2.8 2.9"
[4.19]="2.9"
[4.22]="2.17"
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

The “multi-version” matrices are currently single-version only.

Lines 19 and 24 reduce coverage to one hub/MCE/guest path (4.22/2.17/4.22). This effectively disables multi-version validation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@ci-operator/step-registry/hypershift/mce/multi-version-test/trigger-jobs/hypershift-mce-multi-version-test-trigger-jobs-commands.sh`
around lines 17 - 25, The matrices mce_to_guest and hub_to_mce currently contain
only a single mapping, which disables multi-version coverage; update the
declarations for mce_to_guest and hub_to_mce to include the full set of versions
(e.g., map each MCE key to the latest three HostedCluster guest versions in
mce_to_guest and map each hub version to the MCE and two older MCE versions in
hub_to_mce) so the script iterates over multiple hub/MCE/guest combinations;
locate the arrays named mce_to_guest and hub_to_mce and expand their entries to
the intended multi-version lists.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

@mgencur: 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/periodic-ci-openshift-hypershift-main-mce-multi-version-aws 8332ab9 link unknown /pj-rehearse periodic-ci-openshift-hypershift-main-mce-multi-version-aws

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

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