Extract EE specific files/lines for db/fixtures/development
We have the following files containing EE specific code. We should move them to ee/
- db/fixtures/development/14_pipelines.rb => https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/30870
- db/fixtures/development/20_burndown.rb => https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14766
- db/fixtures/development/22_epics.rb => https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14766
Differences:
db/fixtures/development/14_pipelines.rb
diff --git a/db/fixtures/development/14_pipelines.rb b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/db/fixtures/development/14_pipelines.rb
index db043e39d2c..ffba934021e 100644
--- a/db/fixtures/development/14_pipelines.rb
+++ b/home/yorickpeterse/Projects/gitlab/gdk-ee/gitlab/db/fixtures/development/14_pipelines.rb
@@ -79,7 +79,15 @@ 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.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
[]
@@ -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
Edited by Robert Speicher