Skip to content

Add event type information for audit events using AuditEventService in `Feature Flag`

Problem to solve

Some audit events are named audit_operation. This isn't a descriptive name and makes them difficult to be 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
Created feature flag Create file
Update feature flag Update file
Deleted feature flag 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

  1. Add an meaningful event name for the events in the Feature Flag model listed in the proposal.
    • The name should follow the noun_verb format.
  2. Update the associated specs.

Notes

Verification steps

  • Go to a project and create a feature flag
  • Rename that feature flag
  • Delete the feature flag again
  • Navigate to the Audit Events page
  • (left hand menu "Security and Compliance" -> "Audit events")
  • You should see three events logged
Edited by SAM FIGUEROA