Skip to content

Conversation

@logonoff
Copy link
Member

In the search page, useParams was returning undefined. Switching to useActiveNamespace returns the correct namespace.

/assign @rhamilto

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate 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 Nov 14, 2025
@openshift-ci-robot
Copy link
Contributor

@logonoff: This pull request references Jira Issue OCPBUGS-65628, 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.

In response to this:

In the search page, useParams was returning undefined. Switching to useActiveNamespace returns the correct namespace.

/assign @rhamilto

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.

@logonoff
Copy link
Member Author

/jira refresh

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

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

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 November 14, 2025 14:25
@rhamilto
Copy link
Member

/lgtm

giphy

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 14, 2025
@logonoff
Copy link
Member Author

/assign @yanpzhan

@logonoff logonoff force-pushed the OCPBUGS-65628-namespace branch from 9041ff9 to ef08ea2 Compare November 15, 2025 15:33
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2025
@rhamilto
Copy link
Member

/lgtm
/retest

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

openshift-ci bot commented Nov 16, 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

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

/retest

@logonoff
Copy link
Member Author

/assign @yapei

@yanpzhan
Copy link
Contributor

Checked on cluster launched against the pr, normal user could search pod correctly. The issue is fixed.
/verified by yanpzhan

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

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

In response to this:

Checked on cluster launched against the pr, normal user could search pod correctly. The issue 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.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

The namespace retrieval method in the search component is refactored from reading URL parameters via useParams to using the useActiveNamespace hook, changing how the namespace is obtained and passed down to ResourceList.

Changes

Cohort / File(s) Summary
Namespace source refactoring
frontend/public/components/search.tsx
Replaced useParams namespace extraction with useActiveNamespace hook imported from @console/dynamic-plugin-sdk/src/lib-core. The namespace is now obtained via the hook and passed to ResourceList, altering the control flow for namespace resolution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify that useActiveNamespace hook provides the same data structure and type as the previous useParams approach to ensure no runtime issues
  • Confirm ResourceList properly receives and consumes the namespace through the new prop flow
✨ 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 be62fbb and ef08ea2.

📒 Files selected for processing (1)
  • frontend/public/components/search.tsx (2 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/public/components/search.tsx
🔇 Additional comments (3)
frontend/public/components/search.tsx (3)

51-51: LGTM: Correct hook imported for namespace tracking.

The addition of useActiveNamespace to the imports is appropriate for obtaining the active namespace context in the console.


97-97: Correct fix for the namespace retrieval bug.

Using useActiveNamespace is the proper approach for obtaining the active namespace in the OpenShift console. This correctly addresses the issue where useParams was returning undefined, as mentioned in OCPBUGS-65628.


337-337: Namespace properly propagated to ResourceList.

The namespace is correctly passed down from the useActiveNamespace hook to the ResourceList component, ensuring that namespaced resources are filtered appropriately.


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

@rhamilto
Copy link
Member

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 86c7b34 and 2 for PR HEAD ef08ea2 in total

@logonoff
Copy link
Member Author

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD f2eb83d and 1 for PR HEAD ef08ea2 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

@logonoff: 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/okd-scos-e2e-aws-ovn 9041ff9 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

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

/retest-required

Remaining retests: 0 against base HEAD 057ffde and 0 for PR HEAD ef08ea2 in total

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/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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. 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.

5 participants