Sha256: 27c40a10eed1abf09d360c885356b72fd7b2805be62e9a5c51756a6fcb181bf3

Contents?: true

Size: 791 Bytes

Versions: 19

Compression:

Stored size: 791 Bytes

Contents

# frozen_string_literal: true

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

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

          EntityBuilders::IssueBuilder.new(
            type: type,
            action: action,
            resources: issues.select(&:any_resources?),
            network: network,
            separator: "\n\n")
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
gitlab-triage-1.23.1 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.23.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.22.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.21.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.20.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.19.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.18.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.17.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.16.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.15.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.14.3 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.14.2 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.14.1 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.14.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.13.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.12.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.11.0 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.10.1 lib/gitlab/triage/policies/summary_policy.rb
gitlab-triage-1.10.0 lib/gitlab/triage/policies/summary_policy.rb