Commit 6be045ed authored by Piotr Skorupa's avatar Piotr Skorupa

Add skip_validation for metric definition lookup

parent 88de9ff0
...@@ -101,7 +101,7 @@ module Gitlab ...@@ -101,7 +101,7 @@ module Gitlab
end end
def metric_definitions def metric_definitions
@definitions ||= Gitlab::Usage::MetricDefinition.definitions @definitions ||= Gitlab::Usage::MetricDefinition.definitions(skip_validation: true)
end end
def metric_definition_exists? def metric_definition_exists?
......
...@@ -41,7 +41,8 @@ module Gitlab ...@@ -41,7 +41,8 @@ module Gitlab
@paths ||= [Rails.root.join('config', 'metrics', '**', '*.yml')] @paths ||= [Rails.root.join('config', 'metrics', '**', '*.yml')]
end end
def definitions def definitions(skip_validation: false)
@@skip_validation = skip_validation
@definitions ||= load_all! @definitions ||= load_all!
end end
...@@ -87,7 +88,7 @@ module Gitlab ...@@ -87,7 +88,7 @@ module Gitlab
end end
def skip_validation? def skip_validation?
!!attributes[:skip_validation] !!attributes[:skip_validation] || @@skip_validation
end end
end end
end end
......
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