Skip to content

Replacing AuditEventService with Gitlab::Audit::Auditor

What does this MR do and why?

  1. Replacing AuditEventService with Gitlab::Audit::Auditor. Added event type inactive_project_scheduled_for_deletion.
  2. Streaming events will have the event type as inactive_project_scheduled_for_deletion instead of audit_operation being sent previously.

DB diff

target_details changed from project's path to project's name. For the above it changed from 'shanika/gitlab-shell' to 'GitLab Shell'.

Before
-[ RECORD 1 ]--+-------------------------------------------------------------------------------------
id             | 813
author_id      | 52
entity_id      | 18
entity_type    | Project
details        | ---                                                                                 +
               | :custom_message: Project is scheduled to be deleted on 2023-10-01 due to inactivity.+
               | :author_name: GitLab Admin Bot                                                      +
               | :target_id: 18                                                                      +
               | :target_type: Project                                                               +
               | :target_details: shanika/gitlab-shell                                               +
               | :ip_address:                                                                        +
               | :entity_path: shanika/gitlab-shell                                                  +
               |
ip_address     |
author_name    | GitLab Admin Bot
entity_path    | shanika/gitlab-shell
target_details | shanika/gitlab-shell
created_at     | 2023-09-01 13:47:44.137986
target_type    | Project
target_id      | 18
After
-[ RECORD 1 ]--+-------------------------------------------------------------------------------------
id             | 827
author_id      | 52
entity_id      | 18
entity_type    | Project
details        | ---                                                                                 +
               | :author_name: GitLab Admin Bot                                                      +
               | :author_class: User                                                                 +
               | :target_id: 18                                                                      +
               | :target_type: Project                                                               +
               | :target_details: Gitlab Shell                                                       +
               | :custom_message: Project is scheduled to be deleted on 2023-10-01 due to inactivity.+
               | :ip_address:                                                                        +
               | :entity_path: shanika/gitlab-shell                                                  +
               |
ip_address     |
author_name    | GitLab Admin Bot
entity_path    | shanika/gitlab-shell
target_details | Gitlab Shell
created_at     | 2023-09-01 13:52:53.141392
target_type    | Project
target_id      | 18

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable inactive project deletion feature.
  2. Run the cron manually using the sidekiq admin dashboard.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #423263 (closed)

Edited by Huzaifa Iftikhar

Merge request reports

Loading