Commit 968b4f85 authored by rossfuhrman's avatar rossfuhrman

Improve Group Security Dashboard performance

This is a temporary change that will go away with
Standalone Vulnerabilities
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27943
For Groups, supply all the project ids to force usage of the SQL index
as when we han no project id supplied, we want all projects.
parent d8729627
......@@ -37,6 +37,20 @@ module ProjectVulnerabilityFindingsActions
private
def filter_params
params.permit(:scope, report_type: [], confidence: [], project_id: [], severity: [])
params.permit(
:scope,
report_type: [],
confidence: [],
project_id: [],
severity: []
).tap do |vulnerability_params|
if vulnerable.is_a?(Group) && params[:project_id].blank?
# This is a temporary change that will go away with Standalone Vulnerabilities
# https://gitlab.com/gitlab-org/gitlab/-/issues/13561
# For Groups, supply all the project ids to force usage of the SQL index
# as when we have no project ids supplied, we want all projects.
vulnerability_params.merge!(project_id: vulnerable.projects.pluck_primary_key)
end
end
end
end
---
title: Improve Group Security Dashboard performance
merge_request: 27959
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