Skip to content

Improve filenames creation for Snowplow event definitions generator

What does this MR do and why?

  • Prefix the generated filename with a timestamp
  • Remove special characters when concatenating the category and action into the filename.
  • Make sure filenames length is lower than 100 characters (related).

-->

How to set up and validate locally

  1. Run Gitlab::SnowplowEventDefinitionGenerator.new([], {category: "YOUR CAT NAME", action: "YOUR ACTION NAME"}).invoke_all
  2. Check generated file name

For example:

[9] pry(main)> Gitlab::SnowplowEventDefinitionGenerator.new([], {category: "YOUR%% CAT NAME", action: "YOUR::A$!$CTION NAME"}).invoke_all
      create  config/events/1642996243_yourcatname_your__actionname.yml

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

Edited by Niko Belokolodov

Merge request reports

Loading