OCPBUGS-81511: Remove unscoped CSV watch from ClusterNotUpgradeableAlert - #16904
OCPBUGS-81511: Remove unscoped CSV watch from ClusterNotUpgradeableAlert#16904rsacherer wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@rsacherer: This pull request references Jira Issue OCPBUGS-81511, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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. |
WalkthroughThe cluster upgrade alert no longer checks watched resources before rendering actions. It always shows ClusterOperators and installed Operators links. The installed Operators link uses the shared resource-list path utility. Tests cover the alert message and link URLs. ChangesCluster upgrade alert
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/public/components/cluster-settings/cluster-settings.tsx (1)
1131-1143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a regression test for the link behavior.
Render
ClusterNotUpgradeableAlertwithUpgradeable=Falseand verify both link labels. Also verify that the installed Operator link uses the all-namespaces path generated fromClusterServiceVersionModel. 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
📒 Files selected for processing (1)
frontend/public/components/cluster-settings/cluster-settings.tsx
|
/ok-to-test |
|
Scheduling tests matching the |
|
/hold valid frontend test failure |
b578bbd to
46125c6
Compare
|
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. |
|
Fixed the unused export, and included a test-case to check that the alert is printed with both URLs. |
|
/retest-required |
|
/unhold |
|
/jira refresh |
|
@logonoff: This pull request references Jira Issue OCPBUGS-81511, which is valid. 3 validation(s) were run on this bug
DetailsIn 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. |
|
Scheduling tests matching the |
|
/retest |
1 similar comment
|
/retest |
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
46125c6 to
9ee6f5c
Compare
|
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. |
|
I had to rebase, the code I worked on got moved from the file |
|
/retest |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/public/components/__tests__/cluster-settings.spec.tsx (1)
26-30: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExercise the shared URL helper in the test.
resourceListPathFromModelalways returns the expected URL in this mock. The test can therefore pass ifClusterNotUpgradeableAlertuses a hardcoded path or passes the wrong model. Assert that the mock receivesClusterServiceVersionModel, or run the test with the real helper.Also applies to: 49-55
🤖 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/__tests__/cluster-settings.spec.tsx` around lines 26 - 30, Update the cluster-settings test around ClusterNotUpgradeableAlert and the resource-link mock so it verifies resourceListPathFromModel receives ClusterServiceVersionModel, or uses the real helper instead of a fixed URL-only mock. Preserve the expected ClusterServiceVersion URL assertion while ensuring an incorrect model or hardcoded path cannot pass.
🤖 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/__tests__/cluster-settings.spec.tsx`:
- Around line 26-30: Update the cluster-settings test around
ClusterNotUpgradeableAlert and the resource-link mock so it verifies
resourceListPathFromModel receives ClusterServiceVersionModel, or uses the real
helper instead of a fixed URL-only mock. Preserve the expected
ClusterServiceVersion URL assertion while ensuring an incorrect model or
hardcoded path cannot pass.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b95ef003-ad53-408e-9bec-25fba210dc8d
📒 Files selected for processing (3)
frontend/public/components/__tests__/cluster-settings.spec.tsxfrontend/public/components/cluster-settings/cluster-settings-utils.tsxfrontend/public/module/k8s/cluster-settings.ts
💤 Files with no reviewable changes (1)
- frontend/public/module/k8s/cluster-settings.ts
| {t('View ClusterOperators')} | ||
| </ClusterOperatorsLink> | ||
| </FlexItem> | ||
| {/* TODO: update link to include filter once installed Operators filters are updated */} |
There was a problem hiding this comment.
do we wanna address this old todo? 😆
There was a problem hiding this comment.
I was reviewing this, because I'd like to have that fixed too, but I think that should be a 2nd PR, because it is a bit more involved, we need to fetch another object in the cluster operators link to be actually able to filter the list properly.
|
Scheduling tests matching the |
|
/retest |
|
/test e2e-gcp-console |
|
/test e2e-playwright |
|
/label plugin-api-approved |
|
e2e-gcp-console: fails on Debug pod > debug terminal with xterm dimensions TypeError - unrelated to cluster settings. e2e-playwright: fails on upstream configuration modal DOM detachment - different component on the same page. The test that directly covers this PR's code (upgradeable-false.spec.ts) passed in e2e-playwright-techpreview, and unit tests passed in ci/prow/frontend. /override ci/prow/e2e-gcp-console ci/prow/e2e-playwright |
|
/approve |
|
@jhadvig: Overrode contexts on behalf of jhadvig: ci/prow/e2e-gcp-console, ci/prow/e2e-playwright DetailsIn 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 kubernetes-sigs/prow repository. |
|
@rsacherer: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhadvig, logonoff, rsacherer The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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:
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"}]}}'
Test cases:
Browser conformance:
Summary by CodeRabbit