Commit a6fe183e authored by Stan Hu's avatar Stan Hu

Merge branch 'avoid_es_loading_project_ci_status' into 'master'

Avoid loading pipeline status in project search

See merge request gitlab-org/gitlab-ce!26342
parents 347e2b40 2a520b1c
...@@ -169,7 +169,7 @@ module ProjectsHelper ...@@ -169,7 +169,7 @@ module ProjectsHelper
translation.html_safe translation.html_safe
end end
def project_list_cache_key(project) def project_list_cache_key(project, pipeline_status: true)
key = [ key = [
project.route.cache_key, project.route.cache_key,
project.cache_key, project.cache_key,
...@@ -179,10 +179,11 @@ module ProjectsHelper ...@@ -179,10 +179,11 @@ module ProjectsHelper
Gitlab::CurrentSettings.cache_key, Gitlab::CurrentSettings.cache_key,
"cross-project:#{can?(current_user, :read_cross_project)}", "cross-project:#{can?(current_user, :read_cross_project)}",
max_project_member_access_cache_key(project), max_project_member_access_cache_key(project),
pipeline_status,
'v2.6' 'v2.6'
] ]
key << pipeline_status_cache_key(project.pipeline_status) if project.pipeline_status.has_status? key << pipeline_status_cache_key(project.pipeline_status) if pipeline_status && project.pipeline_status.has_status?
key key
end end
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.search-results .search-results
- if @scope == 'projects' - if @scope == 'projects'
.term .term
= render 'shared/projects/list', projects: @search_objects = render 'shared/projects/list', projects: @search_objects, pipeline_status: false
- else - else
= render partial: "search/results/#{@scope.singularize}", collection: @search_objects = render partial: "search/results/#{@scope.singularize}", collection: @search_objects
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project) - show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project)
- css_class = '' unless local_assigns[:css_class] - css_class = '' unless local_assigns[:css_class]
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description - css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
- cache_key = project_list_cache_key(project) - cache_key = project_list_cache_key(project, pipeline_status: pipeline_status)
- updated_tooltip = time_ago_with_tooltip(project.last_activity_date) - updated_tooltip = time_ago_with_tooltip(project.last_activity_date)
- css_controls_class = compact_mode ? "" : "flex-lg-row justify-content-lg-between" - css_controls_class = compact_mode ? "" : "flex-lg-row justify-content-lg-between"
- avatar_container_class = project.creator && use_creator_avatar ? '' : 'rect-avatar' - avatar_container_class = project.creator && use_creator_avatar ? '' : 'rect-avatar'
......
---
title: Avoid loading pipeline status in project search
merge_request: 26342
author:
type: performance
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment