Sha256: b6636af4bb8c3c4afc0a9adf07b93722ba9afce91aa61118149a6e90710d0395

Contents?: true

Size: 716 Bytes

Versions: 10

Compression:

Stored size: 716 Bytes

Contents

require_relative 'action/summarize'
require_relative 'action/comment'
require_relative 'action/comment_on_summary'

module Gitlab
  module Triage
    module Action
      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

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

        klass.new(**args).act
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gitlab-triage-1.23.1 lib/gitlab/triage/action.rb
gitlab-triage-1.23.0 lib/gitlab/triage/action.rb
gitlab-triage-1.22.0 lib/gitlab/triage/action.rb
gitlab-triage-1.21.0 lib/gitlab/triage/action.rb
gitlab-triage-1.20.0 lib/gitlab/triage/action.rb
gitlab-triage-1.19.0 lib/gitlab/triage/action.rb
gitlab-triage-1.18.0 lib/gitlab/triage/action.rb
gitlab-triage-1.17.0 lib/gitlab/triage/action.rb
gitlab-triage-1.16.0 lib/gitlab/triage/action.rb
gitlab-triage-1.15.0 lib/gitlab/triage/action.rb