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:
- Enable the
beyond_identity_exclusions
feature flag - Navigate to Admin > Settings > Integrations
- Click on Beyond Identity > Configure
- Click on the Exclusions tab
- Click on Add exclusions to open the Add exclusions Drawer
- Search and select Projects in the drawer
- Click on Add exclusions, try selecting a group
To check the selector used for MR approval rules and branch protection rules
- Open Rails console. In your terminal:
rails c
- Enable the feature flag:
Feature.enable(:edit_branch_rules)
- In a project, go to Settings / Repository
- Expand Branch rules section and choose View details for one of the rules
- Create Allowed to merge rule, try selecting a group
- Create a new Merge Request approval rule for a specific branch, try selecting a group
Related to #467343 (closed)