Skip to content

"Search groups" in both Project & Group members doesn't allow to search for parent groups

What does this MR do and why?

As per #427782 (closed), we're unable to search for groups based on parent's name.

This MR solves the issue.

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

Before After
image image
image image

Query Plan

Before After
SELECT "group_group_links".* FROM (SELECT DISTINCT ON (shared_with_group_id) * FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 10519 ORDER BY shared_with_group_id, group_access DESC, expires_at DESC, created_at ASC) group_group_links INNER JOIN "namespaces" ON "namespaces"."id" = "group_group_links"."shared_with_group_id" AND "namespaces"."type" = 'Group' WHERE "namespaces"."type" = 'Group' AND "namespaces"."type" != 'Project' AND ("namespaces"."path" ILIKE '%SEARCH%' OR "namespaces"."name" ILIKE '%SEARCH%') SELECT "group_group_links".* FROM (SELECT DISTINCT ON (shared_with_group_id) * FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 10519 ORDER BY shared_with_group_id, group_access DESC, expires_at DESC, created_at ASC) group_group_links INNER JOIN "namespaces" ON "namespaces"."id" = "group_group_links"."shared_with_group_id" AND "namespaces"."type" = 'Group' WHERE "namespaces"."type" = 'Group' AND "namespaces"."type" != 'Project' AND "namespaces"."id" IN (SELECT "routes"."source_id" FROM "routes" WHERE "routes"."source_type" = 'Namespace' AND ("routes"."path" ILIKE '%SEARCH%' OR "routes"."name" ILIKE '%SEARCH%'))
https://postgres.ai/console/gitlab/gitlab-production-main/sessions/31235/commands/96980 https://postgres.ai/console/gitlab/gitlab-production-main/sessions/31235/commands/96979

How to set up and validate locally

  1. Checkout the branch
  2. Follow the steps-to-reproduce

Related to #427782 (closed)

Edited by Bojan Marjanovic

Merge request reports

Loading