Skip to content

Refactor default and custom roles GraphQL queries

What does this MR do and why?

In the app, we have default roles (also called standard roles) and custom roles (also called member roles). Default roles are the built-in ones like Guest, Reporter, Developer, etc. Custom roles are created by the user. We need to fetch these roles through GraphQL so that they can be shown on the Settings -> Roles and permissions page:

ksnip_20241023-133244

In a previous MR, we made some changes to the backend that lets us clean up the frontend GraphQL queries. This MR does the cleanup:

  1. Combined standard_roles.fragment.graphql and member_role.fragment.graphql into a single role.fragment.graphql.

  2. Renamed group_member_roles.query.graphql and instance_member_roles.query.graphql to group_roles.query.graphql and instance_roles.query.graphql. The queries fetch both default roles and custom roles.

  3. Renamed CustomRolesApp to RolesApp because it shows both default roles and custom roles, not just custom roles.

How to set up and validate locally

This is a refactor, so we just need to confirm that the current functionality still works. For self-managed, follow the repro steps in this video:

2024-10-23_13-42-59

For SaaS, first run these shell commands:

export GITLAB_SIMULATE_SAAS=1
gdk restart

Then follow the repro steps in this video:

2024-10-23_13-44-51

Related to #468398

Edited by Daniel Tian

Merge request reports

Loading