Skip to content

Fetch only groups with project rights

What does this MR do and why?

List selector shared component for groups can fetch project only groups

Add option to independently select if a fetched groups are scoped to a project and if a dropdown to switch between scoped and unscoped groups should be shown. This change allows to limit the fetched groups and not allow the end user to change that scoping at the same time.

As a result you can have a group selector where:

  • you fetch all the existing groups
  • you fetch only groups for a specific project (previously not possible)
  • you allow user to switch between all groups and project scoped groups

Note: this is just a first step to remedy the bug. Here's the outline of what is needed for a full resolution.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Context Before After
Beyond identity integration (not scoped) before_beyond_identity after_beyond_identity
MR approval rules (scoped or all groups) before_mr_approval_rules after_MR_approval_rules
Branch rule drawer (only scoped) before_rule_drawer after_rule_drawer

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

To check the selector used for Beyond Identity integration:

  1. Enable the beyond_identity_exclusions feature flag
  2. Navigate to Admin > Settings > Integrations
  3. Click on Beyond Identity > Configure
  4. Click on the Exclusions tab
  5. Click on Add exclusions to open the Add exclusions Drawer
  6. Search and select Projects in the drawer
  7. Click on Add exclusions, try selecting a group

To check the selector used for MR approval rules and branch protection rules

  1. Open Rails console. In your terminal: rails c
  2. Enable the feature flag:
Feature.enable(:edit_branch_rules)
  1. In a project, go to Settings / Repository
  2. Expand Branch rules section and choose View details for one of the rules
  3. Create Allowed to merge rule, try selecting a group
  4. Create a new Merge Request approval rule for a specific branch, try selecting a group

Related to #467343 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports