Skip to content

Limit the number of dast_profile fixtures in seeds

What does this MR do and why?

this merge request reduces the number of dast-related records that get created during the seed process because we had a report that a user was running into an issue when running the seeds. we decided to reduce the number of records created by the seed to avoid excessive record creation.

Related Issue(s)

ee/db/fixtures/development/21_dast_profiles.rb takes a long time to complete

Screenshots or screen recordings

% echo "Dast::Profile.count" | rails c
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin20]
 GitLab:       14.6.0-pre (0e59cfa7250) EE
 GitLab Shell: 13.22.1
 PostgreSQL:   12.9
--------------------------------------------------------------------------------
Loading development environment (Rails 6.1.4.1)
[1] pry(main)> Dast::Profile.count
   (2.2ms)  SELECT COUNT(*) FROM "dast_profiles" /*application:console,db_config_name:main,line:(pry):1:in `__pry__'*/
=> 164
[2] pry(main)>
%  bundle exec rake db:seed_fu FILTER=dast_profiles

== Filtering seed files against regexp: /dast_profiles/

== Seed from ee/db/fixtures/development/21_dast_profiles.rb

OK
% echo "Dast::Profile.count" | rails c
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin20]
 GitLab:       14.6.0-pre (0e59cfa7250) EE
 GitLab Shell: 13.22.1
 PostgreSQL:   12.9
--------------------------------------------------------------------------------
Loading development environment (Rails 6.1.4.1)
[1] pry(main)> Dast::Profile.count
   (2.3ms)  SELECT COUNT(*) FROM "dast_profiles" /*application:console,db_config_name:main,line:(pry):1:in `__pry__'*/
=> 167
[2] pry(main)>

How to set up and validate locally

  1. run the seed task.
bundle exec rake db:seed_fu FILTER=dast_profiles

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Philip Cunningham

Merge request reports

Loading