Skip to content

Move groups logic for user search to model

Madelein van Niekerk requested to merge 377587-user-group-refactor into master

What does this MR do and why?

Moves logic around as an iteration of #377587 (closed).

When performing a user search on a group level, we need to determine which groups are valid so that we can find the members of those groups and return them as users for the search.

Currently the logic sits in lib/gitlab/group_search_results.rb when performing a basic user search.

In %15.7 we will be adding advanced user search and need the same logic to determine valid groups. This MR moves the logic to a reusable place in preparation for advanced search.

Screenshots or screen recordings

The output of the new group specs explains some of the cases for determining valid groups:

Similarly, the output of the GroupSearchResult spec for users indicates the same logic:

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 #377587 (closed)

Edited by Madelein van Niekerk

Merge request reports

Loading