Commit 44833dfa authored by Mikolaj Wawrzyniak's avatar Mikolaj Wawrzyniak

Add metric name suggestion to json schema

Update metric defnition json schema to include name attribute, and
apply validation that asserts that prompts has been resolved.
parent 4223146f
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
"key_path": { "key_path": {
"type": "string" "type": "string"
}, },
"name": {
"type": ["string", "null"],
"pattern": "^([a-z]+_)*[a-z]+$"
},
"description": { "description": {
"type": "string" "type": "string"
}, },
......
...@@ -16,7 +16,8 @@ RSpec.describe Gitlab::Usage::MetricDefinition do ...@@ -16,7 +16,8 @@ RSpec.describe Gitlab::Usage::MetricDefinition do
time_frame: 'none', time_frame: 'none',
data_source: 'database', data_source: 'database',
distribution: %w(ee ce), distribution: %w(ee ce),
tier: %w(free starter premium ultimate bronze silver gold) tier: %w(free starter premium ultimate bronze silver gold),
name: 'count_boards'
} }
end end
...@@ -53,6 +54,7 @@ RSpec.describe Gitlab::Usage::MetricDefinition do ...@@ -53,6 +54,7 @@ RSpec.describe Gitlab::Usage::MetricDefinition do
:distribution | nil :distribution | nil
:distribution | 'test' :distribution | 'test'
:tier | %w(test ee) :tier | %w(test ee)
:name | 'count_<adjective_describing>_boards'
end end
with_them do with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment