Skip to content
Snippets Groups Projects
Commit f60da6af authored by Stan Hu's avatar Stan Hu
Browse files

Avoid loading pipeline status in search results

This improves the performance of search, since the pipeline status
is not displayed.

Identified in https://gitlab.com/gitlab-org/gitlab-ce/issues/56627
parent 547055db
No related branches found
No related tags found
Loading
Pipeline #68262916 failed
......@@ -28,7 +28,7 @@
.js-projects-list-holder
- if any_projects?(projects)
- load_pipeline_status(projects)
- load_pipeline_status(projects) if pipeline_status
%ul.projects-list{ class: css_classes }
- projects.each_with_index do |project, i|
- css_class = (i >= projects_limit) || project.pending_delete? ? 'hide' : nil
......
......@@ -35,6 +35,19 @@
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
project = create(:project, :public)
note = create(:note_on_issue, project: project)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment