Skip to content

Use Group#all_projects instead of self_and_descendants in finders

In https://gitlab.com/gitlab-com/gl-infra/production/-/issues/3894, we found that query plans using self_and_descendants as a subquery in an IN () clause may trigger a PostgreSQL v11 query planner bug. !56078 (merged) works around this issue, but finders may have to take advantage of this by calling Group#all_projects instead of base_and_descendants.

We fixed one example in Maven (!56346 (merged)), but we do have of other locations where this may be an issue:

Proposal

Update all relevant finders:

# git grep --name-only self_and_descendants | grep finders
Edited by Andrew Newdigate