Filter out ProjectNamespaces for Namespace children association
What does this MR do and why?
Some scopes in Namespaces, particularly around Group/subgroup hierarchies, are called by logic that expects these objects to be Group objects themselves.
This MR filters ProjectNamespace objects from the the children
association.
Third bit of #341823 (closed)
Screenshots or screen recordings
n/a
How to set up and validate locally
Given the existing group structure (a parent group with a project and a subgroup as 'siblings') :
graph TD;
parent_group-->subgroup;
parent_group-->project;
- Create a ProjectNamespace for a project under
parent_group
and associate it:
ProjectNamespace.create(project: project, parent: parent_group, visibility_level: project.visibility_level, name: project.name, path: project.path, type: Namespaces::ProjectNamespace.sti_name, owner: nil)
The resulting structure should look like the following:
graph TD;
parent_group-->project_namespace;
parent_group-->subgroup;
project_namespace-->project;
parent_group-->project;
-
Call the scope
children
parent_group.children
-
The result set should not include
project_namespace
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #341823 (closed)
Edited by charlie ablett