OCPBUGS-88739: Projects cannot be filtered by display name#16632
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe ChangesDisplay-name filter support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@cajieh: This pull request references Jira Issue OCPBUGS-88739, 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. |
|
/jira refresh |
|
@cajieh: This pull request references Jira Issue OCPBUGS-88739, which is valid. The bug has been moved to the POST state. 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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In
`@frontend/packages/console-app/src/components/data-view/__tests__/useConsoleDataViewFilters.spec.tsx`:
- Around line 171-181: The exact-search test in the hook "should filter by
openshift.io/display-name using exact matching when exact search is enabled"
does not sufficiently validate true exact-match behavior. The current query
parameter of 'Test' expecting one result could pass even if substring matching
is used. Strengthen the test by using a full display-name value query in the
positive assertion case, and add a separate negative assertion that queries with
a partial string (that would match via substring but not exact matching) to
confirm it returns zero results when exact search is enabled. This ensures the
test catches regressions in exact-mode behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 43ba9643-a970-4b45-b68a-8903e6daa6b5
📒 Files selected for processing (3)
frontend/packages/console-app/src/components/data-view/__tests__/useConsoleDataViewFilters.spec.tsxfrontend/packages/console-app/src/components/data-view/useConsoleDataViewFilters.tsfrontend/packages/console-dynamic-plugin-sdk/src/api/internal-types.ts
ea2528f to
8e181f1
Compare
|
@cajieh: This pull request references Jira Issue OCPBUGS-88739, 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. |
e8e1ee9 to
7e037de
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In
`@frontend/packages/console-app/src/components/data-view/__tests__/useConsoleDataViewFilters.spec.tsx`:
- Around line 173-195: The tests for exact matching behavior (at lines 173-195)
are not truly validating exact matching because the `useExactSearch` mock is
configured with substring semantics using `.includes()`. To fix this, update the
mock configuration for exact-mode tests to use strict equality checking instead
of substring matching, or add a negative test assertion that would fail under
substring semantics (for example, assert that a partial match like "my test"
returns zero results while "My Test Project" returns one result). This ensures
that exact-mode regressions cannot slip through and the tests actually validate
the intended exact-matching behavior rather than substring matching behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 26dd1e4a-8f1a-4c9d-b02e-dee7d2fd082a
📒 Files selected for processing (3)
frontend/packages/console-app/src/components/data-view/__tests__/useConsoleDataViewFilters.spec.tsxfrontend/packages/console-app/src/components/data-view/useConsoleDataViewFilters.tsfrontend/packages/console-dynamic-plugin-sdk/src/api/internal-types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- frontend/packages/console-dynamic-plugin-sdk/src/api/internal-types.ts
- frontend/packages/console-app/src/components/data-view/useConsoleDataViewFilters.ts
|
|
||
| const createWrapper = (initialEntries: string[] = ['/']): FC<{ children: ReactNode }> => { | ||
| const Wrapper: FC<{ children: ReactNode }> = ({ children }) => ( | ||
| <MemoryRouter initialEntries={initialEntries}>{children}</MemoryRouter> |
There was a problem hiding this comment.
Since useConsoleDataViewFilters only depends on React Router, using the heavy renderHookWithProviders setup is unnecessary here. I've opened CONSOLE-5360 to introduce a lightweight renderHookWithRouter helper in a follow-up PR to clean up this boilerplate.
|
/retest |
|
/test e2e-gcp-console /test e2e-playwright |
|
Thanks for fixing this regression! One suggestion: the You could keep this fix internal by extracting the display name directly inside the filter callback in |
7e037de to
e32b807
Compare
Restore display-name matching in useConsoleDataViewFilters to match legacy project-name filter behavior after Projects list migration to ConsoleDataView. Co-authored-by: Cursor <cursoragent@cursor.com>
e32b807 to
9795a13
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cajieh, rhamilto 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 |
|
@cajieh: 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. |
|
/verified by @cajieh |
|
@cajieh: 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. |
|
/retest |



The users are unable to filter projects by display name on the Projects list page ({{/k8s/cluster/projects}}) in the OpenShift 4.21 console. This functionality was available in previous versions. When a user types a project's display name (e.g., "My Test Project") in the filter toolbar, no results are shown even though a project with that display name exists. Only filtering by the actual project name ({{metadata.name}}) works.
Analysis / Root cause:
The migration to the new ConsoleDataView component likely lost the display name filtering capability for Projects and Namespaces.
Solution description:
Screenshots / screen recording:


Before:
After:

Test setup:
N/A
Test cases:
N/A
Browser conformance:
N/A
Additional info:
N/A
Reviewers and assignees:
Summary by CodeRabbit