summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Hegyi <ahegyi@gitlab.com>2019-09-02 15:10:31 +0200
committerAdam Hegyi <ahegyi@gitlab.com>2019-09-02 15:10:31 +0200
commit4987255e93f627588652ab6d9e4fa1794a35025c (patch)
tree06f1cd583ff7cc60fd9766d0bc7f0f6fe2a72c34
parentcd8d008cb95ce2321b7cdb36433ff40375043ce9 (diff)
downloadgitlab-ce-fix-cycle-analytics-seeds.tar.gz
Fix cycle analytics seed scriptfix-cycle-analytics-seeds
-rw-r--r--db/fixtures/development/17_cycle_analytics.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb
index 78ceb74da65..9d293f425e6 100644
--- a/db/fixtures/development/17_cycle_analytics.rb
+++ b/db/fixtures/development/17_cycle_analytics.rb
@@ -18,6 +18,7 @@ class Gitlab::Seeder::CycleAnalytics
# Milestones / Labels
Timecop.travel 5.days.from_now
+
if index.even?
issue_metrics.first_associated_with_milestone_at = rand(6..12).hours.from_now
else
@@ -146,7 +147,7 @@ class Gitlab::Seeder::CycleAnalytics
commit_sha = issue.project.repository.create_file(@user, filename, "content", message: "Commit for #{issue.to_reference}", branch_name: branch_name)
issue.project.repository.commit(commit_sha)
- Git::BranchPushService.new(
+ ::Git::BranchPushService.new(
issue.project,
@user,
oldrev: issue.project.repository.commit("master").sha,
@@ -182,7 +183,8 @@ class Gitlab::Seeder::CycleAnalytics
ref: "refs/heads/#{merge_request.source_branch}")
pipeline = service.execute(:push, ignore_skip_ci: true, save_on_errors: false)
- pipeline.builds.map(&:run!)
+ pipeline.builds.each(&:enqueue) # make sure all pipelines in pending state
+ pipeline.builds.each(&:run!)
pipeline.update_status
end
end