Module: Gitlab::Triage::Action

Defined in:
lib/gitlab/triage/action.rb,
lib/gitlab/triage/action/base.rb,
lib/gitlab/triage/action/issue.rb,
lib/gitlab/triage/action/delete.rb,
lib/gitlab/triage/action/comment.rb,
lib/gitlab/triage/action/summarize.rb,
lib/gitlab/triage/action/comment_on_summary.rb

Defined Under Namespace

Classes: Base, Comment, CommentOnSummary, Delete, Issue, Summarize

Class Method Summary collapse

Class Method Details

.act(action:, dry:, **args) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/gitlab/triage/action.rb', line 24

def self.act(action:, dry:, **args)
  klass =
    if dry
      action.const_get(:Dry)
    else
      action
    end

  klass.new(**args).act
end

.process(policy:, **args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gitlab/triage/action.rb', line 10

def self.process(policy:, **args)
  policy.validate!

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