lib/gitlab/triage/policies/summary_policy.rb in gitlab-triage-0.16.0 vs lib/gitlab/triage/policies/summary_policy.rb in gitlab-triage-0.17.0
- old
+ new
@@ -10,22 +10,22 @@
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: [],
- network: network).tap do |issue|
- issue.items =
- resources.map do |inner_policy_spec, inner_resources|
- Policies::RulePolicy.new(
- type, inner_policy_spec, inner_resources, network)
- .build_issue
- .description
- end.join("\n\n")
- end
+ resources: issues.select(&:any_resources?),
+ network: network,
+ separator: "\n\n")
end
# Due to resources is a different type, this will never work
# FIXME: We should try to make sure type is consistent for resources
def comment?