Move groups logic for user search to model
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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #377587 (closed)