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

remove_unwanted_chat_jobs.rb « chain « pipeline « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9267c72efa40d2b51c7324fc5bd0f2a6bbf61af2 (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 Gitlab
  module Ci
    module Pipeline
      module Chain
        class RemoveUnwantedChatJobs < Chain::Base
          def perform!
            raise ArgumentError, 'missing config processor' unless @command.config_processor

            return unless pipeline.chat?

            # When scheduling a chat pipeline we only want to run the build
            # that matches the chat command.
            @command.config_processor.jobs.select! do |name, _|
              name.to_s == command.chat_data[:command].to_s
            end
          end

          def break?
            false
          end
        end
      end
    end
  end
end