Link issues to compliance violations

What does this MR do and why?

This MR allows users to link issues with the compliance violation.

How to set up and validate locally

  1. You need to have a group with Ultimate license.
  2. You need to have at least one project under the group, atleast one audit event related to the project. Also, there should be atleast one issue under the project.
  3. Also, have at least one compliance framework in the group, the framework should have atleast one compliance control.
  4. The framework should be applied to the project.
  5. Now create a compliance violation entry in the database by running following command in the rails console:
   ComplianceManagement::Projects::ComplianceViolation.create(project_id: <project_id>, namespace_id: <namespace_id>, audit_event_id: <audit_event_id>, compliance_requirements_control_id: <compliance_requirements_control_id>, status: 0, audit_event_table_name: 0)
  1. Now, run the following mutation to link the project's issue to the compliance violation.
mutation linkViolationIssue {
  linkProjectComplianceViolationIssue(input: {
    violationId: "gid://gitlab/ComplianceManagement::Projects::ComplianceViolation/<id>",
    issueIid: "<iid>",
    projectPath: "<issue_project_full_path>"
  }
  ) {
    violation {
      id
      status
      issues {
        nodes {
          id
          title
        }
      }
    }
    errors
  }
}

MR acceptance checklist

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

Related to #538574 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports

Loading