Skip to content

Extract members_with_parents into another class

Thong Kuah requested to merge extract_members_with_parents_finder into master

What does this MR do and why?

NOTE: It will be easier to review commit-by-commit

Related issue: #422405 (closed), #417455 (closed), https://gitlab.com/gitlab-org/gitlab/-/issues/421527

Extract members_with_parents into another class

Reduces the size of the Group class. We move code that is not strictly related to a group to its own class - this code is more to do with the hierarchy of groups' members.

Why? See https://docs.gitlab.com/ee/development/software_design.html#taming-omniscient-classes

Also it will make Cells: Fix cross-joins arising from members (#422405 - closed) easier to fix

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Method Before After Notes and formatted queries
EE #member? https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75906
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75907
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75900 !135328 (comment 1632614420)
members_with_parents(only_active_users: true) https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75903 https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75901 !135328 (comment 1632614494)
members_with_parents(only_active_users: false) https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75904 https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75902 !135328 (comment 1632614494)
authorizable_members_with_parents https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75923 https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23618/commands/75922 !135328 (comment 1632614537)

How to set up and validate locally

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

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports