Skip to content

OCPBUGS-79581: Fix Deprecated Operator Warnings E2E tests Skipped in the Firehose Public Folder PR#16197

Open
cajieh wants to merge 1 commit intoopenshift:mainfrom
cajieh:fix-e2e-tests-skipped-in-firehose-public-folder-refactoring-pr
Open

OCPBUGS-79581: Fix Deprecated Operator Warnings E2E tests Skipped in the Firehose Public Folder PR#16197
cajieh wants to merge 1 commit intoopenshift:mainfrom
cajieh:fix-e2e-tests-skipped-in-firehose-public-folder-refactoring-pr

Conversation

@cajieh
Copy link
Contributor

@cajieh cajieh commented Mar 25, 2026

Root Cause:

This is a regression caused by the migration from the legacy Firehose component to React hooks. The refactor altered the data flow, causing the Deprecated badge to disappear from the 'Installed Operators' list page because ClusterServiceVersionList no longer receives the Subscription data required to determine deprecation status.

Summary Changes:

  1. Fixed Missing depreciated badge on Installed Operator page: Fixed the ListPageWrapper to spread {...watchedResources} to ListComponent, ensuring subscriptions and catalogSources data reaches ClusterServiceVersionList.
  2. Fixed subscription matching for namespace resolution: Added fallback to use csv.metadata.namespace when operatorNamespaceFor(csv) returns undefined, enabling proper subscription-to-CSV matching for the deprecation badge and channel update button: csv-status.ts
  3. Changed byTestID to byLegacyTestID for horizontal nav links (horizontal-link-Details, horizontal-link-Subscription) since they use data-test-id.
  4. Added TIMEOUT to async element checks in tests 7-8 for subscription data loading
  5. Simplified deprecation message constants to use common substrings that match both pre and post-installation messages

Before:

Screenshot 2026-03-25 at 6 19 33 PM

After:

Screenshot 2026-03-25 at 6 20 13 PM
depreciated.operator.warninh.-.new.mov

@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 25, 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 25, 2026
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-79581, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary Changes:

  1. Changed byTestID to byLegacyTestID for horizontal nav links (horizontal-link-Details, horizontal-link-Subscription) since they use data-test-id
  2. Added TIMEOUT to async element checks in tests 7-8 for subscription data loading
  3. Simplified deprecation message constants to use common substrings that match both pre and post-installation messages
    Application Code Changes (from earlier in this session): list-page.tsx: Fixed ListPageWrapper to spread {...watchedResources} to ListComponent, ensuring subscriptions and catalogSources data reaches ClusterServiceVersionList
    Files Modified: frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts

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-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Mar 25, 2026
@openshift-ci openshift-ci bot requested review from jhadvig and rhamilto March 25, 2026 18:31
@openshift-ci openshift-ci bot added component/core Related to console core functionality component/olm Related to OLM approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 25, 2026
@cajieh cajieh force-pushed the fix-e2e-tests-skipped-in-firehose-public-folder-refactoring-pr branch 2 times, most recently from 999b66b to 293ccf1 Compare March 25, 2026 18:49
@cajieh
Copy link
Contributor Author

cajieh commented Mar 25, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 25, 2026
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-79581, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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.

@cajieh cajieh force-pushed the fix-e2e-tests-skipped-in-firehose-public-folder-refactoring-pr branch from 293ccf1 to 2320c8f Compare March 25, 2026 21:15
@cajieh cajieh changed the title [WIP] OCPBUGS-79581: Fix Deprecated Operator Warnings E2E tests Skipped in the Firehose Public Folder PR OCPBUGS-79581: Fix Deprecated Operator Warnings E2E tests Skipped in the Firehose Public Folder PR Mar 25, 2026
@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 25, 2026
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-79581, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary Changes:

  1. Changed byTestID to byLegacyTestID for horizontal nav links (horizontal-link-Details, horizontal-link-Subscription) since they use data-test-id
  2. Added TIMEOUT to async element checks in tests 7-8 for subscription data loading
  3. Simplified deprecation message constants to use common substrings that match both pre and post-installation messages
  4. Fix Missing depreciated badge on Installed Operator page: Fixed the ListPageWrapper to spread {...watchedResources} to ListComponent, ensuring subscriptions and catalogSources data reaches ClusterServiceVersionList.

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.

@cajieh cajieh force-pushed the fix-e2e-tests-skipped-in-firehose-public-folder-refactoring-pr branch from 2320c8f to 963e78c Compare March 25, 2026 21:54
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

This pull request updates Operator Lifecycle Manager integration tests and related utilities. The deprecated-operator-warnings test suite activates previously skipped UI test cases for badge rendering and warning displays across the Installed Operators, CSV details, and subscription pages. Test setup migrates to a before() hook using oc apply and JSONPath-based InstallPlan approval. The subscription-matching logic in csv-status.ts adds defensive namespace derivation with fallback handling when operator namespace resolution yields falsy values. A minor prop-spreading adjustment in list-page.tsx forwards watched resource data directly to ListComponent alongside existing props and computed data.

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

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

Copy link
Contributor

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

🧹 Nitpick comments (2)
frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts (2)

191-205: Silent failure if InstallPlan lookup returns empty could lead to confusing downstream test failures.

When installPlanName is empty, this returns cy.wrap(null) and proceeds, leaving the InstallPlan unapproved. Subsequent assertions will fail with unclear errors rather than an explicit "InstallPlan not found" message.

Consider adding an explicit assertion or throwing an error if no InstallPlan is found, so failures are diagnosed quickly in CI logs.

💡 Suggested improvement
       cy.exec(
         `oc get installplan -n ${subscriptionNamespace} -o jsonpath=` +
           `'{.items[?(@.spec.clusterServiceVersionNames[*]=="${csvName}")].metadata.name}'`,
         { timeout: 60000 },
       ).then((result) => {
         const installPlanName = result.stdout.trim();
         if (installPlanName) {
           return cy.exec(
             `oc patch installplan ${installPlanName} -n ${subscriptionNamespace} ` +
               `--type merge -p '{"spec":{"approved":true}}'`,
             { timeout: 60000 },
           );
         }
-        return cy.wrap(null);
+        throw new Error(`InstallPlan not found for CSV ${csvName} in ${subscriptionNamespace}`);
       });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts`
around lines 191 - 205, The test currently silently continues when
installPlanName is empty (the cy.exec.then block returns cy.wrap(null)), which
causes confusing downstream failures; modify the then callback that reads
installPlanName so that if installPlanName is falsy you explicitly fail the test
(e.g., throw an Error or use cy.log + Cypress.fail/assert) with a clear message
like "InstallPlan not found for CSV {csvName} in namespace
{subscriptionNamespace}", otherwise proceed to the existing cy.exec patch call;
update references in this block (installPlanName, subscriptionNamespace,
csvName, and the cy.exec.then handler) to implement the explicit error path.

208-214: failOnNonZeroExit: false masks setup failures.

If the CSV never succeeds or the PackageDeprecated condition never appears, this step passes silently and the real failure surfaces later with less context. Consider either removing failOnNonZeroExit: false or logging result.stdout/result.stderr afterward to aid debugging flaky runs.

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

In
`@frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts`
around lines 208 - 214, The cy.exec call that waits for CSV and subscription
conditions uses failOnNonZeroExit: false which hides setup failures; update the
cy.exec invocation (the call using cy.exec with the `oc wait csv/${csvName}` and
`oc wait subscription/${subscriptionName}` commands) to either remove the
failOnNonZeroExit: false option so failures fail the test immediately, or keep
it but capture and log the returned result.stdout/result.stderr after the
command completes so failing cases surface useful diagnostics (log the output
with cy.log or processLogger).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts`:
- Around line 191-205: The test currently silently continues when
installPlanName is empty (the cy.exec.then block returns cy.wrap(null)), which
causes confusing downstream failures; modify the then callback that reads
installPlanName so that if installPlanName is falsy you explicitly fail the test
(e.g., throw an Error or use cy.log + Cypress.fail/assert) with a clear message
like "InstallPlan not found for CSV {csvName} in namespace
{subscriptionNamespace}", otherwise proceed to the existing cy.exec patch call;
update references in this block (installPlanName, subscriptionNamespace,
csvName, and the cy.exec.then handler) to implement the explicit error path.
- Around line 208-214: The cy.exec call that waits for CSV and subscription
conditions uses failOnNonZeroExit: false which hides setup failures; update the
cy.exec invocation (the call using cy.exec with the `oc wait csv/${csvName}` and
`oc wait subscription/${subscriptionName}` commands) to either remove the
failOnNonZeroExit: false option so failures fail the test immediately, or keep
it but capture and log the returned result.stdout/result.stderr after the
command completes so failing cases surface useful diagnostics (log the output
with cy.log or processLogger).

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 18d11ddf-c177-4286-9a9b-ba8182e160fa

📥 Commits

Reviewing files that changed from the base of the PR and between 1425db6 and 963e78c.

📒 Files selected for processing (3)
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts
  • frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
  • frontend/public/components/factory/list-page.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/public/components/factory/list-page.tsx
  • frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts
  • frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts
🔇 Additional comments (4)
frontend/public/components/factory/list-page.tsx (1)

133-133: Good fix for resource prop propagation to list components.

Spreading watchedResources into ListComponent restores resource-keyed props (for example, subscription/catalog sources) while still passing normalized data, which aligns with the intended compatibility behavior.

frontend/packages/operator-lifecycle-manager/src/status/csv-status.ts (1)

24-25: LGTM — defensive fallback for namespace resolution.

The fallback to csvNamespace when operatorNamespaceFor returns falsy is correct for scenarios where the olm.operatorNamespace annotation is absent (e.g., single-namespace installs). The guard at line 30 properly short-circuits if both values are undefined, preventing spurious matches. This aligns with consumers in clusterserviceversion.tsx and dashboard/utils.ts that rely on accurate subscription lookup for deprecation and status display.

frontend/packages/operator-lifecycle-manager/integration-tests-cypress/tests/deprecated-operator-warnings.cy.ts (2)

11-13: Good approach using common substrings.

Using .contains() with these simplified strings provides resilience against minor text variations between pre- and post-installation deprecation messages while still validating the essential warning content.


217-275: Test cases are well-structured with appropriate async handling.

Good use of TIMEOUT for subscription-dependent elements and byLegacyTestID for nav links that use data-test-id. The assertion flow covers badge, warning messages, and subscription-update modal interaction comprehensively.

@cajieh
Copy link
Contributor Author

cajieh commented Mar 26, 2026

/test e2e-gcp-console

@cajieh
Copy link
Contributor Author

cajieh commented Mar 26, 2026

/retest

@cajieh
Copy link
Contributor Author

cajieh commented Mar 26, 2026

/test all

@cajieh
Copy link
Contributor Author

cajieh commented Mar 26, 2026

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

@cajieh: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

@cajieh: you cannot LGTM your own PR.

Details

In response to this:

/lgtm
/verified later @yapei

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@openshift-ci-robot
Copy link
Contributor

@cajieh: This PR has been marked to be verified later by @yapei.

Details

In response to this:

/lgtm
/verified later @yapei

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.

@sg00dwin
Copy link
Member

/lgtm

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

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh, sg00dwin

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. component/core Related to console core functionality component/olm Related to OLM jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants