diff options
Diffstat (limited to 'app/services/ci/retry_build_service.rb')
-rw-r--r-- | app/services/ci/retry_build_service.rb | 9 |
1 files changed, 5 insertions, 4 deletions
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! |