diff --git a/config/audit_events/types/selective_code_owner_removals_updated.yml b/config/audit_events/types/selective_code_owner_removals_updated.yml new file mode 100644 index 0000000000000000000000000000000000000000..06cf99cf38edb86c698cdd8660e2f4780bed3ede --- /dev/null +++ b/config/audit_events/types/selective_code_owner_removals_updated.yml @@ -0,0 +1,10 @@ +--- +name: selective_code_owner_removals_updated +description: Event triggered when selective code owner removal is updated +introduced_by_issue: https://gitlab.com/gitlab-org/gitlab/-/issues/327562 +introduced_by_mr: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148743 +feature_category: code_review_workflow +milestone: '17.0' +saved_to_database: true +streamed: true +scope: [Project] diff --git a/doc/administration/audit_event_types.md b/doc/administration/audit_event_types.md index 83cda27a0b9f28d6353052ff8d09554edecc29d0..d173e90bc2569f1907c5c09453db48a44ab1fa64 100644 --- a/doc/administration/audit_event_types.md +++ b/doc/administration/audit_event_types.md @@ -103,6 +103,7 @@ Audit event types belong to the following product categories. | [`project_merge_requests_template_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84624) | Whenever a MR template is updated for a project, this audit event is created| **{check-circle}** Yes | **{check-circle}** Yes | GitLab [15.0](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) | Project | | [`project_remove_source_branch_after_merge_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/83922) | Create this audit event whenever a project has its setting to remove branches after merges modified| **{check-circle}** Yes | **{check-circle}** Yes | GitLab [14.10](https://gitlab.com/gitlab-org/gitlab/-/issues/301124) | Project | | [`project_reset_approvals_on_push_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66234) | Create this audit event whenever a project has its setting on whether approvals are reset on a push is updated| **{check-circle}** Yes | **{check-circle}** Yes | GitLab [14.2](https://gitlab.com/gitlab-org/gitlab/-/issues/336211) | Project | +| [`selective_code_owner_removals_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148743) | Event triggered when selective code owner removal is updated| **{check-circle}** Yes | **{check-circle}** Yes | GitLab [17.0](https://gitlab.com/gitlab-org/gitlab/-/issues/327562) | Project | ### Code suggestions diff --git a/ee/lib/audit/project_setting_changes_auditor.rb b/ee/lib/audit/project_setting_changes_auditor.rb index ac39b9cf6bc32f36f25469602a1dff072b8ef690..ee552cc85321d9a6d1a606f0ed705d3bc0b1dab9 100644 --- a/ee/lib/audit/project_setting_changes_auditor.rb +++ b/ee/lib/audit/project_setting_changes_auditor.rb @@ -39,6 +39,13 @@ def execute model: model, event_type: 'duo_features_enabled_updated' ) + audit_changes( + :selective_code_owner_removals, + as: 'selective_code_owner_removals', + entity: @project, + model: model, + event_type: 'selective_code_owner_removals_updated' + ) end def attributes_from_auditable_model(column) diff --git a/ee/spec/lib/audit/project_setting_changes_auditor_spec.rb b/ee/spec/lib/audit/project_setting_changes_auditor_spec.rb index 04f0366d560b892f7979e3be841d36b07ecad1f1..b0da517555c669a61259ffa687e5ea2bd4f1d2d4 100644 --- a/ee/spec/lib/audit/project_setting_changes_auditor_spec.rb +++ b/ee/spec/lib/audit/project_setting_changes_auditor_spec.rb @@ -110,6 +110,10 @@ it_behaves_like 'audited setting', :duo_features_enabled, 'duo_features_enabled_updated' it_behaves_like 'audited setting', :allow_merge_on_skipped_pipeline, 'allow_merge_on_skipped_pipeline_updated' end + + context 'when `selective_code_owner_removals` is updated' do + it_behaves_like 'audited setting', :selective_code_owner_removals, 'selective_code_owner_removals_updated' + end end end end