module Gitlab::Triage::Action

Public Class Methods

act(action:, dry:, **args) click to toggle source
# File lib/gitlab/triage/action.rb, line 20
def self.act(action:, dry:, **args)
  klass =
    if dry
      action.const_get(:Dry)
    else
      action
    end

  klass.new(**args).act
end
process(policy:, **args) click to toggle source
# File lib/gitlab/triage/action.rb, line 8
def self.process(policy:, **args)
  policy.validate!

  [
    [Summarize, policy.summarize?],
    [Comment, policy.comment?],
    [CommentOnSummary, policy.comment_on_summary?]
  ].each do |action, active|
    act(action: action, policy: policy, **args) if active
  end
end