# frozen_string_literal: true require_relative 'base_policy' require_relative 'rule_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 EntityBuilders::IssueBuilder.new(actions[:summarize].merge(item: "{{description}}\n\n"), [], net).tap do |issue| issue.items = resources.map do |inner_policy_spec, inner_resources| Policies::RulePolicy.new(type, inner_policy_spec, inner_resources, net).build_issue.description end.join("\n\n") end end end end end end