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