Skip to content

OCPBUGS-81511: Remove unscoped CSV watch from ClusterNotUpgradeableAlert - #16904

Open
rsacherer wants to merge 1 commit into
openshift:mainfrom
rsacherer:ocpbugs-81511-remove-csv-watch
Open

OCPBUGS-81511: Remove unscoped CSV watch from ClusterNotUpgradeableAlert#16904
rsacherer wants to merge 1 commit into
openshift:mainfrom
rsacherer:ocpbugs-81511-remove-csv-watch

Conversation

@rsacherer

@rsacherer rsacherer commented Aug 4, 2026

Copy link
Copy Markdown

The ClusterNotUpgradeableAlert component fetched all ClusterServiceVersions cluster-wide (resulting in up to 600MB object sizes in the browser on clusters with 350+ namespaces and lot's of operators) on every visit to Cluster Settings when Upgradeable=False was set.

The only use of CSVs was to decide whether or not to show navigation links.

For installed operators this was ineffective: CSV status.conditions use phase/reason fields, not type/status, so getConditionUpgradeableFalse() always returned undefined on CSVs — meaning notUpgradeableCSVsPresent was permanently false and the 'View installed Operators' link was never shown.

Additionally the link URL used /k8s/ns/all-namespaces/ instead of /k8s/all-namespaces/, causing 'No Operators found' on navigation.

Fix: remove both the ClusterOperator and CSV watches. Both navigation links are now always shown when the alert renders — correct since the alert only mounts when Upgradeable=False is already confirmed on ClusterVersion. Use resourceListPathFromModel() for the correct all-namespaces URL.

https://issues.redhat.com/browse/OCPBUGS-81511

Analysis / Root cause:
The ClusterNotUpgradeableAlert component fetched all ClusterServiceVersions
cluster-wide (resulting in up to 600MB object sizes in the browser on clusters
with 350+ namespaces and lots of operators) on every visit to Cluster Settings
when Upgradeable=False was set.

The only use of CSVs was to decide whether or not to show navigation links.

For installed operators this was ineffective: CSV status.conditions use
phase/reason fields, not type/status, so getConditionUpgradeableFalse() always
returned undefined on CSVs — meaning notUpgradeableCSVsPresent was permanently
false and the 'View installed Operators' link was never shown.

Additionally the link URL used /k8s/ns/all-namespaces/ instead of
/k8s/all-namespaces/, causing 'No Operators found' on navigation.

Solution description:
Remove both the ClusterOperator and CSV watches. Both navigation links are now
always shown when the alert renders — correct since the alert only mounts when
Upgradeable=False is already confirmed on ClusterVersion. Use
resourceListPathFromModel() for the correct all-namespaces URL.

https://issues.redhat.com/browse/OCPBUGS-81511

Test setup:

  1. Create fake ClusterOperators with Upgradeable=False to trigger the alert:
    oc apply -f - <<EOF
    apiVersion: config.openshift.io/v1
    kind: ClusterOperator
    metadata:
    name: test-upgrade-blocker
    spec: {}
    EOF
    oc patch co test-upgrade-blocker --subresource=status --type=merge -p '{"status":{"conditions":[{"type":"Upgradeable","status":"False","reason":"Test","message":"Test block","lastTransitionTime":"2026-08-04T10:00:00Z"},{"type":"Available","
    status":"True","lastTransitionTime":"2026-08-04T10:00:00Z"},{"type":"Degraded","status":"False","lastTransitionTime":"2026-08-04T10:00:00Z"},{"type":"Progressing","status":"False","lastTransitionTime":"2026-08-04T10:00:00Z"}]}}'
  2. Navigate to Administration → Cluster Settings
  3. Open DevTools → Network, filter on clusterserviceversions

Test cases:

  • With cluster upgradeable (normal state): no clusterserviceversions request fires on Cluster Settings page load
  • With Upgradeable=False set: alert renders, no clusterserviceversions LIST request fires, both "View ClusterOperators" and "View installed Operators" links are visible
  • Clicking "View installed Operators" navigates correctly to the all-namespaces installed operators list

Browser conformance:

  • Firefox

Summary by CodeRabbit

  • Bug Fixes
    • Improved upgrade alerts by consistently providing links to relevant ClusterOperators and installed Operators.
    • Updated resource links for a more reliable navigation experience.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@rsacherer: This pull request references Jira Issue OCPBUGS-81511, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead

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:

The ClusterNotUpgradeableAlert component fetched all ClusterServiceVersions cluster-wide (resulting in up to 600MB object sizes in the browser on clusters with 350+ namespaces and lot's of operators) on every visit to Cluster Settings when Upgradeable=False was set.

The only use of CSVs was to decide whether or not to show navigation links.

For installed operators this was ineffective: CSV status.conditions use phase/reason fields, not type/status, so getConditionUpgradeableFalse() always returned undefined on CSVs — meaning notUpgradeableCSVsPresent was permanently false and the 'View installed Operators' link was never shown.

Additionally the link URL used /k8s/ns/all-namespaces/ instead of /k8s/all-namespaces/, causing 'No Operators found' on navigation.

Fix: remove both the ClusterOperator and CSV watches. Both navigation links are now always shown when the alert renders — correct since the alert only mounts when Upgradeable=False is already confirmed on ClusterVersion. Use resourceListPathFromModel() for the correct all-namespaces URL.

https://issues.redhat.com/browse/OCPBUGS-81511

Analysis / Root cause:
The ClusterNotUpgradeableAlert component fetched all ClusterServiceVersions
cluster-wide (resulting in up to 600MB object sizes in the browser on clusters
with 350+ namespaces and lots of operators) on every visit to Cluster Settings
when Upgradeable=False was set.

The only use of CSVs was to decide whether or not to show navigation links.

For installed operators this was ineffective: CSV status.conditions use
phase/reason fields, not type/status, so getConditionUpgradeableFalse() always
returned undefined on CSVs — meaning notUpgradeableCSVsPresent was permanently
false and the 'View installed Operators' link was never shown.

Additionally the link URL used /k8s/ns/all-namespaces/ instead of
/k8s/all-namespaces/, causing 'No Operators found' on navigation.

Solution description:
Remove both the ClusterOperator and CSV watches. Both navigation links are now
always shown when the alert renders — correct since the alert only mounts when
Upgradeable=False is already confirmed on ClusterVersion. Use
resourceListPathFromModel() for the correct all-namespaces URL.

https://issues.redhat.com/browse/OCPBUGS-81511

Test setup:

  1. Create fake ClusterOperators with Upgradeable=False to trigger the alert:
    oc apply -f - <<EOF
    apiVersion: config.openshift.io/v1
    kind: ClusterOperator
    metadata:
    name: test-upgrade-blocker
    spec: {}
    EOF
    oc patch co test-upgrade-blocker --subresource=status --type=merge -p '{"status":{"conditions":[{"type":"Upgradeable","status":"False","reason":"Test","message":"Test block","lastTransitionTime":"2026-08-04T10:00:00Z"},{"type":"Available","
    status":"True","lastTransitionTime":"2026-08-04T10:00:00Z"},{"type":"Degraded","status":"False","lastTransitionTime":"2026-08-04T10:00:00Z"},{"type":"Progressing","status":"False","lastTransitionTime":"2026-08-04T10:00:00Z"}]}}'
  2. Navigate to Administration → Cluster Settings
  3. Open DevTools → Network, filter on clusterserviceversions

Test cases:

  • With cluster upgradeable (normal state): no clusterserviceversions request fires on Cluster Settings page load
  • With Upgradeable=False set: alert renders, no clusterserviceversions LIST request fires, both "View ClusterOperators" and "View installed Operators" links are visible
  • Clicking "View installed Operators" navigates correctly to the all-namespaces installed operators list

Browser conformance:

  • Firefox

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 Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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: Pro Plus

Run ID: 32efc60d-ee8a-471b-aab0-5ff74c6998fe

📥 Commits

Reviewing files that changed from the base of the PR and between e5715aa and 46125c6.

📒 Files selected for processing (3)
  • frontend/public/components/__tests__/cluster-settings.spec.tsx
  • frontend/public/components/cluster-settings/cluster-settings.tsx
  • frontend/public/module/k8s/cluster-settings.ts
💤 Files with no reviewable changes (1)
  • frontend/public/module/k8s/cluster-settings.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/public/components/cluster-settings/cluster-settings.tsx

Walkthrough

The cluster settings alert no longer checks resource upgradeability. It always displays ClusterOperator and installed Operator links and uses resourceListPathFromModel for the installed Operator path.

Changes

Cluster settings alert

Layer / File(s) Summary
Alert link behavior
frontend/public/components/cluster-settings/cluster-settings.tsx, frontend/public/module/k8s/cluster-settings.ts
The alert removes resource watches and upgradeability checks. It always renders both operator links. The installed Operator link uses resourceListPathFromModel(ClusterServiceVersionModel). The unused getNotUpgradeableResources helper is removed.
Alert rendering tests
frontend/public/components/__tests__/cluster-settings.spec.tsx
Tests verify the alert message and both operator links, including the all-namespaces installed Operator URL.

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

Suggested reviewers: rhamilto, jhadvig

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing the unscoped CSV watch from ClusterNotUpgradeableAlert.
Description check ✅ Passed The description covers the root cause, solution, test setup, test cases, and browser conformance; omitted sections are non-critical.
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 Jest tests use only literal, descriptive titles; none contains generated names, timestamps, namespaces, node names, IPs, UUIDs, or other run-dependent values.
Test Structure And Quality ✅ Passed The custom check requires assessment of Ginkgo test code quality. This PR modifies only TypeScript/React tests using Jest, not Ginkgo. The check is not applicable to this PR's content.
Microshift Test Compatibility ✅ Passed The PR adds a Jest/React Testing Library TypeScript unit test, not a Ginkgo e2e test; the MicroShift API compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds only Jest/React unit tests in cluster-settings.spec.tsx; it adds no Ginkgo e2e tests or multi-node assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only frontend TypeScript components, tests, and a helper; it adds no manifests, controllers, or scheduling constraints such as affinity, tolerations, replicas, or node selectors.
Ote Binary Stdout Contract ✅ Passed This PR modifies only frontend TypeScript/React code (3 files with .ts/.tsx extensions). The OTE Binary Stdout Contract check applies only to Go test files. No Go code was changed.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch adds only Jest/React unit tests in a TSX file; it adds no Ginkgo e2e tests, IPv4 assumptions, or external-network access.
No-Weak-Crypto ✅ Passed The PR adds links and tests only; changed files contain no MD5, SHA1, DES, RC4, Blowfish, ECB, crypto APIs, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only TypeScript and test files. No manifest-like files or privilege-related declarations/references were added.
No-Sensitive-Data-In-Logs ✅ Passed The pull-request additions contain no logging calls or sensitive-data logging. Existing console.error calls are unchanged and outside the modified hunks.
✨ 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.

@openshift-ci
openshift-ci Bot requested review from jhadvig and rhamilto August 4, 2026 13:01
@openshift-ci openshift-ci Bot added component/core Related to console core functionality needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Hi @rsacherer. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/public/components/cluster-settings/cluster-settings.tsx (1)

1131-1143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a regression test for the link behavior.

Render ClusterNotUpgradeableAlert with Upgradeable=False and verify both link labels. Also verify that the installed Operator link uses the all-namespaces path generated from ClusterServiceVersionModel. This protects both user-visible changes from regression.

🤖 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 `@frontend/public/components/cluster-settings/cluster-settings.tsx` around
lines 1131 - 1143, Add a regression test for ClusterNotUpgradeableAlert with
Upgradeable set to False, asserting both “View ClusterOperators” and “View
installed Operators” labels and verifying the installed Operators link uses the
all-namespaces path generated by
resourceListPathFromModel(ClusterServiceVersionModel).
🤖 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.

Nitpick comments:
In `@frontend/public/components/cluster-settings/cluster-settings.tsx`:
- Around line 1131-1143: Add a regression test for ClusterNotUpgradeableAlert
with Upgradeable set to False, asserting both “View ClusterOperators” and “View
installed Operators” labels and verifying the installed Operators link uses the
all-namespaces path generated by
resourceListPathFromModel(ClusterServiceVersionModel).

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: a051259a-6ca4-4bc2-a0a2-a24a3832e5b1

📥 Commits

Reviewing files that changed from the base of the PR and between 8d7d331 and b578bbd.

📒 Files selected for processing (1)
  • frontend/public/components/cluster-settings/cluster-settings.tsx

@logonoff logonoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Talked about this in a call and we are OK with this change

/lgtm

@logonoff

logonoff commented Aug 4, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 4, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console
/test e2e-playwright

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2026
@logonoff

logonoff commented Aug 4, 2026

Copy link
Copy Markdown
Member

/hold

valid frontend test failure

@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 Aug 4, 2026
The ClusterNotUpgradeableAlert component fetched all ClusterServiceVersions
cluster-wide (resulting in up to 600MB object sizes in the browser on
clusters with 350+ namespaces and lot's of operators) on every visit to
Cluster Settings when Upgradeable=False was set.

The only use of CSVs was to decide whether or not to show navigation links.

For installed operators this was ineffective: CSV status.conditions use
phase/reason fields, not type/status, so getConditionUpgradeableFalse()
always returned undefined on CSVs — meaning notUpgradeableCSVsPresent was
permanently false and the 'View installed Operators' link was never shown.

Additionally the link URL used /k8s/ns/all-namespaces/ instead of
/k8s/all-namespaces/, causing 'No Operators found' on navigation.

Fix: remove both the ClusterOperator and CSV watches. Both navigation links
are now always shown when the alert renders — correct since the alert only
mounts when Upgradeable=False is already confirmed on ClusterVersion. Use
resourceListPathFromModel() for the correct all-namespaces URL.

https://issues.redhat.com/browse/OCPBUGS-81511
@rsacherer
rsacherer force-pushed the ocpbugs-81511-remove-csv-watch branch from b578bbd to 46125c6 Compare August 5, 2026 12:24
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@rsacherer

Copy link
Copy Markdown
Author

Fixed the unused export, and included a test-case to check that the alert is printed with both URLs.

@rsacherer

Copy link
Copy Markdown
Author

/retest-required

@logonoff logonoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@logonoff

logonoff commented Aug 5, 2026

Copy link
Copy Markdown
Member

/unhold

@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 Aug 5, 2026
@logonoff

logonoff commented Aug 5, 2026

Copy link
Copy Markdown
Member

/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 Aug 5, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@logonoff: This pull request references Jira Issue OCPBUGS-81511, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, 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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console
/test e2e-playwright

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, rsacherer

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

@logonoff

logonoff commented Aug 5, 2026

Copy link
Copy Markdown
Member

/retest

1 similar comment
@rsacherer

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@rsacherer: 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-playwright-techpreview 46125c6 link false /test e2e-playwright-techpreview
ci/prow/e2e-gcp-console 46125c6 link true /test e2e-gcp-console

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 openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 6, 2026
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

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 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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants