Skip to content

Exclude ProjectNamespaces from GraphQL namespace results

What does this MR do and why?

Exclude ProjectNamespace from GraphQL results for Namespace.

The GraphQL version of the API MR -> !73296 (merged)

How to set up and validate locally

Sample query:

query {
  namespace(fullPath: "group") 
  {
    name
    fullPath
  }
}
  1. Log in to your local instance and go to graphql-explorer (https://gdk.test:3000/-/graphql-explorer)
  2. Find some project project in console that your logged in user can access
    project = Project.last
  3. Create a project namespace in the console and associate it to project. Test the query above with the full_path of that ProjectNamespace - you should get nil as a response.
    Namespaces::ProjectNamespace.create(project: project, parent: project.group, visibility_level: project.visibility_level, name: project.name, path: project.path, type: Namespaces::ProjectNamespace.sti_name, owner: nil)
  4. Find a group group the logged in user can access and a user namespace associated with them. Test with the full_path of each. You should get a non-nil result for both.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #341823 (closed)

Edited by charlie ablett

Merge request reports

Loading