diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-10-06 10:08:00 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-10-06 10:08:00 +0000 |
commit | 6cd7ce33240f8984f5c835123c5e7a96b4abb167 (patch) | |
tree | 3dd95fa21ddde156e3c858a84c57f96f0ba577c5 /app/serializers | |
parent | cbc7d62c2982135d5edd8e1ea1c32d35cc60d46f (diff) | |
parent | 83059f130e9049939e3e8251b7ede5fa128073fd (diff) | |
download | gitlab-ce-6cd7ce33240f8984f5c835123c5e7a96b4abb167.tar.gz |
Merge branch 'backstage/gb/move-some-pipelines-code-from-ee-to-ee' into 'master'
Move to CE some EE pipelines-related code that belongs to CE
Closes gitlab-ee#3616
See merge request gitlab-org/gitlab-ce!14699
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 |