diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-05-29 10:58:20 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-05-31 22:56:18 +0300 |
commit | 8a9a62e3294d92f4e70be6f427c17241a2b7a232 (patch) | |
tree | 2337d1455c8fb9ebadbe73e872dbdc388a627315 /app/serializers/pipeline_entity.rb | |
parent | 68569584b728ac2dd5100593e9db302f362994f5 (diff) |
Incorporate review
Diffstat (limited to 'app/serializers/pipeline_entity.rb')
-rw-r--r-- | app/serializers/pipeline_entity.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/serializers/pipeline_entity.rb b/app/serializers/pipeline_entity.rb index 4a19c2178f3..7670f02ca86 100644 --- a/app/serializers/pipeline_entity.rb +++ b/app/serializers/pipeline_entity.rb @@ -15,6 +15,21 @@ class PipelineEntity < Grape::Entity pipeline) end + expose :flags do + expose :latest?, as: :latest + expose :triggered?, as: :triggered + expose :stuck?, as: :stuck + expose :has_yaml_errors?, as: :yaml_errors + expose :can_retry?, as: :retryable + expose :can_cancel?, as: :cancelable + end + + expose :details do + expose :detailed_status, as: :status, with: StatusEntity + expose :duration + expose :finished_at + end + expose :ref do expose :name do |pipeline| pipeline.ref @@ -44,6 +59,8 @@ class PipelineEntity < Grape::Entity pipeline.id) end + expose :yaml_errors, if: -> (pipeline, _) { pipeline.has_yaml_errors? } + private alias_method :pipeline, :object |