Commit 0ba90249 authored by Andy Soiron's avatar Andy Soiron

Merge branch...

Merge branch '344782-db-seed_fu-failure-nomethoderror-undefined-method-pipelines-for-vulnerabilities-finding' into 'master'

Don't add pipeline to Vulnerabilities::Finding

See merge request gitlab-org/gitlab!73614
parents c62ddb6e 0322f8f5
......@@ -12,14 +12,10 @@ class Gitlab::Seeder::Vulnerabilities
end
def seed!
return unless pipeline
30.times do |rank|
primary_identifier = create_identifier(rank)
vulnerability = create_vulnerability
occurrence = create_occurrence(vulnerability, rank, primary_identifier)
# Create finding_pipeline join model
occurrence.pipelines << pipeline
# Create occurrence_identifier join models
occurrence.identifiers << primary_identifier
occurrence.identifiers << create_identifier(rank) if rank % 3 == 0
......@@ -70,6 +66,7 @@ class Gitlab::Seeder::Vulnerabilities
scanner = FactoryBot.create(:vulnerabilities_scanner, project: vulnerability.project)
FactoryBot.create(
:vulnerabilities_finding,
:with_pipeline,
project: project,
vulnerability: vulnerability,
scanner: scanner,
......
......@@ -2,7 +2,8 @@
# EE fixture
Gitlab::Seeder.quiet do
Project.not_mass_generated.sample(5).each do |project|
project.ci_pipelines.all.sample(2).each do |pipeline|
project.builds.sample(2).each do |build|
pipeline = build.pipeline
next if pipeline.source_pipeline
target_pipeline = Ci::Pipeline
......@@ -15,7 +16,7 @@ Gitlab::Seeder.quiet do
# link to source pipeline
pipeline.sourced_pipelines.create!(
source_job: pipeline.builds.all.sample,
source_job: pipeline.builds.sample,
source_project: pipeline.project,
project: target_pipeline.project,
pipeline: target_pipeline
......
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