Add Project Compliance Violations database table
What does this MR do and why?
- This is the first step towards adding the feature for project compliance violations as part of the epic &12774 (closed)
- This table would be used in the upcoming MRs.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
Run the following commands in Rails console to validate that the records being created.
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})
issue = p.issues.first
ComplianceManagement::Projects::ComplianceViolationIssue.create!({issue_id: issue.id, project_compliance_violation_id: violation.id, project_id: p.id})
violation.issues
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.
Closes #526131 (closed)
Edited by Huzaifa Iftikhar