Yaml definitions' empty `name` param passes tests
In this MR, a pipeline passed the test
stage, even though the introduced metrics were invalid due to empty string name
param values [visible here: https://gitlab.com/gitlab-org/gitlab/-/blob/7cfa4979d0fdf16168a8cd1f2953e30206736199/ee/config/metrics/counts_28d/20221101213234_integrations_gitlab_for_slack_app_confidential_note_notification_monthly.yml].
This raises an error when trying to generate a Service Ping in rails console:
[43] pry(main)> sp = ServicePing::BuildPayload.new.execute
...
Gitlab::Usage::MetricDefinition::InvalidError: Error type: pattern
Data:
Path: /name
Details:
Metric file: /Users/michold/code/gitlab/gitlab-development-kit/gitlab/ee/config/metrics/counts_7d/20221101213233_integrations_gitlab_for_slack_app_merge_request_notification_weekly.yml
from /Users/michold/code/gitlab/gitlab-development-kit/gitlab/lib/gitlab/error_tracking.rb:95:in `track_and_raise_for_dev_exception'
Caused by Gitlab::Usage::MetricDefinition::InvalidError: Error type: pattern
Data:
Path: /name
Details:
Metric file: /Users/michold/code/gitlab/gitlab-development-kit/gitlab/ee/config/metrics/counts_7d/20221101213233_integrations_gitlab_for_slack_app_merge_request_notification_weekly.yml
from /Users/michold/code/gitlab/gitlab-development-kit/gitlab/lib/gitlab/error_tracking.rb:95:in `track_and_raise_for_dev_exception'
The same type of behavior can also be triggered by including other invalid attributes, such as an empty value here:
performance_indicator_type:
We should find out why this does not fail the test build.
Edited by Michał Wielich