members/all seems miss some inherited member

Summary

API endpoint /projects/ID/members/all does not list members of all ancestor groups.

Steps to reproduce

Consider the following setup:

  • Groups: G1, G2
  • Project: P1
  • Users: U1, U2

With the following relationships

  • Group G1 is "member" of P1
  • Group G2 is "member" of G1
  • User U1 is member of P1, U2 member of G2

Results in

  • Request /projects/P1/members/all will return only U1.

Example Project

What is the current bug behavior?

  • Request /projects/P1/members/all will return only U1.

What is the expected correct behavior?

  • Request /projects/P1/members/all should return U1, U2(by U2 -> G2 -> G1 -> P1)

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖