diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-06 15:07:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-06 15:07:34 +0300 |
commit | 4958d96e262f6b31b2850123e4949536555b2d29 (patch) | |
tree | 28fe9a1fed009a569806c705e4810a33979cbd6a /db/fixtures/development | |
parent | 95de7177f2d5844e4aa399fea9a59d4ba6b4b1f1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/fixtures/development')
-rw-r--r-- | db/fixtures/development/17_cycle_analytics.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index 0175647e71e..6f4819c5ca4 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -3,8 +3,8 @@ require './spec/support/sidekiq_middleware' require './spec/support/helpers/test_env' require 'active_support/testing/time_helpers' -require './spec/support/helpers/cycle_analytics_helpers.rb' -require './ee/db/seeds/shared/dora_metrics.rb' if Gitlab.ee? +require './spec/support/helpers/cycle_analytics_helpers' +require './ee/db/seeds/shared/dora_metrics' if Gitlab.ee? # Usage: # @@ -82,6 +82,7 @@ class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChild seed_staging_stage! if Gitlab.ee? + create_vulnerabilities_count_report! seed_dora_metrics! create_custom_value_stream! create_value_stream_aggregation(project.group) @@ -195,6 +196,23 @@ class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChild end end + def create_vulnerabilities_count_report! + 4.times do |i| + critical_count = rand(5..10) + high_count = rand(5..10) + + [i.months.ago.end_of_month, i.months.ago.beginning_of_month].each do |date| + FactoryBot.create(:vulnerability_historical_statistic, + date: date, + total: critical_count + high_count, + critical: critical_count, + high: high_count, + project: project + ) + end + end + end + def create_developers! 5.times do |i| user = FactoryBot.create( |