Display capped results for large datasets
What does this MR do and why?
Display capped results for large datasets
Use capped results in vulnerability reports instead of showing the real numbers. This is a breaking change.
EE: true Changelog: changed
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
After checking out this branch, apply the following diff (modify the number based on your number of vulnerabilities):
diff --git a/ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue b/ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue
index 88c962a4b8ba..b35eca614f78 100644
--- a/ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue
+++ b/ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue
@@ -7,7 +7,7 @@ import { s__ } from '~/locale';
import countsQuery from 'ee/security_dashboard/graphql/queries/vulnerability_severities_count.query.graphql';
import { SEVERITIES } from '~/vulnerabilities/constants';
-const SEVERITY_COUNT_LIMIT = 1000;
+const SEVERITY_COUNT_LIMIT = 10;
export default {
components: { GlCard, GlSkeletonLoader, SeverityBadge },
diff --git a/ee/app/models/vulnerabilities/read.rb b/ee/app/models/vulnerabilities/read.rb
index 2a13c7deeada..88ec7c0526f1 100644
--- a/ee/app/models/vulnerabilities/read.rb
+++ b/ee/app/models/vulnerabilities/read.rb
@@ -9,7 +9,7 @@ class Read < ApplicationRecord
declarative_enum DismissalReasonEnum
- SEVERITY_COUNT_LIMIT = 1001
+ SEVERITY_COUNT_LIMIT = 11
self.table_name = "vulnerability_reads"
self.primary_key = :vulnerability_id
Then visit any group with vulnerabilities and check the vulnerability counts. Repeat the same for the instance and project level vulnerability reports.
Related to #463387 (closed)
Edited by Lorenz van Herwaarden