-
Notifications
You must be signed in to change notification settings - Fork 667
OCPBUGS-65891: Follow up on fixing the remaining issues in the multi-group impersonation feature #15916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
OCPBUGS-65891: Follow up on fixing the remaining issues in the multi-group impersonation feature #15916
Conversation
|
@Leo6Leo: This pull request references Jira Issue OCPBUGS-65891, 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. |
WalkthroughThe changes clarify the impersonation guidance text and update its localization, and modify the post-impersonation navigation to redirect explicitly to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
@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
Requesting review from QA contact: 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Leo6Leo The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this 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
📒 Files selected for processing (3)
frontend/public/components/masthead/masthead-toolbar.tsxfrontend/public/components/modals/impersonate-user-modal.tsxfrontend/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 usesvariant="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/projectsafter 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
liston 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
UserWithGroupsvsUserbased on group selection is correct. The flow properly:
- Dispatches the appropriate impersonation action
- Closes the modal
- Navigates to the projects page
The sequence ensures clean state transitions.
|
@Leo6Leo: This pull request references Jira Issue OCPBUGS-65891, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: 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.
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
📒 Files selected for processing (2)
frontend/public/components/modals/impersonate-user-modal.tsxfrontend/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 andvariant="link"for Cancel aligns with PatternFly best practices and the stated PR objectives. TheisDisabledbinding to empty username state provides appropriate UX feedback. Good use ofdata-testattributes for e2e testing.
231-242: Solid modal structure with proper a11y considerations.Good use of PatternFly's Modal composition with
ModalHeader,ModalBody, andModalFooter. The inline warning Alert appropriately sets user expectations about impersonation behavior before they interact with the form. TheAlertVariant.warningis semantically correct for this cautionary guidance.
74-79: Group extraction handles load states correctly.The
useMemodependency array correctly includesgroupsLoadedandgroupsLoadError, ensuring the derivedavailableGroupsupdates appropriately. Early return of empty array on error/loading prevents downstream issues. The sort provides consistent UX.
|
/verified by @yapei |
|
@yapei: 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-required |
|
@Leo6Leo: 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. |


Description
Summary by CodeRabbit
Bug Fixes
UI/UX Updates
✏️ Tip: You can customize this high-level summary in your review settings.