Skip to content

[release-4.18] OCPBUGS-81520: Console can only show user name instead of full name as the display name#16238

Open
Leo6Leo wants to merge 1 commit intoopenshift:release-4.18from
Leo6Leo:leo/OCPBUGS-70334/show-full-user-name/4.18
Open

[release-4.18] OCPBUGS-81520: Console can only show user name instead of full name as the display name#16238
Leo6Leo wants to merge 1 commit intoopenshift:release-4.18from
Leo6Leo:leo/OCPBUGS-70334/show-full-user-name/4.18

Conversation

@Leo6Leo
Copy link
Copy Markdown
Contributor

@Leo6Leo Leo6Leo commented Mar 31, 2026

Summary

Test plan

  • Verify the masthead toolbar displays the user's full name when set (e.g. via an identity provider that provides full names)
  • Verify the masthead toolbar falls back to username when no full name is available
  • Verify kube:admin still displays correctly
  • Verify telemetry events include the userResource data
  • Run unit tests: yarn test passes for useUser.spec.ts and useTelemetry.spec.ts

🤖 Generated with Claude Code

@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/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Mar 31, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@Leo6Leo: This pull request references Jira Issue OCPBUGS-81520, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.18.z) matches configured target version for branch (4.18.z)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-70335 is in the state Closed (Done), which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-70335 targets the "4.19.z" version, which is one of the valid target versions: 4.19.0, 4.19.z
  • bug has dependents

Requesting review from QA contact:
/cc @yanpzhan

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Test plan

  • Verify the masthead toolbar displays the user's full name when set (e.g. via an identity provider that provides full names)
  • Verify the masthead toolbar falls back to username when no full name is available
  • Verify kube:admin still displays correctly
  • Verify telemetry events include the userResource data
  • Run unit tests: yarn test passes for useUser.spec.ts and useTelemetry.spec.ts

🤖 Generated with Claude Code

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
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9e39a7b-7cef-4943-98c2-5562fda3cffd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci bot requested review from jhadvig, spadgett and yanpzhan March 31, 2026 20:16
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 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 spadgett 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 component/core Related to console core functionality component/sdk Related to console-plugin-sdk component/shared Related to console-shared kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Mar 31, 2026
@Leo6Leo Leo6Leo changed the title OCPBUGS-81520: Console can only show user name instead of full name as the display name [release-4.18] OCPBUGS-81520: Console can only show user name instead of full name as the display name Mar 31, 2026
@yanpzhan
Copy link
Copy Markdown
Contributor

yanpzhan commented Apr 1, 2026

@Leo6Leo There is error when building the code:

ERROR in packages/console-shared/src/hooks/__tests__/useUser.spec.ts:1:10
TS2305: Module '"react-redux"' has no exported member 'useSelector'.
  > 1 | import { useSelector, useDispatch } from 'react-redux';
      |          ^^^^^^^^^^^
    2 | import { useK8sGet } from '@console/internal/components/utils/k8s-get-hook';
    3 | import { testHook } from '../../../../../__tests__/utils/hooks-utils';
    4 | import { useUser } from '../useUser';

ERROR in packages/console-shared/src/hooks/__tests__/useUser.spec.ts:1:23
TS2305: Module '"react-redux"' has no exported member 'useDispatch'.
  > 1 | import { useSelector, useDispatch } from 'react-redux';
      |                       ^^^^^^^^^^^
    2 | import { useK8sGet } from '@console/internal/components/utils/k8s-get-hook';
    3 | import { testHook } from '../../../../../__tests__/utils/hooks-utils';
    4 | import { useUser } from '../useUser';

ERROR in packages/console-shared/src/hooks/__tests__/useUser.spec.ts:13:11
TS2339: Property 'requireActual' does not exist on type 'typeof jest'.
    11 |
    12 | jest.mock('react-redux', () => ({
  > 13 |   ...jest.requireActual('react-redux'),
       |           ^^^^^^^^^^^^^
    14 |   useSelector: jest.fn(),
    15 |   useDispatch: jest.fn(),
    16 | }));

ERROR in packages/console-shared/src/hooks/__tests__/useUser.spec.ts:28:11
TS2339: Property 'requireActual' does not exist on type 'typeof jest'.
    26 |
    27 | jest.mock('@console/dynamic-plugin-sdk', () => ({
  > 28 |   ...jest.requireActual('@console/dynamic-plugin-sdk'),
       |           ^^^^^^^^^^^^^
    29 |   getUser: jest.fn(),
    30 |   getUserResource: jest.fn(),
    31 |   setUserResource: (...args) => mockSetUserResource(...args),

ERROR in packages/console-shared/src/hooks/useUser.ts:3:10
TS2305: Module '"react-redux"' has no exported member 'useDispatch'.
    1 | import { useEffect } from 'react';
    2 | import { useTranslation } from 'react-i18next';
  > 3 | import { useDispatch, useSelector } from 'react-redux';
      |          ^^^^^^^^^^^
    4 | import { getUser, getUserResource, setUserResource } from '@console/dynamic-plugin-sdk';
    5 | import { useK8sGet } from '@console/internal/components/utils/k8s-get-hook';
    6 | import { UserModel } from '@console/internal/models';

ERROR in packages/console-shared/src/hooks/useUser.ts:3:23
TS2305: Module '"react-redux"' has no exported member 'useSelector'.
    1 | import { useEffect } from 'react';
    2 | import { useTranslation } from 'react-i18next';
  > 3 | import { useDispatch, useSelector } from 'react-redux';
      |                       ^^^^^^^^^^^
    4 | import { getUser, getUserResource, setUserResource } from '@console/dynamic-plugin-sdk';
    5 | import { useK8sGet } from '@console/internal/components/utils/k8s-get-hook';
    6 | import { UserModel } from '@console/internal/models';

@Leo6Leo Leo6Leo force-pushed the leo/OCPBUGS-70334/show-full-user-name/4.18 branch from b6d85f2 to 7ca39fc Compare April 1, 2026 18:31
…s the display name

Backport of OCPBUGS-56892 to release-4.18. Adds a centralized useUser hook
that fetches user resource and provides displayName, username, and fullName.
Updates the masthead toolbar to display the user's full name when available.

Co-Authored-By: Claude <noreply@anthropic.com>
@Leo6Leo Leo6Leo force-pushed the leo/OCPBUGS-70334/show-full-user-name/4.18 branch from 7ca39fc to 75656d9 Compare April 1, 2026 20:06
@openshift-ci openshift-ci bot added the component/topology Related to topology label Apr 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 2, 2026

@Leo6Leo: The following tests 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/frontend 75656d9 link true /test frontend
ci/prow/e2e-gcp-console 75656d9 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.

@yanpzhan
Copy link
Copy Markdown
Contributor

yanpzhan commented Apr 2, 2026

Checked on cluster launched against the pr, login with openid connect idp user, the full name is shown as expected.
/verified by @yanpzhan

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

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

Details

In response to this:

Checked on cluster launched against the pr, login with openid connect idp user, the full name is shown as expected.
/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.

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 component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology 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. 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