From a7c0170dd14a64d062099714dd26f3c4c6ba95aa Mon Sep 17 00:00:00 2001 From: abhiarora-ag <91519184+abhiarora-ag@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:47:50 +0530 Subject: [PATCH] Event type for framework is updated This commit adds event type for 'framework id updated' in audit event Changelog: changed EE: true --- ee/lib/audit/compliance_framework_changes_auditor.rb | 3 ++- .../lib/audit/compliance_framework_changes_auditor_spec.rb | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ee/lib/audit/compliance_framework_changes_auditor.rb b/ee/lib/audit/compliance_framework_changes_auditor.rb index a9d7a6d06b6241..81aa8bd4cd2fea 100644 --- a/ee/lib/audit/compliance_framework_changes_auditor.rb +++ b/ee/lib/audit/compliance_framework_changes_auditor.rb @@ -22,7 +22,8 @@ def execute ::Gitlab::Audit::Auditor.audit(audit_context) else - audit_changes(:framework_id, as: 'compliance framework', model: model, entity: @project) + audit_changes(:framework_id, as: 'compliance framework', model: model, entity: @project, + event_type: 'compliance_framework_id_updated') end end diff --git a/ee/spec/lib/audit/compliance_framework_changes_auditor_spec.rb b/ee/spec/lib/audit/compliance_framework_changes_auditor_spec.rb index bc9c36cd56f055..a37adbf8a451bd 100644 --- a/ee/spec/lib/audit/compliance_framework_changes_auditor_spec.rb +++ b/ee/spec/lib/audit/compliance_framework_changes_auditor_spec.rb @@ -32,6 +32,13 @@ to: 'GDPR' }) end + + it 'streams correct audit event stream' do + expect(AuditEvents::AuditEventStreamingWorker).to receive(:perform_async).with( + 'compliance_framework_id_updated', anything, anything) + + subject.execute + end end end -- GitLab