Skip to content

Update mutation to create project and assign security policy to a group

What does this MR do and why?

This change modifies mutations to assign security policy project and create security policy project. It changes the name of the argument from projectPath (and deprecates it) to fullPath. And allows to assign security policy project to a group (with feature flag enabled) and create security policy project for a group (with feature flag enabled).

Initially creating the policy project was extracted to separate MR: !83189 (closed), however they are tightly connected, so I've decided to proceed with review in single MR.

How to set up and validate locally

  1. Create a new group.
  2. Enable feature flag for your group in rails console: Feature.enable(:group_level_security_policies, group)
  3. Create a new project.
  4. Go to GraphQL Explorer and run:
mutation {
  securityPolicyProjectAssign(input: { fullPath: "your-group", securityPolicyProjectId: "gid://gitlab/Project/1" }) {
    errors
  }
}

and

mutation {
  securityPolicyProjectCreate(input: { fullPath: "your-group" }) {
    errors
    project {
      id
    }
  }
}

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 #347069 (closed)

Edited by Alan (Maciej) Paruszewski

Merge request reports