Let's make sure to have adequate test coverage for this.
The issue is that the user in question does not appear in the member list via the UI or the API and evidence that they have access to these groups can only be seen on their profile page. Even checking their access via the admin area shows that they aren't listed as having access. If the user is impersonated by an admin though the three subgroups appear as groups they have access to.
However, as mentioned in the original test plan, we should add an end to end test for the happy path for share groups with groups feature but that should be tracked under ~"Quality:test-gap" and would be unrelated to this issue. I have created an issue for it here: gitlab-org/gitlab#205259 (moved)
With @cmaxim we are working on writing security tests.
At the moment we are doing end-to-end tests, but we have been told that due to the important amount of tests required to test the access permutations and inheritance (~300 tests), end-to-end tests may not be adequate for that. Those tests would need to be run whenever a change is made in groups and their permissions to ensure we are not breaking how it is supposed to be working. Any suggestions?
@sliaquat, yeah, spec/lib/gitlab/project_authorizations_spec.rb might be a good start, although I am not sure about every permutations. We should test various code paths there and I guess most of the 300 cases are redundant from that perspective. Also, that class is for testing project access. For group access, most of them are in spec/models/group_spec.rb and spec/policies/group_policy_spec.rb.
cc @jeremymatos, as you are also working on something similar.
We have a couple of engineers that are working to build out a test suite that will provide as much coverage as we can define for the group sharing feature. I know they have reached out to some QA engineers already for assistance.
Latest update is in gitlab-org/gitlab!26066 (closed) the app sec team is working on ~300 new tests for user access permutations.
Let's help the team to be more efficient by dissecting these tests into unit and integration test layer. These are very top heavy in the pyramid currently.
@at.ramya I am pushing this to end of Q2, I hope that once we fill the SET for groupimport that can free up Sanad to fully take on a deep dive in the ~"group::access" and it's permission test gaps.
We need to work with AppSec as well. The recent incident on CI tokens was a downstream implication from a security fix to very high GMAU groups in the verify stage (broken tokens) due to a change from the ~access::group. Much headroom for improvement opportunities here for the team #10546 (closed).