From f62603286d72d42e5b4e87b8f7f7bd6094407f1b Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 2 Jun 2017 02:46:34 +0800 Subject: Fix other use of CreateDeploymentService and make it a bit more robust against missing options, which we did guard on for some cases. --- db/fixtures/development/17_cycle_analytics.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'db/fixtures/development/17_cycle_analytics.rb') diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index 75457b2d369..7c1d758dada 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -212,12 +212,9 @@ class Gitlab::Seeder::CycleAnalytics merge_requests.each do |merge_request| Timecop.travel 12.hours.from_now - CreateDeploymentService.new(merge_request.project, @user, { - environment: 'production', - ref: 'master', - tag: false, - sha: @project.repository.commit('master').sha - }).execute + job = merge_request.head_pipeline.builds.where.not(environment: nil).last + + CreateDeploymentService.new(job).execute end end end -- cgit v1.2.1