Skip to content

USHIFT-6718: major version changes for test framework#6372

Open
pacevedom wants to merge 7 commits intoopenshift:mainfrom
pacevedom:test-framework-5.0
Open

USHIFT-6718: major version changes for test framework#6372
pacevedom wants to merge 7 commits intoopenshift:mainfrom
pacevedom:test-framework-5.0

Conversation

@pacevedom
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: ac0b033e-20a4-4f0b-bc37-fd74be2b336e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Extract OpenShift major and minor from version sources and propagate them across scripts, templates, and tests; replace hardcoded 4.* repo names and openshift-v4 mirror paths with dynamic {major}.{minor} and openshift-v{major} forms; add cross‑major previous-version helpers and update call signatures/validations.

Changes

Cohort / File(s) Summary
Devenv & repo lookup scripts
scripts/devenv-builder/configure-vm.sh, scripts/get-latest-rhocp-repo.sh, scripts/auto-rebase/rebase_history.sh
Parse OCP major/minor from MAKE_VERSION/Makefile; construct rhocp-{major}.{minor} repo IDs and openshift-v{major} mirror URLs; clamp/backstop minor arithmetic and compute previous major/minor across major boundaries; update output/branch naming.
Release-notes tooling
scripts/release-notes/gen_gh_releases_from_mirror.py, scripts/release-notes/gen_gh_releases_from_rhocp.py, scripts/release-notes/common.py
Add get_mirror_url_base and get_previous_version/LAST_MINOR_FOR_MAJOR; make scanning and publish flows major-aware and compute previous versions across majors for repo lookups and generated links.
Version generation Python & helpers
test/bin/pyutils/generate_common_versions.py, test/bin/pyutils/build_bootc_images.py
Introduce VERSION_MAP and get_previous_version(major,minor); change many helpers to accept (major,minor); make candidate/subscription/microshift repo URLs and GitOps compatibility cross‑major; update CLI to accept --major.
Shell version templates & exports
test/assets/common_versions.sh.template, test/bin/common_versions.sh, test/bin/build_rpms.sh, test/bin/common.sh
Export MAJOR_VERSION, PREVIOUS_MAJOR_VERSION, YMINUS2_MAJOR_VERSION, and RHOCP_MAJOR_Y*; update Brew download arguments, branch names, Brew paths and repo coordinates to use ${MAJOR_VERSION}.${MINOR_VERSION}.
Kickstart, RPM post-install & image build
test/kickstart-templates/includes/post-cos9rpm.cfg, test/bin/scenario.sh, test/bin/build_images.sh
Split placeholders to OCPMAJOR/OCPMINOR, compute OCPVERSION="${OCPMAJOR}.${OCPMINOR}", use openshift-v${OCPMAJOR} baseurls, and make image/version globs major-aware.
Test package-sources templates
test/package-sources/rhocp-y.toml, test/package-sources/rhocp-y1.toml, test/package-sources/rhocp-y2.toml
Template name and CDN url updated to use {{ .Env.RHOCP_MAJOR_Y* }}.{{ .Env.RHOCP_MINOR_Y* }} and /rhocp/<major>.<minor>/os paths.
Test scenarios & helpers
test/scenarios/* (presubmits, releases, periodics, many .disabled files), test/scenarios/releases/*, test/scenarios/periodics/*
Change configure_rhocp_repo() signature to accept major and minor; broaden numeric regex to 1–2 digits; update repo id/name generation and all call sites to pass major+minor pairs; update many start_image/prepare_kickstart invocations to use previous/Y‑2 major vars.
Release packaging & CI scripts
scripts/get-latest-rhocp-repo.sh, test packaging helpers (test/bin/build_rpms.sh, package-sources)
Adjust beta mirror URL, Brew args, and packaging lookups to use computed major-aware paths and version coordinates.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

✨ 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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 18, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@pacevedom
Copy link
Copy Markdown
Contributor Author

/test ?

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2026
@pacevedom
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests

@pacevedom
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests
/test e2e-aws-tests-bootc

@pacevedom
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-testes

@pacevedom
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests
/test e2e-aws-tests-arm

@pacevedom pacevedom changed the title WIP major version changes for test framework USHIFT-6718: major version changes for test framework Mar 20, 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 Mar 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 20, 2026

@pacevedom: This pull request references USHIFT-6718 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

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.

@pacevedom
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/devenv-builder/configure-vm.sh`:
- Around line 279-282: The OCP_MAJOR/OCP_MINOR extraction is using cut on the
file path ${MAKE_VERSION} instead of the value read from the file; change it to
follow the pattern used at line 197 by first extracting MAKE_VERSION from the
file using grep + cut -d'=' -f2 (trimming whitespace), then parse that value
with cut -d'.' -f1 and -f2 to set OCP_MAJOR and OCP_MINOR, set
OCPVERSION="${OCP_MAJOR}.${OCP_MINOR}", and keep OCC_SRC construction the same;
update the variable names (MAKE_VERSION, OCP_MAJOR, OCP_MINOR, OCPVERSION,
OCC_SRC) where they are assigned so you parse the actual version string rather
than the file path.

In `@scripts/get-latest-rhocp-repo.sh`:
- Around line 47-48: The calculation of stop from current_minor can produce a
negative value which later generates invalid repo names; update the logic around
variables current_minor and stop so stop is clamped to a minimum of 0 before the
repo scan loop (the variable used in the for/seq loop around the lines that
iterate over minor versions). Locate the assignment to stop and replace it with
a safe clamp (e.g., set stop to 0 when current_minor - 3 is negative) so
subsequent checks that build repo URLs using current_minor and stop cannot
produce negative minors.

In `@scripts/release-notes/gen_gh_releases_from_mirror.py`:
- Around line 172-182: The code hardcodes url_base_aarch64 and url_base_x86
using the current branch major and then scans all versions with those bases,
which breaks when versions_to_scan contains a different major; update the calls
to find_new_releases so the mirror URL base is computed per version: for each
version in versions_to_scan determine its major (e.g., parse version -> major)
and call get_mirror_url_base(major_for_version, 'aarch64') and
get_mirror_url_base(major_for_version, 'x86_64') and then pass those per-version
url bases into find_new_releases (when invoking from the blocks that use args.ec
and args.rc) so each scanned version queries the correct openshift-v{major}
tree.

In `@test/bin/pyutils/generate_common_versions.py`:
- Around line 284-287: get_gitops_version() currently assumes compatibility with
major 4 and only decrements the minor, which breaks when
generate_common_versions() computes cross-major Y-1/Y-2 (e.g., --major 5 --minor
0). Update get_gitops_version() to be major-aware: accept or derive both major
and minor, and when probing fallback versions iterate using
get_previous_version(major, minor) (or the same logic used in
generate_common_versions) to step to previous minor/major pairs instead of just
decrementing minor; ensure the same change is applied for the other lookup block
referenced around lines 335-337 so all GITOPS_VERSION lookups use the
cross-major-aware fallback sequence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f0660fe4-2926-4a4e-aede-d055b2097a60

📥 Commits

Reviewing files that changed from the base of the PR and between 8a16d85 and 3c69948.

📒 Files selected for processing (19)
  • scripts/devenv-builder/configure-vm.sh
  • scripts/get-latest-rhocp-repo.sh
  • scripts/release-notes/gen_gh_releases_from_mirror.py
  • scripts/release-notes/gen_gh_releases_from_rhocp.py
  • test/assets/common_versions.sh.template
  • test/bin/build_rpms.sh
  • test/bin/common.sh
  • test/bin/common_versions.sh
  • test/bin/pyutils/build_bootc_images.py
  • test/bin/pyutils/generate_common_versions.py
  • test/bin/scenario.sh
  • test/kickstart-templates/includes/post-cos9rpm.cfg
  • test/package-sources/rhocp-y.toml
  • test/package-sources/rhocp-y1.toml
  • test/package-sources/rhocp-y2.toml
  • test/scenarios/presubmits/el98-src@rpm-install.sh.disabled
  • test/scenarios/releases/el98@rpm-standard1.sh.disabled
  • test/scenarios/releases/el98@rpm-standard2.sh.disabled
  • test/scenarios/releases/el98@rpm-upgrade.sh.disabled

@pacevedom pacevedom force-pushed the test-framework-5.0 branch from 3c69948 to c6a53ad Compare March 20, 2026 13:00
@pacevedom
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

♻️ Duplicate comments (1)
test/bin/pyutils/generate_common_versions.py (1)

275-285: ⚠️ Potential issue | 🟡 Minor

Add try/except for get_previous_version in gitops lookup.

If the loop iterates close to a major boundary (e.g., starting at 4.1), line 284 will raise KeyError when reaching 4.0's previous version.

Proposed fix
     for _ in range(4):
         for gitops_version_from_api_docs in data.get("data", [{}])[0].get("versions", []):
             gitops_version_ocp_compatibility = gitops_version_from_api_docs.get("openshift_compatibility") or ""
             gitops_version_number = gitops_version_from_api_docs.get("name")
             if f"{current_major}.{current_minor}" in gitops_version_ocp_compatibility:
                 logging.info(f"Latest GitOps version: {gitops_version_number} which is compatible with OCP {gitops_version_ocp_compatibility}")
                 return gitops_version_number
-        current_major, current_minor = get_previous_version(current_major, current_minor)
+        try:
+            current_major, current_minor = get_previous_version(current_major, current_minor)
+        except KeyError:
+            break
     return ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/bin/pyutils/generate_common_versions.py` around lines 275 - 285, The
loop that walks previous versions calls get_previous_version(current_major,
current_minor) without handling KeyError; wrap that call in a try/except
KeyError around the invocation in the loop in generate_common_versions.py, log
or handle the error (e.g., logging.warning and break or return an empty string)
and stop iterating when a KeyError occurs so the function returns "" instead of
raising; ensure you keep the existing behavior of returning
gitops_version_number when found and returning "" on failure.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@test/bin/pyutils/generate_common_versions.py`:
- Around line 275-285: The loop that walks previous versions calls
get_previous_version(current_major, current_minor) without handling KeyError;
wrap that call in a try/except KeyError around the invocation in the loop in
generate_common_versions.py, log or handle the error (e.g., logging.warning and
break or return an empty string) and stop iterating when a KeyError occurs so
the function returns "" instead of raising; ensure you keep the existing
behavior of returning gitops_version_number when found and returning "" on
failure.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: acadad9a-5a8a-46d3-b64b-fc8a9cf12de9

📥 Commits

Reviewing files that changed from the base of the PR and between 3c69948 and c6a53ad.

📒 Files selected for processing (19)
  • scripts/devenv-builder/configure-vm.sh
  • scripts/get-latest-rhocp-repo.sh
  • scripts/release-notes/gen_gh_releases_from_mirror.py
  • scripts/release-notes/gen_gh_releases_from_rhocp.py
  • test/assets/common_versions.sh.template
  • test/bin/build_rpms.sh
  • test/bin/common.sh
  • test/bin/common_versions.sh
  • test/bin/pyutils/build_bootc_images.py
  • test/bin/pyutils/generate_common_versions.py
  • test/bin/scenario.sh
  • test/kickstart-templates/includes/post-cos9rpm.cfg
  • test/package-sources/rhocp-y.toml
  • test/package-sources/rhocp-y1.toml
  • test/package-sources/rhocp-y2.toml
  • test/scenarios/presubmits/el98-src@rpm-install.sh.disabled
  • test/scenarios/releases/el98@rpm-standard1.sh.disabled
  • test/scenarios/releases/el98@rpm-standard2.sh.disabled
  • test/scenarios/releases/el98@rpm-upgrade.sh.disabled
✅ Files skipped from review due to trivial changes (4)
  • test/bin/common.sh
  • test/bin/build_rpms.sh
  • test/package-sources/rhocp-y2.toml
  • test/package-sources/rhocp-y1.toml
🚧 Files skipped from review as they are similar to previous changes (8)

@pacevedom
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-tests
/test e2e-aws-tests-arm
/test e2e-aws-tests-bootc-el9
/test e2e-aws-tests-bootc-arm-el9

@pacevedom pacevedom marked this pull request as ready for review March 23, 2026 12:55
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2026
@openshift-ci openshift-ci bot requested review from jogeo and vanhalenar March 23, 2026 12:56
@pacevedom
Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2026
@pacevedom pacevedom force-pushed the test-framework-5.0 branch from c6a53ad to 2db639e Compare March 23, 2026 13: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.

♻️ Duplicate comments (1)
test/bin/pyutils/generate_common_versions.py (1)

275-285: ⚠️ Potential issue | 🟠 Major

Unhandled KeyError can crash the script.

get_previous_version() raises KeyError when stepping past defined majors, but this call (line 284) isn't wrapped in try/except like get_dependencies_repo_url (lines 113-116). If the loop exhausts VERSION_MAP, the script crashes.

Proposed fix
     current_major, current_minor = major_version, minor_version
     for _ in range(4):
         for gitops_version_from_api_docs in data.get("data", [{}])[0].get("versions", []):
             gitops_version_ocp_compatibility = gitops_version_from_api_docs.get("openshift_compatibility") or ""
             gitops_version_number = gitops_version_from_api_docs.get("name")
             if f"{current_major}.{current_minor}" in gitops_version_ocp_compatibility:
                 logging.info(f"Latest GitOps version: {gitops_version_number} which is compatible with OCP {gitops_version_ocp_compatibility}")
                 return gitops_version_number
-        current_major, current_minor = get_previous_version(current_major, current_minor)
+        try:
+            current_major, current_minor = get_previous_version(current_major, current_minor)
+        except KeyError:
+            break
     return ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/bin/pyutils/generate_common_versions.py` around lines 275 - 285, The
loop in the version-selection logic can crash because
get_previous_version(current_major, current_minor) may raise KeyError when
versions are exhausted; wrap that call in a try/except KeyError inside the
for-loop (the block using current_major/current_minor and
gitops_version_from_api_docs) and on KeyError break out (or return an empty
string) so the function safely falls through to the final return ""; ensure you
update references to current_major/current_minor only when the call succeeds and
preserve existing logging/return behavior for gitops_version_number.
🧹 Nitpick comments (1)
test/scenarios/presubmits/el98-src@rpm-install.sh.disabled (1)

44-72: Extract configure_rhocp_repo() into a shared helper.

This exact repo-setup logic now lives here and in test/scenarios/releases/el98@rpm-standard1.sh.disabled and test/scenarios/releases/el98@rpm-standard2.sh.disabled. The next repo-format change will be easy to miss in one copy again.

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

In `@test/scenarios/presubmits/el98-src`@rpm-install.sh.disabled around lines 44 -
72, Extract the configure_rhocp_repo function into a shared helper script and
replace the duplicated copies with calls to that helper: move the
configure_rhocp_repo implementation (including use of run_command_on_vm,
copy_file_to_vm, mktemp/tmp_file handling, ocp_repo_name logic and the two
branches for numeric vs http rhocp values) into a common sourced file (e.g., a
shared test helper) and update each caller script to source that helper and
invoke configure_rhocp_repo with the same arguments; ensure the tmp file
creation and removal, quoting, and error behavior are preserved when refactoring
so existing behavior remains unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@test/bin/pyutils/generate_common_versions.py`:
- Around line 275-285: The loop in the version-selection logic can crash because
get_previous_version(current_major, current_minor) may raise KeyError when
versions are exhausted; wrap that call in a try/except KeyError inside the
for-loop (the block using current_major/current_minor and
gitops_version_from_api_docs) and on KeyError break out (or return an empty
string) so the function safely falls through to the final return ""; ensure you
update references to current_major/current_minor only when the call succeeds and
preserve existing logging/return behavior for gitops_version_number.

---

Nitpick comments:
In `@test/scenarios/presubmits/el98-src`@rpm-install.sh.disabled:
- Around line 44-72: Extract the configure_rhocp_repo function into a shared
helper script and replace the duplicated copies with calls to that helper: move
the configure_rhocp_repo implementation (including use of run_command_on_vm,
copy_file_to_vm, mktemp/tmp_file handling, ocp_repo_name logic and the two
branches for numeric vs http rhocp values) into a common sourced file (e.g., a
shared test helper) and update each caller script to source that helper and
invoke configure_rhocp_repo with the same arguments; ensure the tmp file
creation and removal, quoting, and error behavior are preserved when refactoring
so existing behavior remains unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: cfebe57e-2add-42e0-9763-426048363e77

📥 Commits

Reviewing files that changed from the base of the PR and between c6a53ad and 2db639e.

📒 Files selected for processing (19)
  • scripts/devenv-builder/configure-vm.sh
  • scripts/get-latest-rhocp-repo.sh
  • scripts/release-notes/gen_gh_releases_from_mirror.py
  • scripts/release-notes/gen_gh_releases_from_rhocp.py
  • test/assets/common_versions.sh.template
  • test/bin/build_rpms.sh
  • test/bin/common.sh
  • test/bin/common_versions.sh
  • test/bin/pyutils/build_bootc_images.py
  • test/bin/pyutils/generate_common_versions.py
  • test/bin/scenario.sh
  • test/kickstart-templates/includes/post-cos9rpm.cfg
  • test/package-sources/rhocp-y.toml
  • test/package-sources/rhocp-y1.toml
  • test/package-sources/rhocp-y2.toml
  • test/scenarios/presubmits/el98-src@rpm-install.sh.disabled
  • test/scenarios/releases/el98@rpm-standard1.sh.disabled
  • test/scenarios/releases/el98@rpm-standard2.sh.disabled
  • test/scenarios/releases/el98@rpm-upgrade.sh.disabled
✅ Files skipped from review due to trivial changes (5)
  • test/bin/scenario.sh
  • test/bin/common.sh
  • scripts/release-notes/gen_gh_releases_from_rhocp.py
  • test/package-sources/rhocp-y2.toml
  • test/package-sources/rhocp-y1.toml
🚧 Files skipped from review as they are similar to previous changes (4)
  • scripts/get-latest-rhocp-repo.sh
  • test/scenarios/releases/el98@rpm-upgrade.sh.disabled
  • test/package-sources/rhocp-y.toml
  • scripts/devenv-builder/configure-vm.sh

@pacevedom pacevedom force-pushed the test-framework-5.0 branch from 2db639e to b512924 Compare March 24, 2026 16:30
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

♻️ Duplicate comments (1)
test/bin/pyutils/generate_common_versions.py (1)

275-285: ⚠️ Potential issue | 🟠 Major

Unhandled KeyError in GitOps version lookup.

Line 284 calls get_previous_version() without try/except. If the version iteration crosses into an unmapped major, it will crash instead of returning empty string.

Suggested fix
         if f"{current_major}.{current_minor}" in gitops_version_ocp_compatibility:
             logging.info(f"Latest GitOps version: {gitops_version_number} which is compatible with OCP {gitops_version_ocp_compatibility}")
             return gitops_version_number
-        current_major, current_minor = get_previous_version(current_major, current_minor)
+        try:
+            current_major, current_minor = get_previous_version(current_major, current_minor)
+        except KeyError:
+            break
     return ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/bin/pyutils/generate_common_versions.py` around lines 275 - 285, The
loop in generate_common_versions.py can raise a KeyError when calling
get_previous_version(current_major, current_minor); update the logic in the
block using current_major/current_minor and get_previous_version to handle
missing mappings by wrapping the get_previous_version call in a try/except
KeyError (or check its return), and if a KeyError occurs return an empty string;
ensure you reference the existing variables current_major/current_minor, the
get_previous_version function, and the for-loop that iterates over
data.get("data", [{}])[0].get("versions", []) so the behavior gracefully returns
"" instead of crashing.
🧹 Nitpick comments (1)
scripts/release-notes/common.py (1)

71-75: Consolidate last-minor mapping to a single source of truth.

LAST_MINOR_FOR_MAJOR here duplicates version maps already defined in scripts/devenv-builder/configure-vm.sh and test/bin/pyutils/generate_common_versions.py. Drift between these files can silently produce inconsistent cross-major behavior across tools.

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

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

In `@scripts/release-notes/common.py` around lines 71 - 75, The
LAST_MINOR_FOR_MAJOR constant in scripts/release-notes/common.py duplicates
mappings maintained elsewhere and should be replaced with a single source of
truth; remove the hardcoded LAST_MINOR_FOR_MAJOR dict and load the mapping from
the canonical generator (e.g., import or read the mapping produced by
test/bin/pyutils/generate_common_versions.py or otherwise centralize on the
config used by scripts/devenv-builder/configure-vm.sh), updating code that
references LAST_MINOR_FOR_MAJOR to use the loaded mapping instead (refer to the
LAST_MINOR_FOR_MAJOR symbol in this file and the generate_common_versions.py
output to locate and wire the canonical source).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/devenv-builder/configure-vm.sh`:
- Around line 303-307: The grep pattern in OCC_RPM is hardcoded to
"openshift-clients-4..." and will fail for other majors; change the pattern to
interpolate OCP_MAJOR (e.g., match "openshift-clients-${OCP_MAJOR}...") when
extracting RPM names in the OCC_RPM assignment so it discovers the correct
major-specific RPMs; update the pattern used in the grep inside the OCC_RPM
pipeline (refer to variables OCP_MAJOR and OCC_RPM) to be dynamic and still
escape dots/quotes as appropriate.

---

Duplicate comments:
In `@test/bin/pyutils/generate_common_versions.py`:
- Around line 275-285: The loop in generate_common_versions.py can raise a
KeyError when calling get_previous_version(current_major, current_minor); update
the logic in the block using current_major/current_minor and
get_previous_version to handle missing mappings by wrapping the
get_previous_version call in a try/except KeyError (or check its return), and if
a KeyError occurs return an empty string; ensure you reference the existing
variables current_major/current_minor, the get_previous_version function, and
the for-loop that iterates over data.get("data", [{}])[0].get("versions", []) so
the behavior gracefully returns "" instead of crashing.

---

Nitpick comments:
In `@scripts/release-notes/common.py`:
- Around line 71-75: The LAST_MINOR_FOR_MAJOR constant in
scripts/release-notes/common.py duplicates mappings maintained elsewhere and
should be replaced with a single source of truth; remove the hardcoded
LAST_MINOR_FOR_MAJOR dict and load the mapping from the canonical generator
(e.g., import or read the mapping produced by
test/bin/pyutils/generate_common_versions.py or otherwise centralize on the
config used by scripts/devenv-builder/configure-vm.sh), updating code that
references LAST_MINOR_FOR_MAJOR to use the loaded mapping instead (refer to the
LAST_MINOR_FOR_MAJOR symbol in this file and the generate_common_versions.py
output to locate and wire the canonical source).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 6b913e08-3e31-49c6-9a83-dcb10b85998a

📥 Commits

Reviewing files that changed from the base of the PR and between 2db639e and b512924.

📒 Files selected for processing (32)
  • scripts/auto-rebase/rebase_history.sh
  • scripts/devenv-builder/configure-vm.sh
  • scripts/get-latest-rhocp-repo.sh
  • scripts/release-notes/common.py
  • scripts/release-notes/gen_gh_releases_from_mirror.py
  • scripts/release-notes/gen_gh_releases_from_rhocp.py
  • test/assets/common_versions.sh.template
  • test/bin/build_images.sh
  • test/bin/build_rpms.sh
  • test/bin/common.sh
  • test/bin/common_versions.sh
  • test/bin/pyutils/build_bootc_images.py
  • test/bin/pyutils/generate_common_versions.py
  • test/bin/scenario.sh
  • test/kickstart-templates/includes/post-cos9rpm.cfg
  • test/package-sources/rhocp-y.toml
  • test/package-sources/rhocp-y1.toml
  • test/package-sources/rhocp-y2.toml
  • test/scenarios/periodics/el96-prel@el98-src@upgrade-ok.sh
  • test/scenarios/periodics/el96-yminus2@el98-src@upgrade-ok.sh
  • test/scenarios/presubmits/el96-prel@el98-src@upgrade-ok.sh
  • test/scenarios/presubmits/el96-yminus2@el98-src@upgrade-ok.sh
  • test/scenarios/presubmits/el98-src@rpm-install.sh.disabled
  • test/scenarios/releases/el96-yminus1@el98-lrel@lvms.sh
  • test/scenarios/releases/el96-yminus1@el98-lrel@standard1.sh
  • test/scenarios/releases/el96-yminus1@el98-lrel@standard2.sh
  • test/scenarios/releases/el96-yminus2@el98-lrel@lvms.sh
  • test/scenarios/releases/el96-yminus2@el98-lrel@standard1.sh
  • test/scenarios/releases/el96-yminus2@el98-lrel@standard2.sh
  • test/scenarios/releases/el98@rpm-standard1.sh.disabled
  • test/scenarios/releases/el98@rpm-standard2.sh.disabled
  • test/scenarios/releases/el98@rpm-upgrade.sh.disabled
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (7)

@pacevedom pacevedom force-pushed the test-framework-5.0 branch from b512924 to a9b812b Compare March 24, 2026 17:05
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/devenv-builder/configure-vm.sh`:
- Around line 231-247: The previous-version lookup calls the RHOCP_REPO script
with only the minor version which makes get-latest-rhocp-repo.sh read the wrong
(current branch) major; update the calls that invoke "${RHOCP_REPO}" (inside the
block using get_prev_version, PREVIOUS_RHOCP, Y2_RHOCP) to pass both target
major and minor so the helper can compute the correct rhocp-X.Y name (or change
the helper to accept explicit major+minor). Concretely, change the two call
sites that currently do "${RHOCP_REPO}" "${prev_minor}" to pass "${prev_major}"
"${prev_minor}" and ensure get-latest-rhocp-repo.sh / RHOCP_REPO handles two
args (major, minor) rather than relying on its Makefile.version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 45e5f8cd-3e6e-429a-8472-5956b89279cf

📥 Commits

Reviewing files that changed from the base of the PR and between b512924 and a9b812b.

📒 Files selected for processing (17)
  • scripts/auto-rebase/rebase_history.sh
  • scripts/devenv-builder/configure-vm.sh
  • scripts/release-notes/common.py
  • scripts/release-notes/gen_gh_releases_from_mirror.py
  • scripts/release-notes/gen_gh_releases_from_rhocp.py
  • test/bin/build_images.sh
  • test/bin/scenario.sh
  • test/scenarios/periodics/el96-prel@el98-src@upgrade-ok.sh
  • test/scenarios/periodics/el96-yminus2@el98-src@upgrade-ok.sh
  • test/scenarios/presubmits/el96-prel@el98-src@upgrade-ok.sh
  • test/scenarios/presubmits/el96-yminus2@el98-src@upgrade-ok.sh
  • test/scenarios/releases/el96-yminus1@el98-lrel@lvms.sh
  • test/scenarios/releases/el96-yminus1@el98-lrel@standard1.sh
  • test/scenarios/releases/el96-yminus1@el98-lrel@standard2.sh
  • test/scenarios/releases/el96-yminus2@el98-lrel@lvms.sh
  • test/scenarios/releases/el96-yminus2@el98-lrel@standard1.sh
  • test/scenarios/releases/el96-yminus2@el98-lrel@standard2.sh
✅ Files skipped from review due to trivial changes (6)
🚧 Files skipped from review as they are similar to previous changes (7)

@pacevedom pacevedom force-pushed the test-framework-5.0 branch from a9b812b to aeadecc Compare March 25, 2026 12:53
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 25, 2026

@pacevedom: The following tests 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/prow/e2e-aws-tests-release-arm aeadecc link true /test e2e-aws-tests-release-arm
ci/prow/e2e-aws-tests-bootc-el10 aeadecc link true /test e2e-aws-tests-bootc-el10
ci/prow/e2e-aws-tests-bootc-release-el10 aeadecc link true /test e2e-aws-tests-bootc-release-el10
ci/prow/e2e-aws-tests-bootc-release-arm-el9 aeadecc link true /test e2e-aws-tests-bootc-release-arm-el9
ci/prow/e2e-aws-tests-bootc-release-el9 aeadecc link true /test e2e-aws-tests-bootc-release-el9
ci/prow/e2e-aws-tests-release aeadecc link true /test e2e-aws-tests-release
ci/prow/e2e-aws-tests-bootc-release-arm-el10 aeadecc link true /test e2e-aws-tests-bootc-release-arm-el10
ci/prow/e2e-aws-tests-bootc-arm-el10 aeadecc link true /test e2e-aws-tests-bootc-arm-el10

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.

@pacevedom
Copy link
Copy Markdown
Contributor Author

/hold cancael

@pacevedom
Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 25, 2026
@jeff-roche
Copy link
Copy Markdown

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 25, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 25, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jeff-roche, pacevedom

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants