Use the right API for group list_selector inside branch rule drawer

What does this MR do and why?

This MR solves point 4 of #470867 (closed)

  • introduce the same API for searching groups, that is used on Project / Settings / Repository / Protected branches to list_selector shared component
  • add search parameter to that API
  • add documentation for list_selector shared component

A previously used endpoint allowed to select the group that owns the project to Allowed to merge and Allowed to push and merge branch protection. This however was throwing an error from the backend.

Query plan: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/30636/commands/95087

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.

Before After
Screenshot_2024-08-06_at_15.44.47 Screenshot_2024-08-06_at_15.39.37

How to set up and validate locally

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

  1. In rails console enable the experiment fully
    Feature.enable(:edit_branch_rules)
  2. Invite another group to a project.
  3. Go to Project / Settings / Repository and expand Branch rules section
  4. Select View details of a branch rule you have defined or add new branch rule.
  5. In Allowed to merge or Allowed to push and merge section click Edit
  6. Start searching for a group, add a group and then save changes. You should be able to see the group you invited, but not the group that owns the project.

Related to #470867 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports

Loading