diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-19 00:09:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-19 00:09:57 +0300 |
commit | bfce95a4c5e9d71ed523f48f3fb901d2b7af60f7 (patch) | |
tree | 6bada22ff3863edec03f928f8edcf19c6e7107f1 /app/models/blob_viewer | |
parent | 85f7fa54f404f28b0f351c2be0f7a6e9d74fe65f (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.rb | 15 |
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 |