debian-mirror-gitlab/app/serializers/pipeline_details_entity.rb

24 lines
716 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
class PipelineDetailsEntity < PipelineEntity
2020-03-09 13:42:32 +05:30
expose :project, using: ProjectEntity
2019-09-04 21:01:54 +05:30
expose :flags do
expose :latest?, as: :latest
end
2017-09-10 17:25:29 +05:30
expose :details do
2020-03-09 13:42:32 +05:30
expose :artifacts do |pipeline, options|
rel = pipeline.artifacts
rel = rel.eager_load_job_artifacts_archive if options.fetch(:preload_job_artifacts_archive, true)
BuildArtifactEntity.represent(rel, options)
end
2017-09-10 17:25:29 +05:30
expose :manual_actions, using: BuildActionEntity
2018-12-05 23:21:45 +05:30
expose :scheduled_actions, using: BuildActionEntity
2017-09-10 17:25:29 +05:30
end
2019-12-04 20:38:33 +05:30
2019-12-21 20:55:43 +05:30
expose :triggered_by_pipeline, as: :triggered_by, with: TriggeredPipelineEntity
expose :triggered_pipelines, as: :triggered, using: TriggeredPipelineEntity
end