Sha256: 949757650e8d4d71ae9f6dbf4d5a3ed9fe95557da156e30761fdd1f644a13641

Contents?: true

Size: 800 Bytes

Versions: 20

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

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

module Gitlab
  module Triage
    module Policies
      class SummaryPolicy < BasePolicy
        # Build a summary from several rules policies
        def build_summary
          action = actions[:summarize]
          issues = resources.map do |inner_policy_spec, inner_resources|
            Policies::RulePolicy.new(
              type, inner_policy_spec, inner_resources, network)
              .build_summary
          end

          EntityBuilders::SummaryBuilder.new(
            type: type,
            action: action,
            resources: issues.select(&:any_resources?),
            network: network,
            separator: "\n\n")
        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/summary_policy.rb
gitlab-triage-1.44.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.43.2 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.43.1 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.43.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.42.2 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.42.1 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.42.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.41.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.40.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.30.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.29.0 lib/gitlab/triage/policies/summary_policy.rb
payping-gitlab-triage-0.1.3 lib/gitlab/triage/policies/summary_policy.rb
payping-gitlab-triage-0.1.2 lib/gitlab/triage/policies/summary_policy.rb
payping-gitlab-triage-0.1.1 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.28.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.27.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.26.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.25.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.24.0 lib/gitlab/triage/policies/summary_policy.rb