Skip to content

OCPBUGS-65946: Fix search component to not pass ALL_NAMESPACES_KEY to…#15789

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
TheRealJon:OCPBUGS-65946
Jan 12, 2026
Merged

OCPBUGS-65946: Fix search component to not pass ALL_NAMESPACES_KEY to…#15789
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
TheRealJon:OCPBUGS-65946

Conversation

@TheRealJon
Copy link
Member

… the AsyncComponent

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Dec 1, 2025
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: This pull request references Jira Issue OCPBUGS-65946, which is invalid:

  • expected the bug to target the "4.21.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:

… the AsyncComponent

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Adjusted 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

Cohort / File(s) Change Summary
Namespace handling change
frontend/public/components/search.tsx
Imported ALL_NAMESPACES_KEY and modified the AsyncComponent loader namespace prop to map ALL_NAMESPACES_KEY to undefined, altering how all-namespaces requests are represented.
Integration test updates
frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts
Introduced SEARCH_NAMESPACE and SEARCH_DEPLOYMENT_NAME constants; replaced listPage.rows with listPage.dvRows, listPage.dvFilter and related dv assertions; changed expected counts to use countShouldBe(3); re-enabled tests (xitit); added tests verifying namespace visibility in search results for "All Namespaces" vs specific namespace.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Reason: small component logic change plus several test API migrations and new tests require verifying test behavior.
  • Pay attention to:
    • Correct mapping of ALL_NAMESPACES_KEYundefined in all loader call sites.
    • Test updates using dv APIs and new assertions for namespace visibility.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci openshift-ci bot requested review from jhadvig and spadgett December 1, 2025 20:32
@openshift-ci openshift-ci bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 1, 2025
@TheRealJon
Copy link
Member Author

/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 Dec 1, 2025
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

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 requested a review from yapei December 1, 2025 20:45
@rhamilto
Copy link
Member

rhamilto commented Dec 1, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2025
@openshift-bot
Copy link
Contributor

/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-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Dec 12, 2025
@openshift-ci-robot
Copy link
Contributor

@openshift-bot: This pull request references Jira Issue OCPBUGS-65946, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.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.

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

@rhamilto
Copy link
Member

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 12, 2025
@TheRealJon
Copy link
Member Author

/retest

@openshift-ci openshift-ci bot added the kind/cypress Related to Cypress e2e integration testing label Dec 12, 2025
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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 184f906 and 2765cdb.

📒 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 sets lbl-filter: ${testName} (line 32). Update line 106 to use q: WORKLOAD_LABEL like the previous test does, or add the app=name label to the deployment.

Comment on lines +10 to +11
const SEARCH_NAMESPACE = 'openshift-authentication-operator';
const SEARCH_DEPLOYMENT_NAME = 'authentication-operator';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Comment on lines +83 to 97
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');
});
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

@rhamilto
Copy link
Member

/retest

1 similar comment
@rhamilto
Copy link
Member

/retest

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2025

[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

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

@TheRealJon
Copy link
Member Author

/retest

2 similar comments
@TheRealJon
Copy link
Member Author

/retest

@rhamilto
Copy link
Member

/retest

@openshift-bot
Copy link
Contributor

/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-ci-robot
Copy link
Contributor

@openshift-bot: This pull request references Jira Issue OCPBUGS-65946, 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)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

@TheRealJon
Copy link
Member Author

@yapei Could you take QE verify when you get a chance?

@yapei
Copy link
Contributor

yapei commented Jan 6, 2026

Before the fix: searching some resources with All Projects will return 404
before-fix-404

After the fix: resources in all namespaces can be returned successfully
after-fix

/verified by @yapei

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

@yapei: This PR has been marked as verified by @yapei.

Details

In response to this:

Before the fix: searching some resources with All Projects will return 404
before-fix

After the fix: resources in all namespaces can be returned successfully
Screenshot 2026-01-06 at 4 22 10 PM

/verified by @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.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d00353d and 2 for PR HEAD 2765cdb in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9c70ba0 and 1 for PR HEAD 2765cdb in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 2552602 and 0 for PR HEAD 2765cdb in total

@openshift-ci-robot
Copy link
Contributor

/hold

Revision 2765cdb was retested 3 times: holding

@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 Jan 7, 2026
@TheRealJon
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 9, 2026

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

@logonoff
Copy link
Member

/unhold
/retest

@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 Jan 11, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 81d6ea6 into openshift:main Jan 12, 2026
8 checks passed
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: Jira Issue Verification Checks: Jira Issue OCPBUGS-65946
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

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

Details

In response to this:

… the AsyncComponent

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-merge-robot
Copy link
Contributor

Fix included in accepted release 4.22.0-0.nightly-2026-01-14-031657

@yapei
Copy link
Contributor

yapei commented Jan 15, 2026

@TheRealJon Can we backport this to release-4.21?

@TheRealJon
Copy link
Member Author

/cherry-pick release-4.21

@TheRealJon TheRealJon deleted the OCPBUGS-65946 branch March 18, 2026 18:29
@openshift-cherrypick-robot

@TheRealJon: new pull request created: #16170

Details

In response to this:

/cherry-pick release-4.21

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. kind/cypress Related to Cypress e2e integration testing lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants