Skip to content

Replacing invalid audit event entity in project deletion with valid one

Hitesh Raghuvanshi requested to merge 415538-fixing-audit-event-entity into master

What does this MR do and why?

project_deleted audit event was introduced in MR !117546 (merged), it used audit event scope as UserNamespace in case the project owner is a UserNamespace which is an invalid scope type for audit events. Replacing it with the UserNamespace owner which will be of type User a valid scope type.

How to set up and validate locally

  1. For testing this you would be required to have access to a GitLab instance with Ultimate license and instance admin access.
  2. Create a project under user namespace.
  3. Now delete the project created in step 2.
  4. Visit http://gitlab.localdev:3000/admin/audit_logs?tab=log for checking instance level audit events. You would observe that the link in Object section will point to the user to whose namespace the project used to belong and the text will be that user's username.
  5. Now create a project under any group.
  6. Then delete the project created in step 5.
  7. Visit http://gitlab.localdev:3000/admin/audit_logs?tab=log and refresh for checking instance level audit events. You would observe that the link in Object section will point to the group to which project used to belong and the text will be that group's name.

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 #415538 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports