diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /lib/generators | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'lib/generators')
-rw-r--r-- | lib/generators/gitlab/snowplow_event_definition_generator.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/generators/gitlab/snowplow_event_definition_generator.rb b/lib/generators/gitlab/snowplow_event_definition_generator.rb index 497d0cd512a..827e87dc313 100644 --- a/lib/generators/gitlab/snowplow_event_definition_generator.rb +++ b/lib/generators/gitlab/snowplow_event_definition_generator.rb @@ -65,7 +65,12 @@ module Gitlab end def file_name - "#{event_category}_#{event_action}.yml".underscore.gsub("/", "__") + name = remove_special_chars("#{Time.current.to_i}_#{event_category}_#{event_action}") + "#{name[0..95]}.yml" # max 100 chars, see https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2030#note_679501200 + end + + def remove_special_chars(input) + input.gsub("::", "__").gsub(/[^A-Za-z0-9_]/, '') end end end |