Added audit event graphql type
What does this MR do and why?
Added audit event graphql type which is accessed from project compliance violation type.
How to set up and validate locally
- You need to have a group with Ultimate license.
- Required data, you can do either of following steps:
- You can checkout branch
hraghuvanshi-comp-violations-seeder
and run commandFILTER=compliance_report_data SEED_COMPLIANCE_REPORT_DATA=1 GROUPID=<group_id> bundle exec rake db:seed_fu
for filling required data and you can run query. - Create all items manually:
-
You need to have at least one project under the group, atleast one audit event related to the project.
-
Also, have at least one compliance framework in the group, the framework should have atleast one compliance control.
-
The framework should be applied to the project.
-
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)
-
- You can checkout branch
- Now run the following query by using the above compliance violation id in the graphql explorer, you should get all the details of the violation:
query projectComplianceViolation {
projectComplianceViolation(
id: "gid://gitlab/ComplianceManagement::Projects::ComplianceViolation/<id>"
) {
id
status
complianceControl {
id
name
}
project {
id
name
fullPath
webUrl
}
auditEvent {
id
eventName
targetId
targetDetails
targetType
details
ipAddress
entityPath
entityId
entityType
author {
id
name
}
project {
id
name
}
group {
id
name
}
user {
id
name
}
}
}
}
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 #542342 (closed)
Edited by Hitesh Raghuvanshi