From 8c9dc985b90c353b33cb829caf51f8320171bc15 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 12 Feb 2020 06:09:05 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/services/ci/retry_build_service.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/services/ci') diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb index 1f00d54b6a7..838ed789155 100644 --- a/app/services/ci/retry_build_service.rb +++ b/app/services/ci/retry_build_service.rb @@ -5,7 +5,7 @@ module Ci CLONE_ACCESSORS = %i[pipeline project ref tag options name allow_failure stage stage_id stage_idx trigger_request yaml_variables when environment coverage_regex - description tag_list protected needs resource_group].freeze + description tag_list protected needs resource_group scheduling_type].freeze def execute(build) reprocess!(build).tap do |new_build| @@ -27,9 +27,10 @@ module Ci attributes = CLONE_ACCESSORS.map do |attribute| [attribute, build.public_send(attribute)] # rubocop:disable GitlabSecurity/PublicSend - end + end.to_h - attributes.push([:user, current_user]) + attributes[:user] = current_user + attributes[:scheduling_type] ||= build.find_legacy_scheduling_type Ci::Build.transaction do # mark all other builds of that name as retried @@ -49,7 +50,7 @@ module Ci private def create_build!(attributes) - build = project.builds.new(Hash[attributes]) + build = project.builds.new(attributes) build.deployment = ::Gitlab::Ci::Pipeline::Seed::Deployment.new(build).to_resource build.retried = false build.save! -- cgit v1.2.3