Commit 9eb46764 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'rs-fixtures-parity' into 'master'

CE-EE parity for pipelines development fixture

See merge request gitlab-org/gitlab-ce!30870
parents d9de7234 6331ddbe
......@@ -79,9 +79,17 @@ class Gitlab::Seeder::Pipelines
def create_master_pipelines
@project.repository.commits('master', limit: 4).map do |commit|
create_pipeline!(@project, 'master', commit)
create_pipeline!(@project, 'master', commit).tap do |pipeline|
random_pipeline.tap do |triggered_by_pipeline|
triggered_by_pipeline.try(:sourced_pipelines)&.create(
source_job: triggered_by_pipeline.builds.all.sample,
source_project: triggered_by_pipeline.project,
project: pipeline.project,
pipeline: pipeline)
end
end
end
rescue
rescue ActiveRecord::ActiveRecordError
[]
end
......@@ -98,7 +106,7 @@ class Gitlab::Seeder::Pipelines
end
pipelines.flatten
rescue
rescue ActiveRecord::ActiveRecordError
[]
end
......@@ -231,6 +239,10 @@ class Gitlab::Seeder::Pipelines
@project.team.users.sample
end
def random_pipeline
Ci::Pipeline.limit(4).all.sample
end
def build_status
Ci::Build::AVAILABLE_STATUSES.sample
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