Merge branch 'sh-avoid-loading-pipeline-status' into 'master'
Avoid loading pipeline status in search results See merge request gitlab-org/gitlab-ce!30111
This commit is contained in:
commit
aa814403a9
3 changed files with 19 additions and 1 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
.js-projects-list-holder
|
.js-projects-list-holder
|
||||||
- if any_projects?(projects)
|
- if any_projects?(projects)
|
||||||
- load_pipeline_status(projects)
|
- load_pipeline_status(projects) if pipeline_status
|
||||||
%ul.projects-list{ class: css_classes }
|
%ul.projects-list{ class: css_classes }
|
||||||
- projects.each_with_index do |project, i|
|
- projects.each_with_index do |project, i|
|
||||||
- css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil
|
- css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Avoid loading pipeline status in search results
|
||||||
|
merge_request: 30111
|
||||||
|
author:
|
||||||
|
type: performance
|
|
@ -39,6 +39,19 @@ describe SearchController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'global search' do
|
||||||
|
render_views
|
||||||
|
|
||||||
|
it 'omits pipeline status from load' do
|
||||||
|
project = create(:project, :public)
|
||||||
|
expect(Gitlab::Cache::Ci::ProjectPipelineStatus).not_to receive(:load_in_batch_for_projects)
|
||||||
|
|
||||||
|
get :show, params: { scope: 'projects', search: project.name }
|
||||||
|
|
||||||
|
expect(assigns[:search_objects].first).to eq project
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it 'finds issue comments' do
|
it 'finds issue comments' do
|
||||||
project = create(:project, :public)
|
project = create(:project, :public)
|
||||||
note = create(:note_on_issue, project: project)
|
note = create(:note_on_issue, project: project)
|
||||||
|
|
Loading…
Reference in a new issue