diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-09-07 23:22:52 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-09-07 23:22:52 +0300 |
commit | 1e816a972164c515bf99c39bd8880dd23e534c9e (patch) | |
tree | 6a149060c78aaf0460ee4a4084fb9c2f729c0b9a /app | |
parent | 49598c58ebca5807cc63eb7b17872018c6f48503 (diff) |
Address MR suggestions
CE mirror of c4578b951e331fe8c75cd4f948ce74cec6587bad
Diffstat (limited to 'app')
-rw-r--r-- | app/models/blob_viewer/gitlab_ci_yml.rb | 8 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 2 | ||||
-rw-r--r-- | app/views/projects/blob/viewers/_gitlab_ci_yml.html.haml | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/app/models/blob_viewer/gitlab_ci_yml.rb b/app/models/blob_viewer/gitlab_ci_yml.rb index 54462d01b66..655241c2808 100644 --- a/app/models/blob_viewer/gitlab_ci_yml.rb +++ b/app/models/blob_viewer/gitlab_ci_yml.rb @@ -10,16 +10,16 @@ module BlobViewer self.file_types = %i(gitlab_ci) self.binary = false - def validation_message(project, ref) + def validation_message(project, sha) return @validation_message if defined?(@validation_message) prepare! - @validation_message = Gitlab::Ci::YamlProcessor.validation_message(blob.data, { project: project, branch_name: ref }) + @validation_message = Gitlab::Ci::YamlProcessor.validation_message(blob.data, { project: project, sha: sha }) end - def valid?(project, ref) - validation_message(project, ref).blank? + def valid?(project, sha) + validation_message(project, sha).blank? end end end diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 27e0ade2722..bec0aff2ba0 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -475,7 +475,7 @@ module Ci end def initialize_yaml_processor - Gitlab::Ci::YamlProcessor.new(ci_yaml_file, { project: project, branch_name: ref }) + ::Gitlab::Ci::YamlProcessor.new(ci_yaml_file, { project: project, sha: sha }) end def ci_yaml_file_path diff --git a/app/views/projects/blob/viewers/_gitlab_ci_yml.html.haml b/app/views/projects/blob/viewers/_gitlab_ci_yml.html.haml index 6ef09278ee8..5be7cc7f25a 100644 --- a/app/views/projects/blob/viewers/_gitlab_ci_yml.html.haml +++ b/app/views/projects/blob/viewers/_gitlab_ci_yml.html.haml @@ -1,9 +1,9 @@ -- if viewer.valid?(@project, @ref) +- if viewer.valid?(@project, @commit.sha) = icon('check fw') This GitLab CI configuration is valid. - else = icon('warning fw') This GitLab CI configuration is invalid: - = viewer.validation_message(@project, @ref) + = viewer.validation_message(@project, @commit.sha) = link_to 'Learn more', help_page_path('ci/yaml/README') |