OCPBUGS-65946: Fix search component to not pass ALL_NAMESPACES_KEY to…#15789
OCPBUGS-65946: Fix search component to not pass ALL_NAMESPACES_KEY to…#15789openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
Conversation
… the AsyncComponent
|
@TheRealJon: This pull request references Jira Issue OCPBUGS-65946, 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. |
WalkthroughAdjusted namespace handling in the search component to treat the all-namespaces sentinel as undefined for the AsyncComponent loader; updated Cypress integration tests to use the data-view (dv) API, re-enable tests, and add assertions about namespace visibility in search results. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
/jira refresh |
|
@TheRealJon: This pull request references Jira Issue OCPBUGS-65946, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: 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. |
|
/lgtm |
|
/jira refresh The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-65946, which is invalid:
Comment 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. |
|
/lgtm cancel Please add the test updates from https://github.com/openshift/console/pull/15826/files#diff-8a164ce7ed5a6df090a10cb8c9d42e3cebdecea9c5b6423a556e399dd42445b7 |
|
/retest |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (1)
frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts(3 hunks)
🧰 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/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts
🔇 Additional comments (1)
frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts (1)
104-109: Use the correct label variable in the query.The test searches for Pods with label
q: 'app=name', but the deployment only setslbl-filter: ${testName}(line 32). Update line 106 to useq: WORKLOAD_LABELlike the previous test does, or add theapp=namelabel to the deployment.
| const SEARCH_NAMESPACE = 'openshift-authentication-operator'; | ||
| const SEARCH_DEPLOYMENT_NAME = 'authentication-operator'; |
There was a problem hiding this comment.
Hardcoded production resources create test brittleness.
The new constants reference actual OpenShift cluster components (openshift-authentication-operator, authentication-operator) rather than test-created resources. This creates a dependency on external cluster state and deviates from the pattern used elsewhere in this test suite, where resources are dynamically created using testName.
Consider using the test-created deployment (WORKLOAD_NAME) instead to improve test isolation and reliability.
Apply this diff to use test-created resources:
-const SEARCH_NAMESPACE = 'openshift-authentication-operator';
-const SEARCH_DEPLOYMENT_NAME = 'authentication-operator';
+// Use test-created resources for better isolation
+const SEARCH_NAMESPACE = testName;Then update the search tests to use WORKLOAD_NAME instead of SEARCH_DEPLOYMENT_NAME.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts
around lines 10-11, the constants point to real cluster resources
(openshift-authentication-operator / authentication-operator) which makes tests
brittle; replace the hardcoded SEARCH_NAMESPACE/SEARCH_DEPLOYMENT_NAME with the
test-created values used elsewhere (use the test namespace/testName and
WORKLOAD_NAME created in the test setup). Update all search assertions and
invocations in this file to reference WORKLOAD_NAME (and the dynamic test
namespace) instead of SEARCH_DEPLOYMENT_NAME, ensuring the test uses the created
workload and not external cluster resources.
| it('displays namespace on Search when All Namespaces is selected', () => { | ||
| cy.visit( | ||
| `/search/all-namespaces?kind=apps~v1~Deployment&page=1&perPage=50&name=${SEARCH_DEPLOYMENT_NAME}`, | ||
| ); | ||
| listPage.dvRows.countShouldBe(1); | ||
| cy.get(`[data-test-id="${SEARCH_NAMESPACE}"]`).should('exist'); | ||
| }); | ||
|
|
||
| it('does not display namespace on Search when namespace is selected', () => { | ||
| cy.visit( | ||
| `/search/ns/${SEARCH_NAMESPACE}?kind=apps~v1~Deployment&page=1&perPage=50&name=${SEARCH_DEPLOYMENT_NAME}`, | ||
| ); | ||
| listPage.dvRows.countShouldBe(1); | ||
| cy.get(`[data-test-id="${SEARCH_NAMESPACE}"]`).should('not.exist'); | ||
| }); |
There was a problem hiding this comment.
Test dependency on production resources reduces reliability.
Both new tests rely on the existence of openshift-authentication-operator namespace and authentication-operator deployment in the cluster. This approach:
- Creates flakiness if these resources don't exist or have different configurations
- Makes tests environment-dependent
- Breaks test isolation principles
Refactor these tests to use the dynamically created test resources:
it('displays namespace on Search when All Namespaces is selected', () => {
cy.visit(
- `/search/all-namespaces?kind=apps~v1~Deployment&page=1&perPage=50&name=${SEARCH_DEPLOYMENT_NAME}`,
+ `/search/all-namespaces?kind=apps~v1~Deployment&page=1&perPage=50&name=${WORKLOAD_NAME}`,
);
listPage.dvRows.countShouldBe(1);
- cy.get(`[data-test-id="${SEARCH_NAMESPACE}"]`).should('exist');
+ cy.get(`[data-test-id="${testName}"]`).should('exist');
});
it('does not display namespace on Search when namespace is selected', () => {
cy.visit(
- `/search/ns/${SEARCH_NAMESPACE}?kind=apps~v1~Deployment&page=1&perPage=50&name=${SEARCH_DEPLOYMENT_NAME}`,
+ `/search/ns/${testName}?kind=apps~v1~Deployment&page=1&perPage=50&name=${WORKLOAD_NAME}`,
);
listPage.dvRows.countShouldBe(1);
- cy.get(`[data-test-id="${SEARCH_NAMESPACE}"]`).should('not.exist');
+ cy.get(`[data-test-id="${testName}"]`).should('not.exist');
});Committable suggestion skipped: line range outside the PR's diff.
|
/retest |
1 similar comment
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TheRealJon, vikram-raj 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 |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/jira refresh The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-65946, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: 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. |
|
@yapei Could you take QE verify when you get a chance? |
|
Before the fix: searching some resources with After the fix: resources in all namespaces can be returned successfully /verified by @yapei |
|
@yapei: This PR has been marked as verified by 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. |
|
/hold Revision 2765cdb was retested 3 times: holding |
|
/retest |
|
@TheRealJon: 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. |
|
/unhold |
|
@TheRealJon: Jira Issue Verification Checks: Jira Issue OCPBUGS-65946 Jira Issue OCPBUGS-65946 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 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. |
|
Fix included in accepted release 4.22.0-0.nightly-2026-01-14-031657 |
|
@TheRealJon Can we backport this to release-4.21? |
|
/cherry-pick release-4.21 |
|
@TheRealJon: new pull request created: #16170 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. |




… the AsyncComponent