Commit 6d5d9a26 authored by Robert Speicher's avatar Robert Speicher

CE pipelines don't respond to sourced_pipelines

We also scope the `rescue`s to only those raised by ActiveRecord, which
would have allowed us to spot this logic error sooner.
parent dd7fc4b9
...@@ -81,7 +81,7 @@ class Gitlab::Seeder::Pipelines ...@@ -81,7 +81,7 @@ class Gitlab::Seeder::Pipelines
@project.repository.commits('master', limit: 4).map do |commit| @project.repository.commits('master', limit: 4).map do |commit|
create_pipeline!(@project, 'master', commit).tap do |pipeline| create_pipeline!(@project, 'master', commit).tap do |pipeline|
random_pipeline.tap do |triggered_by_pipeline| random_pipeline.tap do |triggered_by_pipeline|
triggered_by_pipeline.sourced_pipelines.create( triggered_by_pipeline.try(:sourced_pipelines)&.create(
source_job: triggered_by_pipeline.builds.all.sample, source_job: triggered_by_pipeline.builds.all.sample,
source_project: triggered_by_pipeline.project, source_project: triggered_by_pipeline.project,
project: pipeline.project, project: pipeline.project,
...@@ -89,7 +89,7 @@ class Gitlab::Seeder::Pipelines ...@@ -89,7 +89,7 @@ class Gitlab::Seeder::Pipelines
end end
end end
end end
rescue rescue ActiveRecord::ActiveRecordError
[] []
end end
...@@ -106,7 +106,7 @@ class Gitlab::Seeder::Pipelines ...@@ -106,7 +106,7 @@ class Gitlab::Seeder::Pipelines
end end
pipelines.flatten pipelines.flatten
rescue rescue ActiveRecord::ActiveRecordError
[] []
end end
......
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