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

configure_sast.rb « ci_configuration « security « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc3c1d6033b9e2cb4c4a3f1703d8d492619576a0 (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 Mutations
  module Security
    module CiConfiguration
      class ConfigureSast < BaseSecurityAnalyzer
        graphql_name 'ConfigureSast'
        description <<~DESC
          Configure SAST for a project by enabling SAST in a new or modified
          `.gitlab-ci.yml` file in a new branch. The new branch and a URL to
          create a Merge Request are a part of the response.
        DESC

        argument :configuration, ::Types::CiConfiguration::Sast::InputType,
          required: true,
          description: 'SAST CI configuration for the project.'

        def configure_analyzer(project, **args)
          ::Security::CiConfiguration::SastCreateService.new(project, current_user, args[:configuration].to_h).execute
        end
      end
    end
  end
end