Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-19 00:09:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-19 00:09:57 +0300
commitbfce95a4c5e9d71ed523f48f3fb901d2b7af60f7 (patch)
tree6bada22ff3863edec03f928f8edcf19c6e7107f1 /app/models/blob_viewer
parent85f7fa54f404f28b0f351c2be0f7a6e9d74fe65f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/blob_viewer')
-rw-r--r--app/models/blob_viewer/metrics_dashboard_yml.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/app/models/blob_viewer/metrics_dashboard_yml.rb b/app/models/blob_viewer/metrics_dashboard_yml.rb
index c05fb5d88d6..1ee7cad5094 100644
--- a/app/models/blob_viewer/metrics_dashboard_yml.rb
+++ b/app/models/blob_viewer/metrics_dashboard_yml.rb
@@ -26,19 +26,10 @@ module BlobViewer
def parse_blob_data
yaml = ::Gitlab::Config::Loader::Yaml.new(blob.data).load_raw!
-
- ::PerformanceMonitoring::PrometheusDashboard.from_json(yaml)
- nil
+ Gitlab::Metrics::Dashboard::Validator
+ .errors(yaml, dashboard_path: blob.path, project: project)
rescue Gitlab::Config::Loader::FormatError => error
- wrap_yml_syntax_error(error)
- rescue ActiveModel::ValidationError => invalid
- invalid.model.errors
- end
-
- def wrap_yml_syntax_error(error)
- ::PerformanceMonitoring::PrometheusDashboard.new.errors.tap do |errors|
- errors.add(:'YAML syntax', error.message)
- end
+ [error]
end
end
end