Skip to content

Validate all event action names to be lowercase/numbers/underscores

Sarah Yasonik requested to merge sy-validate-event-names into master

What does this MR do and why?

Related issue: Enforce underscores in event names (#434555 - closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Updated error message for example event BAD_EVENT_NAME:

Bad event name error UI

How to set up and validate locally

Validate existing definitions:
  1. Modify the action field in any file in config/events to include non-lowercase/underscore/number characters
  2. Open rails c
  3. Run Gitlab::Tracking::EventDefinition.definitions.each { puts _1.validation_errors }; 0 to see the error output
Prevent new definitions:
  1. Run ruby scripts/internal_events/cli.rb
  2. Select New Event
  3. Input a random description
  4. Input an invalid action name & see error output

Merge request reports