summaryrefslogtreecommitdiff
path: root/app/serializers/pipeline_serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/pipeline_serializer.rb')
-rw-r--r--app/serializers/pipeline_serializer.rb36
1 files changed, 13 insertions, 23 deletions
diff --git a/app/serializers/pipeline_serializer.rb b/app/serializers/pipeline_serializer.rb
index b2c0ceb640b..21d49c6c292 100644
--- a/app/serializers/pipeline_serializer.rb
+++ b/app/serializers/pipeline_serializer.rb
@@ -7,10 +7,6 @@ class PipelineSerializer < BaseSerializer
# rubocop: disable CodeReuse/ActiveRecord
def represent(resource, opts = {})
if resource.is_a?(ActiveRecord::Relation)
- # We don't want PipelineDetailsEntity to preload the job_artifacts_archive
- # because we do it with preloaded_relations in a more optimal way
- # if the given resource is a collection of multiple pipelines.
- opts[:preload_job_artifacts_archive] = false
resource = resource.preload(preloaded_relations)
end
@@ -44,35 +40,29 @@ class PipelineSerializer < BaseSerializer
def preloaded_relations
[
- :latest_statuses_ordered_by_stage,
- :project,
- :stages,
- {
- failed_builds: %i(project metadata)
- },
- :retryable_builds,
:cancelable_statuses,
- :trigger_requests,
+ :latest_statuses_ordered_by_stage,
:manual_actions,
+ :retryable_builds,
:scheduled_actions,
- :artifacts,
+ :stages,
+ :trigger_requests,
:user,
{
+ downloadable_artifacts: {
+ project: [:route, { namespace: :route }],
+ job: []
+ },
+ failed_builds: %i(project metadata),
merge_request: {
source_project: [:route, { namespace: :route }],
target_project: [:route, { namespace: :route }]
- }
- },
- {
+ },
pending_builds: :project,
project: [:route, { namespace: :route }],
- artifacts: {
- project: [:route, { namespace: :route }],
- job_artifacts_archive: []
- }
- },
- { triggered_by_pipeline: [:project, :user] },
- { triggered_pipelines: [:project, :user] }
+ triggered_by_pipeline: [:project, :user],
+ triggered_pipelines: [:project, :user]
+ }
]
end
end