summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Parent <math.parent@gmail.com>2019-05-28 18:09:02 +0200
committerMathieu Parent <math.parent@gmail.com>2019-07-03 16:18:05 +0200
commit32bbb52c19cf804c94a15e34d69a036d08acd35a (patch)
tree8fdeccb78342e4ef3b66e92be811e29802d5003a
parent4abb68f8d6b94a97aa670d7511c6ed976f9ce2a6 (diff)
downloadgitlab-ce-32bbb52c19cf804c94a15e34d69a036d08acd35a.tar.gz
Fix API performance problem of auto_devops query
-rw-r--r--lib/api/entities.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 7bf66589616..5eae87fea02 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -201,6 +201,7 @@ module API
# MR describing the solution: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555
projects_relation.preload(:project_feature, :route)
.preload(:import_state, :tags)
+ .preload(:auto_devops)
.preload(namespace: [:route, :owner])
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -307,6 +308,7 @@ module API
# MR describing the solution: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555
super(projects_relation).preload(:group)
.preload(:ci_cd_settings)
+ .preload(:auto_devops)
.preload(project_group_links: { group: :route },
fork_network: :root_project,
fork_network_member: :forked_from_project,