Skip to content

Convert gql id to normal id in admin role promotion requests

Ammar Alakkad requested to merge 473386-convert-gql-id-to-normal-id into master

What does this MR do and why?

It fixes passing the user id down to the <user-avatar> component, so the component's popover would show properly instead of being stuck at loading state.

The MR doesn't include a changelog since the change is behind a feature flag.

Alternative Solution

We could adjust the <user-avatar> component to always use getIdFromGraphQLId on the provided user.id, but that could be unnecessary since the component is only used a few times.

If we found ourselves using it more often and having to convert the id from gid to normal id we can consider moving that logic to be inside the <user-avatar> component.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-08-09_at_11.55.13 Screenshot_2024-08-09_at_11.54.42

How to set up and validate locally

  1. Have an Ultimate License, and simulate Ultimate Self Managed setup (export GITLAB_SIMULATE_SAAS=0 gdk restart)
  2. Enable the Setting ApplicationSetting.first.update!(enable_member_promotion_management: true)
  3. Enable feature flag Feature.enable(:member_promotion_management)
  4. Create promotion requests:
    1. visit a group as an owner (e.g. http://gdk.test:3000/groups/gitlab-org/-/group_members)
    2. promote a non-billable GUEST member to a DEVELOPER role (this member should be non-billable on the whole instance, i.e. have a highest role as guest, see !149094 (comment 1869616221) for details)
    3. you should see a banner saying "Role change request was sent to the administrator." — this means a promotion request has been created
  5. As root go to Admin area > Users > Promotion Requests (e.g. http://gdk.test:3000/admin/role_promotion_requests)
  6. Verify the users popover is working properly

To get a list of non-billable users:

User.non_billable_users_for_billable_management(User.all.pluck(:id))

Related to #473386 (closed)

Edited by Ammar Alakkad

Merge request reports

Loading