Commit b9ba828c authored by Craig Smith's avatar Craig Smith Committed by charlie ablett

Add scanned_resources CSV path to Security Report Summary

parent 7f2bd61f
......@@ -31,11 +31,18 @@ module Security
when :scanned_resources
response[:scanned_resources] = scanned_resources[report_type.to_s]
when :scanned_resources_csv_path
nil
response[:scanned_resources_csv_path] = csv_path
end
end
end
def csv_path
::Gitlab::Routing.url_helpers.project_security_scanned_resources_path(
@pipeline.project,
format: :csv,
pipeline_id: @pipeline.id)
end
def requested_report_types(summary_type)
@report_types_for_summary_type ||= Gitlab::Utils.multiple_key_invert(@selection_information)
@report_types_for_summary_type[summary_type].map(&:to_s)
......
---
title: Add scanned_resources CSV path to Security Report Summary
merge_request: 36810
author:
type: added
......@@ -102,8 +102,14 @@ RSpec.describe Security::ReportSummaryService, '#execute' do
expect(result[:dast][:scanned_resources].length).to eq(20)
end
it 'returns the scanned_resources_csv_path as nil' do
expect(result[:dast][:scanned_resources_csv_path]).to be_nil
it 'returns the scanned_resources_csv_path' do
expected_path = Gitlab::Routing.url_helpers.project_security_scanned_resources_path(
project,
format: :csv,
pipeline_id: pipeline.id
)
expect(result[:dast][:scanned_resources_csv_path]).to eq(expected_path)
end
context 'When no security scans ran' do
......
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