Sha256: a04596ab839b35631ec4d3f9f209dbbf545276d10249012dd092566c8b890caf

Contents?: true

Size: 912 Bytes

Versions: 20

Compression:

Stored size: 912 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_policy'
require_relative '../entity_builders/issue_builder'
require_relative '../entity_builders/summary_builder'

module Gitlab
  module Triage
    module Policies
      class RulePolicy < BasePolicy
        # Build a summary from a single rule policy
        def build_summary
          action = actions.fetch(:summarize, {})

          EntityBuilders::SummaryBuilder.new(
            type: type,
            policy_spec: policy_spec,
            action: action,
            resources: resources,
            network: network)
        end

        def build_issue(resource)
          action = actions.fetch(:issue, {})

          EntityBuilders::IssueBuilder.new(
            type: type,
            policy_spec: policy_spec,
            action: action,
            resource: resource,
            network: network)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
gitlab-triage-1.44.1 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.44.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.43.2 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.43.1 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.43.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.42.2 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.42.1 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.42.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.41.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.40.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.30.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.29.0 lib/gitlab/triage/policies/rule_policy.rb
payping-gitlab-triage-0.1.3 lib/gitlab/triage/policies/rule_policy.rb
payping-gitlab-triage-0.1.2 lib/gitlab/triage/policies/rule_policy.rb
payping-gitlab-triage-0.1.1 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.28.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.27.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.26.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.25.0 lib/gitlab/triage/policies/rule_policy.rb
gitlab-triage-1.24.0 lib/gitlab/triage/policies/rule_policy.rb