Skip to content

Allow adding comments to compliance violations

What does this MR do and why?

  1. This is the first step towards allowing adding comments to project compliance violations

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Run the following commands in rails console. This assumes you have ultimate license, created at least one compliance framework with requirements and control.
p = Project.find(20)
n = p.namespace
a = AuditEvent.last
framework = ComplianceManagement::Framework.first
cr = framework.compliance_requirements.first
control = cr.compliance_requirements_controls.last

violation = ComplianceManagement::Projects::ComplianceViolation.create!({project_id: p.id, namespace_id: n.id, audit_event_id: a.id, compliance_requirements_control_id: control.id, status: :detected})

violation.notes.create!({author_id: 1, note: "This is a critical violation @root. We need to also fix it i
n flightjs/blank-project>", project_id: violation.project_id})

# validate that note was created
violation.notes

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

Edited by Huzaifa Iftikhar

Merge request reports

Loading