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

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

module Resolvers
  module Ci
    class JobsResolver < BaseResolver
      alias_method :pipeline, :object

      argument :security_report_types, [Types::Security::ReportTypeEnum],
              required: false,
              description: 'Filter jobs by the type of security report they produce'

      def resolve(security_report_types: [])
        if security_report_types.present?
          ::Security::SecurityJobsFinder.new(
            pipeline: pipeline,
            job_types: security_report_types
          ).execute
        else
          pipeline.statuses
        end
      end
    end
  end
end