Skip to content

Conversation

@Leo6Leo
Copy link
Contributor

@Leo6Leo Leo6Leo commented Jan 13, 2026

Description

  • Redirecting the user to /projects page to prevent the users who are lacking the RBAC
  • Update the warning message with Allison’s proposed text: Impersonating a user grants you their exact permission. You must enter username, but you can also enter a group to simulate the permissions of a member of that group.

Summary by CodeRabbit

  • Bug Fixes

    • Post-impersonation now consistently redirects directly to the projects view, improving navigation after impersonation.
  • UI/UX Updates

    • Clarified impersonation modal text: now specifies that a username is required and explains how entering a group simulates group member permissions.

✏️ Tip: You can customize this high-level summary in your review settings.

@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 Jan 13, 2026
@openshift-ci-robot
Copy link
Contributor

@Leo6Leo: This pull request references Jira Issue OCPBUGS-65891, which is invalid:

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

Description

  • Redirecting the user to /projects page to prevent the users who are lacking the RBAC
  • Update the warning message with Allison’s proposed text: Impersonating a user grants you their exact permission. You must enter username, but you can also enter a group to simulate the permissions of a member of that group.
  • Fix the button styling
    • "Impersonate" button → Use PF primary button component
    • "Cancel" button → Use link button style

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 Jan 13, 2026

Walkthrough

The changes clarify the impersonation guidance text and update its localization, and modify the post-impersonation navigation to redirect explicitly to /k8s/cluster/projects instead of the base path.

Changes

Cohort / File(s) Summary
Impersonation Guidance & Localization
frontend/public/components/modals/impersonate-user-modal.tsx, frontend/public/locales/en/public.json
Alert copy expanded to state username is required and a group may be provided to simulate group permissions; localization string updated to match.
Post-Impersonation Navigation
frontend/public/components/masthead/masthead-toolbar.tsx
Redirect target after completing impersonation changed from the base path to the explicit /k8s/cluster/projects route.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: a follow-up to the multi-group impersonation feature with specific fixes for RBAC navigation, modal messaging, and button styling across three files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jan 13, 2026
@openshift-ci-robot
Copy link
Contributor

@Leo6Leo: This pull request references Jira Issue OCPBUGS-65891, 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.22.0) matches configured target version for branch (4.22.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:

Description

  • Redirecting the user to /projects page to prevent the users who are lacking the RBAC
  • Update the warning message with Allison’s proposed text: Impersonating a user grants you their exact permission. You must enter username, but you can also enter a group to simulate the permissions of a member of that group.
  • Fix the button styling
    • "Impersonate" button → Use PF primary button component
    • "Cancel" button → Use link button style

Summary by CodeRabbit

  • Bug Fixes

  • Fixed post-impersonation navigation to redirect directly to the projects view.

  • UI/UX Updates

  • Enhanced impersonation modal guidance with clearer information about required fields and how group impersonation works alongside user impersonation.

✏️ Tip: You can customize this high-level summary in your review settings.

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 openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jan 13, 2026
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Jan 13, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Leo6Leo
Once this PR has been reviewed and has the lgtm label, please assign rawagner for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-ci openshift-ci bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Jan 13, 2026
Copy link

@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

🤖 Fix all issues with AI agents
In @frontend/public/components/modals/impersonate-user-modal.tsx:
- Around line 239-241: Update the alert string in the ImpersonateUserModal where
title={t(...)} to use "permissions" (plural) and add "a" before "username" so
the text reads: "Impersonating a user grants you their exact permissions. You
must enter a username, but you can also enter a group to simulate the
permissions of a member of that group." Make the same edit in the corresponding
localization entry used by t(...) so both the component and the locale file are
consistent.

In @frontend/public/locales/en/public.json:
- Line 949: Update the localization value for the impersonation message (the
string starting "Impersonating a user grants you their exact permission. You
must enter username, but you can also enter a group to simulate the permissions
of a member of that group.") to correct the grammar: change "permission" to
"permissions" and "enter username" to "enter a username" so the final string
reads: "Impersonating a user grants you their exact permissions. You must enter
a username, but you can also enter a group to simulate the permissions of a
member of that group."
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 8c6b5f8 and 0c71911.

📒 Files selected for processing (3)
  • frontend/public/components/masthead/masthead-toolbar.tsx
  • frontend/public/components/modals/impersonate-user-modal.tsx
  • frontend/public/locales/en/public.json
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/public/components/modals/impersonate-user-modal.tsx (1)
frontend/__mocks__/i18next.ts (1)
  • t (8-14)
🔇 Additional comments (3)
frontend/public/components/modals/impersonate-user-modal.tsx (1)

356-369: LGTM! Button styling follows PatternFly conventions.

The "Impersonate" button correctly uses variant="primary" and the "Cancel" button uses variant="link", which aligns with the PR objectives and PatternFly best practices for modal actions.

frontend/public/components/masthead/masthead-toolbar.tsx (2)

855-856: Good RBAC-aware navigation change.

Redirecting to /k8s/cluster/projects after impersonation is a solid choice—it gives the impersonated user a clear view of their accessible namespaces/projects rather than potentially landing on a page they can't access.

One consideration: if the impersonated user has extremely restricted permissions (e.g., no list on projects), they may still see limited content. However, this is still a better UX than the previous approach since the projects page gracefully handles showing only accessible resources.


845-860: Impersonation handler logic is well-structured.

The conditional dispatch for UserWithGroups vs User based on group selection is correct. The flow properly:

  1. Dispatches the appropriate impersonation action
  2. Closes the modal
  3. Navigates to the projects page

The sequence ensures clean state transitions.

@openshift-ci-robot
Copy link
Contributor

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

Description

  • Redirecting the user to /projects page to prevent the users who are lacking the RBAC
  • Update the warning message with Allison’s proposed text: Impersonating a user grants you their exact permission. You must enter username, but you can also enter a group to simulate the permissions of a member of that group.

Summary by CodeRabbit

  • Bug Fixes

  • Fixed post-impersonation navigation to redirect directly to the projects view.

  • UI/UX Updates

  • Enhanced impersonation modal guidance with clearer information about required fields and how group impersonation works alongside user impersonation.

✏️ Tip: You can customize this high-level summary in your review settings.

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.

Copy link

@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: 1

🤖 Fix all issues with AI agents
In @frontend/public/components/modals/impersonate-user-modal.tsx:
- Around line 239-241: The user-facing sentence in the ImpersonateUserModal
title is missing the article "a"; update the string passed to t(...) in the
ImpersonateUserModal component (the title prop) to read "You must enter a
username" and also update the corresponding localization entry in public.json
(frontend/public/locales/en/public.json) so the i18n key/value matches the
corrected English text; ensure any other places using that localization key are
unaffected.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 0c71911 and 1209a2c.

📒 Files selected for processing (2)
  • frontend/public/components/modals/impersonate-user-modal.tsx
  • frontend/public/locales/en/public.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/public/locales/en/public.json
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/public/components/modals/impersonate-user-modal.tsx (1)
frontend/__mocks__/i18next.ts (1)
  • t (8-14)
🔇 Additional comments (3)
frontend/public/components/modals/impersonate-user-modal.tsx (3)

356-369: Button styling meets PR requirements.

The variant="primary" for the Impersonate button and variant="link" for Cancel aligns with PatternFly best practices and the stated PR objectives. The isDisabled binding to empty username state provides appropriate UX feedback. Good use of data-test attributes for e2e testing.


231-242: Solid modal structure with proper a11y considerations.

Good use of PatternFly's Modal composition with ModalHeader, ModalBody, and ModalFooter. The inline warning Alert appropriately sets user expectations about impersonation behavior before they interact with the form. The AlertVariant.warning is semantically correct for this cautionary guidance.


74-79: Group extraction handles load states correctly.

The useMemo dependency array correctly includes groupsLoaded and groupsLoadError, ensuring the derived availableGroups updates appropriately. Early return of empty array on error/loading prevents downstream issues. The sort provides consistent UX.

@yapei
Copy link
Contributor

yapei commented Jan 14, 2026

current changes including warning message and redirection update look good to me
Screenshot 2026-01-14 at 11 06 47 AM
Screenshot 2026-01-14 at 11 05 48 AM

@yapei
Copy link
Contributor

yapei commented Jan 14, 2026

/verified by @yapei

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

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

Details

In response to this:

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

@Leo6Leo
Copy link
Contributor Author

Leo6Leo commented Jan 14, 2026

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2026

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

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

Labels

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/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants