Commit d6e09929 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Fix `Security::FindingsFinder` for multiple report artifacts

Previosly we were using only the first security report artifact of a
build while finding the security findings, if there were more than one.
With this change, we are now using all the security report artifacts
of the same build while finding the security findings.

Changelog: fixed
EE: true
parent be5041b3
......@@ -96,10 +96,10 @@ module Security
def report_findings
@report_findings ||= begin
builds.each_with_object({}) do |build, memo|
report = build.job_artifacts.map(&:security_report).compact.first
next unless report
reports = build.job_artifacts.map(&:security_report).compact
next unless reports.present?
memo[build.id] = report.findings.group_by(&:uuid).transform_values(&:first)
memo[build.id] = reports.flat_map(&:findings).index_by(&:uuid)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment