diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 09:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 09:09:05 +0300 |
commit | 8c9dc985b90c353b33cb829caf51f8320171bc15 (patch) | |
tree | 9a68886dbea1aefabddb46bbd3faf961eab22ae6 /app/services | |
parent | 500626a5c953ad81cfc3ed74bf0148c075617e58 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-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! |