Improve query in Projects::ParticipantsService
What does this MR do and why?
Instead of querying for the different types of project members we can
just use the authorized_projects
table.
This fixes a case where invited group members of an invited group were not included in the list.
Query changes
Before, we had to do 2 queries to fetch the members. Invited groups had to be plucked here first: https://gitlab.com/gitlab-org/gitlab/-/blob/837b7c68aaecf4b808d493a8bf08aab00ccb20f0/app/services/projects/participants_service.rb#L43
- https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/20465/commands/67007
- https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/20465/commands/67008
New query: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/20465/commands/67011
How to set up and validate locally
- Create
group1
and adduser1
as a member - Create
group2
and invitegroup1
as a member - Create
project1
and invitegroup2
as a member - In an issue under
project1
, type@
to load the user autocomplete.user1
should be included in the list.
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 #417757 (closed)
Edited by Heinrich Lee Yu