2018-07-19 14:43:13 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-26 04:31:42 -04:00
|
|
|
class PipelineDetailsEntity < PipelineEntity
|
2020-01-13 07:08:04 -05:00
|
|
|
expose :project, using: ProjectEntity
|
|
|
|
|
2019-05-06 04:08:42 -04:00
|
|
|
expose :flags do
|
|
|
|
expose :latest?, as: :latest
|
|
|
|
end
|
|
|
|
|
2017-05-26 04:31:42 -04:00
|
|
|
expose :details do
|
2020-02-18 01:09:06 -05:00
|
|
|
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-05-26 04:31:42 -04:00
|
|
|
expose :manual_actions, using: BuildActionEntity
|
2018-10-01 02:27:34 -04:00
|
|
|
expose :scheduled_actions, using: BuildActionEntity
|
2017-05-26 04:31:42 -04:00
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
2019-10-16 05:07:51 -04:00
|
|
|
expose :triggered_by_pipeline, as: :triggered_by, with: TriggeredPipelineEntity
|
|
|
|
expose :triggered_pipelines, as: :triggered, using: TriggeredPipelineEntity
|
|
|
|
end
|