Class: Gitlab::Ci::Pipeline::Chain::RemoveUnwantedChatJobs

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb

Instance Attribute Summary

Attributes inherited from Base

#command, #config, #pipeline

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Pipeline::Chain::Base

Instance Method Details

#break?Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb', line 20

def break?
  false
end

#perform!Object

Raises:

  • (ArgumentError)

8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb', line 8

def perform!
  raise ArgumentError, 'missing YAML processor result' unless @command.yaml_processor_result

  return unless pipeline.chat?

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