Skip to content

OCPBUGS-67004: fix Search page issues with regard to namespace#15826

Closed
rhamilto wants to merge 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-67004
Closed

OCPBUGS-67004: fix Search page issues with regard to namespace#15826
rhamilto wants to merge 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-67004

Conversation

@rhamilto
Copy link
Member

@rhamilto rhamilto commented Dec 9, 2025

After

Screen.Recording.2025-12-09.at.10.40.39.AM.mov

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. 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 9, 2025
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-67004, 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:

After

Screen.Recording.2025-12-09.at.10.40.39.AM.mov

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 9, 2025

Walkthrough

The changes introduce namespace filtering improvements in search functionality. Test coverage is expanded with new test cases for namespace display in search results, and tests are refactored to use data-view selectors. The search component adds logic to handle ALL_NAMESPACES_KEY for proper namespace scoping when listing resources across or within specific namespaces.

Changes

Cohort / File(s) Summary
Search component namespace handling
frontend/public/components/search.tsx
Implements ALL_NAMESPACES_KEY logic to determine namespace scope for resource queries; introduces showNamespaceOverride flag when fetching across all namespaces; adds import for ALL_NAMESPACES_KEY from shared constants.
Search filtering and namespace display tests
frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts
Introduces SEARCH_NAMESPACE and SEARCH_DEPLOYMENT_NAME constants; refactors test interactions from listPage.rows to listPage.dvRows with dvFilter methods; enables previously disabled test scenarios; adds new test cases for namespace display behavior in search results; adjusts row count expectations using countShouldBe.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • The ALL_NAMESPACES_KEY handling logic in search.tsx requires careful review to ensure correct namespace scope determination across namespaced and cluster-scoped resources
  • New namespace display test cases should be verified to properly validate the showNamespaceOverride behavior
  • Data-view selector refactoring in tests (dvRows and dvFilter) needs confirmation that test interactions align with the component changes
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 2db4d62 and 9dfa8c0.

📒 Files selected for processing (2)
  • frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts (3 hunks)
  • frontend/public/components/search.tsx (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
  • frontend/public/components/search.tsx
🔇 Additional comments (4)
frontend/public/components/search.tsx (2)

52-70: LGTM! Clear namespace handling logic.

The implementation correctly handles both namespaced and cluster-scoped resources when ALL_NAMESPACES_KEY is selected. The comments clearly explain the behavior, and the logic ensures that:

  • Namespaced resources with a specific namespace use that namespace
  • Namespaced resources with ALL_NAMESPACES_KEY fetch from all namespaces (undefined)
  • Cluster-scoped resources always use undefined

86-86: Verify AsyncComponent accepts showNamespaceOverride prop.

The showNamespaceOverride prop is being passed to AsyncComponent at line 86. Ensure that AsyncComponent (and the components loaded by it) properly handle and propagate this prop.

frontend/packages/integration-tests-cypress/tests/app/filtering-and-searching.cy.ts (2)

10-11: LGTM! Tests updated for data-view selectors.

The constants reference stable OpenShift system resources, and the migration from disabled tests (xit) to enabled tests (it) with data-view selectors is consistent and well-executed.

Also applies to: 58-81


83-97: LGTM! Comprehensive test coverage for namespace display.

These tests directly validate the namespace display behavior introduced in the search.tsx changes:

  • Verifies namespace column appears when All Namespaces is selected
  • Verifies namespace column is hidden when a specific namespace is selected

The test implementation is clear and uses appropriate selectors.


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

// disabled as listPage.rows.shouldExist isn't a valid test
xit('filters from Pods list', () => {

it('filters from Pods list', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix disabled tests now that the table migration is complete.

listPage.dvRows.countShouldBe(3);
});

it('displays namespace on Search when All Namespaces is selected', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Add new tests for the bug fix.

@openshift-ci openshift-ci bot requested review from Leo6Leo and spadgett December 9, 2025 15:50
@openshift-ci openshift-ci bot added component/core Related to console core functionality kind/cypress Related to Cypress e2e integration testing approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 9, 2025
@rhamilto
Copy link
Member Author

rhamilto commented Dec 9, 2025

/jira refresh
/assign @logonoff

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

@rhamilto: This pull request references Jira Issue OCPBUGS-67004, 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
/assign @logonoff

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 9, 2025 15:52
Copy link
Member

@logonoff logonoff left a comment

Choose a reason for hiding this comment

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

/lgtm

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

openshift-ci bot commented Dec 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@rhamilto
Copy link
Member Author

rhamilto commented Dec 9, 2025

/retest

@rhamilto
Copy link
Member Author

rhamilto commented Dec 9, 2025

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Dec 9, 2025
@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

@yanpzhan, mind verifying since Ya Dan is out?

@yanpzhan
Copy link
Contributor

Checked on cluster launched against the pr.
Navigate to Home -> Search, search Deployment or CatalogSource resource type with 'All Projects' selected, resource list showed correct with exact namespace names in namespace column. Switch to a project mode, eg 'openshift-console', the resources in the project showed in list.
Screenshot from 2025-12-11 19-18-39
Screenshot from 2025-12-11 19-18-52

The bug is fixed.
/verified by yanpzhan

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 11, 2025
@openshift-ci-robot
Copy link
Contributor

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

Details

In response to this:

Checked on cluster launched against the pr.
Navigate to Home -> Search, search Deployment or CatalogSource resource type with 'All Projects' selected, resource list showed correct with exact namespace names in namespace column. Switch to a project mode, eg 'openshift-console', the resources in the project showed in list.
Screenshot from 2025-12-11 19-18-39
Screenshot from 2025-12-11 19-18-52

The bug is fixed.
/verified by yanpzhan

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 335ed77 and 2 for PR HEAD 9dfa8c0 in total

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Dec 11, 2025

/retest-required

@rhamilto
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 12, 2025

@rhamilto: The following test 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-gcp-console 9dfa8c0 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-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-67004, 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 Author

Duplicates #15789. @TheRealJon, mind adding the test fixes to your PR?

@rhamilto rhamilto closed this Dec 12, 2025
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-67004. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

After

Screen.Recording.2025-12-09.at.10.40.39.AM.mov

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-important Referenced Jira bug's severity is important 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.

6 participants