Skip to content

Use GraphQL to fetch custom roles on Roles and Permissions page

Daniel Tian requested to merge 431713-use-graphql-to-fetch-custom-roles into master

What does this MR do and why?

For the Roles and Permissions page in a group's settings or the admin area, there's a table that shows created custom roles:

Group Roles and Permissions page Admin Area Roles and Permissions page
ksnip_20231207-023221 ksnip_20231207-023824

This MR switches the fetching of the custom roles data from REST to GraphQL.

How to set up and validate locally

For self-managed:

  1. Enable the custom_roles_ui_saas and custom_roles_ui_self_managed feature flags.
  2. Go to a top-level group and go to Settings -> Roles and Permissions.
  3. Create some custom roles using the Add new role button. Verify that they show up in the list.
  4. Go to Admin Area -> Settings -> Roles and Permissions.
  5. Use the group dropdown to select a group. Create some custom roles and verify that they show up in the list.

For SAAS:

  1. Run export GITLAB_SIMULATE_SAAS=1 in a terminal and restart gdk.
  2. Go to Admin Area -> Overview -> Groups. Click on the Edit button for a top-level group.
  3. Change the group's plan to Ultimate. Save the change.
  4. Go to Admin Area -> Settings -> Roles and Permissions.
  5. Use the group dropdown to select a group. Verify that it shows the "The {name} group is not in the ultimate tier" alert.
  6. Now select the group you changed to Ultimate tier. Verify that the alert is removed and it shows custom roles.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #431713 (closed)

Edited by Daniel Tian

Merge request reports