Add event type information for audit events using AuditEventService in `Project`
Problem to solve
Some audit events are named audit_operation. This isn't a descriptive name and makes it difficult to differentiated from other events.
Additional context is available in this epic and in the parent epic.
Proposal
Add a meaningful name for the following events and actions that can be used to differentiate them from other events:
| Event | Action | Location |
|---|---|---|
marked for deletion |
Delete |
file |
restore project |
unknown |
file |
Changed default branch |
Update |
file |
Import project |
unknown |
file |
Project export / archive / unarchive |
unknown |
file |
Create project |
Create |
file |
Delete project |
Delete |
file |
Naming should follow the noun_verb format and use the past tense. For example ci_variable_created.
For events created with audit_changes we can pass the event name using the event_type argument.
audit_changes(:email, as: 'email address', event_type: 'email_address_added')
Consider this MR as an example of how to do this.
Implementation plan
- Add an meaningful event
namefor the events in theProjectmodel listed in the proposal.- The name should follow the
noun_verbformat.
- The name should follow the
- Update the associated specs.
Notes
- For instructions on how to setup your development environment.
- For any questions regarding audit events reach out to a member of the compliance group.