Skip to content

OPRUN-4437: test: add allow-case for operator maxOCPVersion > cluster version#765

Open
tmshort wants to merge 1 commit into
openshift:mainfrom
tmshort:oprun-4432-ote-allow-case
Open

OPRUN-4437: test: add allow-case for operator maxOCPVersion > cluster version#765
tmshort wants to merge 1 commit into
openshift:mainfrom
tmshort:oprun-4432-ote-allow-case

Conversation

@tmshort

@tmshort tmshort commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Add a second ReleaseGate-eligible OTE test verifying that an operator whose olm.maxOpenShiftVersion exceeds the current cluster version does not block cluster upgrade (InstalledOLMOperatorsUpgradeable stays True).

The existing test only covered the blocking path (maxOCPVersion == current version → False). This covers the complementary allow path (maxOCPVersion == next minor → True), directly exercising the normalization logic introduced for the 4.23/5.0 co-release boundary.

A nextMinorVersion() helper mirrors the 4.23→5.1 special case so the bundle annotation is always set to the correct next upgrade target.

Summary by CodeRabbit

  • Tests
    • Extended OLMv1 operator installation coverage to run against the next minor OpenShift version.
    • Added a scenario for the NewOLM feature gate to confirm operator installation does not block cluster upgrades when an operator’s maximum supported OpenShift version is higher than the current cluster version.
    • Continued to verify operators install successfully and remain upgradeable after installation.

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

openshift-ci-robot commented Jul 16, 2026

Copy link
Copy Markdown

@tmshort: This pull request references OPRUN-4437 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 "5.0.0" version, but no target version was set.

Details

In response to this:

Add a second ReleaseGate-eligible OTE test verifying that an operator whose olm.maxOpenShiftVersion exceeds the current cluster version does not block cluster upgrade (InstalledOLMOperatorsUpgradeable stays True).

The existing test only covered the blocking path (maxOCPVersion == current version → False). This covers the complementary allow path (maxOCPVersion == next minor → True), directly exercising the normalization logic introduced for the 4.23/5.0 co-release boundary.

A nextMinorVersion() helper mirrors the 4.23→5.1 special case so the bundle annotation is always set to the correct next upgrade target.

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.

@openshift-ci openshift-ci Bot requested review from fgiudici and thetechnick July 16, 2026 19:15
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 2790f32b-70ac-43a9-82a9-debce61b7d82

📥 Commits

Reviewing files that changed from the base of the PR and between c148d87 and 477aa25.

📒 Files selected for processing (2)
  • openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json
  • openshift/tests-extension/test/olmv1-incompatible.go

Walkthrough

The OLMv1 incompatibility test computes the next OpenShift minor version, uses it for bundle replacement during operator installation, and verifies that InstalledOLMOperatorUpgradable remains true.

Changes

OLMv1 upgradeability validation

Layer / File(s) Summary
Next-version installation and upgradeability assertion
openshift/tests-extension/test/olmv1-incompatible.go, openshift/tests-extension/.openshift-tests-extension/openshift_payload_olmv1.json
Adds next-minor version parsing, including the 4.23 to 5.1 mapping, uses that version for operator installation, verifies upgradeability remains enabled, and registers the scenario in the OLMv1 payload.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OLMv1Test
  participant Cluster
  participant ClusterExtension
  OLMv1Test->>Cluster: Check InstalledOLMOperatorUpgradable
  OLMv1Test->>ClusterExtension: Install operator with next minor VERSION
  ClusterExtension->>Cluster: Report installed operator
  OLMv1Test->>Cluster: Re-check InstalledOLMOperatorUpgradable
Loading

Possibly related PRs

Suggested reviewers: thetechnick, camilamacedo86, fgiudici

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Microshift Test Compatibility ⚠️ Warning The new OLMv1 test uses config.openshift.io and operator.openshift.io resources, and it has no MicroShift skip/apigroup/runtime guard. Add a [Skipped:MicroShift] label, an appropriate [apigroup:...] tag, or an exutil.IsMicroShiftCluster() g.Skip() guard before running on MicroShift.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a test for allowing upgrades when operator maxOCPVersion exceeds the cluster version.
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 The added Describe/It names are static strings; no fmt.Sprintf, generated IDs, timestamps, or runtime data appear in any test title.
Test Structure And Quality ✅ Passed The new OLMv1 case is single-scenario, uses BeforeEach/AfterEach plus DeferCleanup, and all cluster waits use bounded timeouts via helpers.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added test only installs a ClusterExtension and checks OLM upgrade conditions; it has no multi-node/HA assumptions or SNO-specific gating.
Topology-Aware Scheduling Compatibility ✅ Passed Changes are test-only and payload metadata; no pod specs, node selectors, affinity, spread constraints, or PDBs were added/modified.
Ote Binary Stdout Contract ✅ Passed The new code only adds nextMinorVersion() with fmt.Sscanf/Sprintf and a Ginkgo test; no fmt.Print*, klog, log.SetOutput, or other stdout writes in process-level code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed New test only checks OLM upgrade status and cluster extension install; no IPv4 literals, IP parsing, host URL building, or public-network calls were added.
No-Weak-Crypto ✅ Passed Changed files only add version logic and tests; no weak crypto, custom crypto, or secret comparisons appear in the diff.
Container-Privileges ✅ Passed Touched files are test logic and a test list; no privileged, hostPID/hostNetwork/hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation settings were added.
No-Sensitive-Data-In-Logs ✅ Passed Changed code only adds generic test-step messages and a version-parse Fail; no passwords/tokens/PII/hostnames were introduced.
✨ 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

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@openshift/tests-extension/test/olmv1-incompatible.go`:
- Around line 108-118: Update the two By progress messages in the test around
waitForOlmUpgradeStatus to use the asserted condition name,
InstalledOLMOperatorsUpgradeable, matching the condition checked by
waitForOlmUpgradeStatus.
🪄 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: Enterprise

Run ID: 24014f06-4e03-4d82-a555-6d538f998b46

📥 Commits

Reviewing files that changed from the base of the PR and between 93894cf and c148d87.

📒 Files selected for processing (1)
  • openshift/tests-extension/test/olmv1-incompatible.go

Comment on lines +108 to +118
It("should not block cluster upgrades if the operator's maxOCPVersion exceeds the current cluster version", func(ctx SpecContext) {
By("waiting for InstalledOLMOperatorUpgradable to be true")
waitForOlmUpgradeStatus(ctx, operatorv1.ConditionTrue, "")

By("creating the ClusterExtension")
ceName, ceCleanup := helpers.CreateClusterExtension(opName, "", nsName, unique, helpers.WithCatalogNameSelector(ccName))
DeferCleanup(ceCleanup)
helpers.ExpectClusterExtensionToBeInstalled(ctx, ceName)

By("verifying InstalledOLMOperatorUpgradable remains true after installing the operator")
waitForOlmUpgradeStatus(ctx, operatorv1.ConditionTrue, "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the asserted condition name in progress output.

Line 109 and Line 117 say InstalledOLMOperatorUpgradable, but waitForOlmUpgradeStatus checks InstalledOLMOperatorsUpgradeable. Correcting this keeps CI timelines and failure diagnostics unambiguous.

Proposed fix
- By("waiting for InstalledOLMOperatorUpgradable to be true")
+ By("waiting for InstalledOLMOperatorsUpgradeable to be true")
...
- By("verifying InstalledOLMOperatorUpgradable remains true after installing the operator")
+ By("verifying InstalledOLMOperatorsUpgradeable remains true after installing the operator")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
It("should not block cluster upgrades if the operator's maxOCPVersion exceeds the current cluster version", func(ctx SpecContext) {
By("waiting for InstalledOLMOperatorUpgradable to be true")
waitForOlmUpgradeStatus(ctx, operatorv1.ConditionTrue, "")
By("creating the ClusterExtension")
ceName, ceCleanup := helpers.CreateClusterExtension(opName, "", nsName, unique, helpers.WithCatalogNameSelector(ccName))
DeferCleanup(ceCleanup)
helpers.ExpectClusterExtensionToBeInstalled(ctx, ceName)
By("verifying InstalledOLMOperatorUpgradable remains true after installing the operator")
waitForOlmUpgradeStatus(ctx, operatorv1.ConditionTrue, "")
It("should not block cluster upgrades if the operator's maxOCPVersion exceeds the current cluster version", func(ctx SpecContext) {
By("waiting for InstalledOLMOperatorsUpgradeable to be true")
waitForOlmUpgradeStatus(ctx, operatorv1.ConditionTrue, "")
By("creating the ClusterExtension")
ceName, ceCleanup := helpers.CreateClusterExtension(opName, "", nsName, unique, helpers.WithCatalogNameSelector(ccName))
DeferCleanup(ceCleanup)
helpers.ExpectClusterExtensionToBeInstalled(ctx, ceName)
By("verifying InstalledOLMOperatorsUpgradeable remains true after installing the operator")
waitForOlmUpgradeStatus(ctx, operatorv1.ConditionTrue, "")
🤖 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 `@openshift/tests-extension/test/olmv1-incompatible.go` around lines 108 - 118,
Update the two By progress messages in the test around waitForOlmUpgradeStatus
to use the asserted condition name, InstalledOLMOperatorsUpgradeable, matching
the condition checked by waitForOlmUpgradeStatus.

…cluster version

Add a second ReleaseGate-eligible OTE test verifying that an operator
whose olm.maxOpenShiftVersion exceeds the current cluster version does
not block cluster upgrade (InstalledOLMOperatorsUpgradeable stays True).

The existing test only covered the blocking path (maxOCPVersion ==
current version → False). This covers the complementary allow path
(maxOCPVersion == next minor → True), directly exercising the
normalization logic introduced for the 4.23/5.0 co-release boundary.

A nextMinorVersion() helper mirrors the 4.23→5.1 special case so the
bundle annotation is always set to the correct next upgrade target.

Run 'make build-update' to register the new allow-case test in the
extension metadata after adding it to olmv1-incompatible.go.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Todd Short <tshort@redhat.com>
@tmshort tmshort force-pushed the oprun-4432-ote-allow-case branch from c148d87 to 477aa25 Compare July 16, 2026 20:25
@openshift-ci

openshift-ci Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@tmshort: 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/prow/tests-extension c148d87 link true /test tests-extension

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants