summaryrefslogtreecommitdiff
path: root/app/services/ci/retry_build_service.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 06:09:05 +0000
commit8c9dc985b90c353b33cb829caf51f8320171bc15 (patch)
tree9a68886dbea1aefabddb46bbd3faf961eab22ae6 /app/services/ci/retry_build_service.rb
parent500626a5c953ad81cfc3ed74bf0148c075617e58 (diff)
downloadgitlab-ce-8c9dc985b90c353b33cb829caf51f8320171bc15.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/ci/retry_build_service.rb')
-rw-r--r--app/services/ci/retry_build_service.rb9
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!