Preload root ancestors for group labels in LabelsPreloader

What does this MR do and why?

EE::Preloaders::LabelsPreloader already preloads root ancestors and saml_provider for project labels' groups, but not for group labels' groups. GroupPolicy then runs two queries per subgroup that owns a returned label (root_ancestor and saml_providers) when includeDescendantGroups is true.

This change preloads the same associations for group labels' groups, adds a QueryRecorder example on the group labels GraphQL query, and drops the threshold: 4 allowance from the MCP search_labels N+1 example.

Closes #635535 (closed)

How to set up and validate locally

bin/rspec ee/spec/requests/api/graphql/group/labels_query_spec.rb
bin/rspec ee/spec/services/ee/mcp/tools/labels/search_service_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Merge request reports

Loading
Loading