diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-10-07 00:27:15 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-10-07 00:27:15 +0900 |
commit | 830c770a532fc94e1b1a70064500c9bd63712de4 (patch) | |
tree | 140141b7c9ac92cdce29e71b6da6f00bcde9f51a /app/serializers | |
parent | 3e26b0dcd113ade77dc8304137c6733cab4c8718 (diff) | |
parent | 7f8e720f415ff50f791d9efd49b774c9da9ab109 (diff) | |
download | gitlab-ce-830c770a532fc94e1b1a70064500c9bd63712de4.tar.gz |
Merge branch 'master' into feature/sm/35954-create-kubernetes-cluster-on-gke-from-k8s-service
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/pipeline_entity.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb index 357fc71f877..6457294b285 100644 --- a/app/serializers/pipeline_entity.rb +++ b/app/serializers/pipeline_entity.rb @@ -20,6 +20,7 @@ class PipelineEntity < Grape::Entity expose :has_yaml_errors?, as: :yaml_errors expose :can_retry?, as: :retryable expose :can_cancel?, as: :cancelable + expose :failure_reason?, as: :failure_reason end expose :details do @@ -44,6 +45,11 @@ class PipelineEntity < Grape::Entity end expose :commit, using: CommitEntity + expose :yaml_errors, if: -> (pipeline, _) { pipeline.has_yaml_errors? } + + expose :failure_reason, if: -> (pipeline, _) { pipeline.failure_reason? } do |pipeline| + pipeline.present.failure_reason + end expose :retry_path, if: -> (*) { can_retry? } do |pipeline| retry_project_pipeline_path(pipeline.project, pipeline) @@ -53,8 +59,6 @@ class PipelineEntity < Grape::Entity cancel_project_pipeline_path(pipeline.project, pipeline) end - expose :yaml_errors, if: -> (pipeline, _) { pipeline.has_yaml_errors? } - private alias_method :pipeline, :object |