debian-mirror-gitlab/app/graphql/mutations/ci/pipeline/retry.rb

31 lines
704 B
Ruby
Raw Normal View History

2021-03-08 18:12:59 +05:30
# frozen_string_literal: true
module Mutations
module Ci
module Pipeline
class Retry < Base
graphql_name 'PipelineRetry'
field :pipeline,
Types::Ci::PipelineType,
null: true,
2021-10-27 15:23:28 +05:30
description: 'Pipeline after mutation.'
2021-03-08 18:12:59 +05:30
authorize :update_pipeline
def resolve(id:)
pipeline = authorized_find!(id: id)
project = pipeline.project
2022-05-07 20:08:51 +05:30
service_response = ::Ci::RetryPipelineService.new(project, current_user).execute(pipeline)
2021-03-08 18:12:59 +05:30
{
pipeline: pipeline,
2022-05-07 20:08:51 +05:30
errors: errors_on_object(pipeline) + service_response.errors
2021-03-08 18:12:59 +05:30
}
end
end
end
end
end