Skip to content

Added mutation for destroying compliance requirements

What does this MR do and why?

Mutation for destroying compliance requirements.

Database

Query:

DELETE FROM "compliance_requirements" WHERE "compliance_requirements"."id" = 1000002

Query plan: https://postgres.ai/console/gitlab/gitlab-production-main/sessions/33313/commands/102766

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. You need to have a group with Ultimate license.
  2. Make sure the group has at least one compliance framework associated with it. If not then you can follow steps mentioned here for creating one.
  3. Now create a compliance requirement for the framework by running following mutation:
mutation createComplianceRequirement {
  createComplianceRequirement(
    input: {
      complianceFrameworkId: "gid://gitlab/ComplianceManagement::Framework/<framework_id>",
      params: {
        name: "Custom req 3",
        description: "some description",
      }
    }) {
    errors
    requirement {
      id
      name
      description
    }
  }
}
  1. Now let's destroy this requirement by running following mutation, it should return empty errors array.
mutation destroyComplianceRequirement {
  destroyComplianceRequirement(
    input: {
      id: "gid://gitlab/ComplianceManagement::ComplianceFramework::ComplianceRequirement/<requirement_id>"
  }) {
    errors
  }
}

Related to #470695 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports

Loading