Welcome to mirror list, hosted at ThFree Co, Russian Federation.

retry.rb « pipeline « ci « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 895397a96abdd6c5f442bfdd0306d76ee1e15ae3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

module Mutations
  module Ci
    module Pipeline
      class Retry < Base
        graphql_name 'PipelineRetry'

        field :pipeline,
              Types::Ci::PipelineType,
              null: true,
              description: 'Pipeline after mutation.'

        authorize :update_pipeline

        def resolve(id:)
          pipeline = authorized_find!(id: id)
          project = pipeline.project

          service_response = ::Ci::RetryPipelineService.new(project, current_user).execute(pipeline)

          {
            pipeline: pipeline,
            errors: errors_on_object(pipeline) + service_response.errors
          }
        end
      end
    end
  end
end