Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 14:18:50 +0300
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/serializers/pipeline_serializer.rb
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
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