diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /lib/api/ci/jobs.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'lib/api/ci/jobs.rb')
-rw-r--r-- | lib/api/ci/jobs.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/api/ci/jobs.rb b/lib/api/ci/jobs.rb index d9d0da2e4d1..86897eb61ae 100644 --- a/lib/api/ci/jobs.rb +++ b/lib/api/ci/jobs.rb @@ -114,11 +114,14 @@ module API build = find_build!(params[:job_id]) authorize!(:update_build, build) - break forbidden!('Job is not retryable') unless build.retryable? - build = ::Ci::Build.retry(build, current_user) + response = ::Ci::RetryJobService.new(@project, current_user).execute(build) - present build, with: Entities::Ci::Job + if response.success? + present response[:job], with: Entities::Ci::Job + else + forbidden!('Job is not retryable') + end end desc 'Erase job (remove artifacts and the trace)' do @@ -194,7 +197,7 @@ module API pipeline = current_authenticated_job.pipeline project = current_authenticated_job.project - agent_authorizations = Clusters::AgentAuthorizationsFinder.new(project).execute + agent_authorizations = ::Clusters::AgentAuthorizationsFinder.new(project).execute project_groups = project.group&.self_and_ancestor_ids&.map { |id| { id: id } } || [] user_access_level = project.team.max_member_access(current_user.id) roles_in_project = Gitlab::Access.sym_options_with_owner |