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

pipeline_retry.rb « ci « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0669bfc449c5227a5ecd9f143c8917ab6b6daae4 (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
# frozen_string_literal: true

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

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

      authorize :update_pipeline

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

        ::Ci::RetryPipelineService.new(project, current_user).execute(pipeline)
        {
          pipeline: pipeline,
          errors: errors_on_object(pipeline)
        }
      end
    end
  end
end