2021-05-06 17:10:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Mutations
|
|
|
|
module Ci
|
|
|
|
module Job
|
|
|
|
class Retry < Base
|
|
|
|
graphql_name 'JobRetry'
|
|
|
|
|
|
|
|
field :job,
|
|
|
|
Types::Ci::JobType,
|
|
|
|
null: true,
|
2021-08-10 08:11:00 -04:00
|
|
|
description: 'Job after the mutation.'
|
2021-05-06 17:10:07 -04:00
|
|
|
|
|
|
|
authorize :update_build
|
|
|
|
|
|
|
|
def resolve(id:)
|
|
|
|
job = authorized_find!(id: id)
|
|
|
|
project = job.project
|
|
|
|
|
|
|
|
::Ci::RetryBuildService.new(project, current_user).execute(job)
|
|
|
|
{
|
|
|
|
job: job,
|
|
|
|
errors: errors_on_object(job)
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|