Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b9ba828c
Commit
b9ba828c
authored
Jul 15, 2020
by
Craig Smith
Committed by
charlie ablett
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scanned_resources CSV path to Security Report Summary
parent
7f2bd61f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
ee/app/services/security/report_summary_service.rb
ee/app/services/security/report_summary_service.rb
+8
-1
ee/changelogs/unreleased/replace_nil_path_in_scanned_resources_csv_path_223673.yml
...replace_nil_path_in_scanned_resources_csv_path_223673.yml
+5
-0
ee/spec/services/security/report_summary_service_spec.rb
ee/spec/services/security/report_summary_service_spec.rb
+8
-2
No files found.
ee/app/services/security/report_summary_service.rb
View file @
b9ba828c
...
@@ -31,11 +31,18 @@ module Security
...
@@ -31,11 +31,18 @@ module Security
when
:scanned_resources
when
:scanned_resources
response
[
:scanned_resources
]
=
scanned_resources
[
report_type
.
to_s
]
response
[
:scanned_resources
]
=
scanned_resources
[
report_type
.
to_s
]
when
:scanned_resources_csv_path
when
:scanned_resources_csv_path
nil
response
[
:scanned_resources_csv_path
]
=
csv_path
end
end
end
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
)
def
requested_report_types
(
summary_type
)
@report_types_for_summary_type
||=
Gitlab
::
Utils
.
multiple_key_invert
(
@selection_information
)
@report_types_for_summary_type
||=
Gitlab
::
Utils
.
multiple_key_invert
(
@selection_information
)
@report_types_for_summary_type
[
summary_type
].
map
(
&
:to_s
)
@report_types_for_summary_type
[
summary_type
].
map
(
&
:to_s
)
...
...
ee/changelogs/unreleased/replace_nil_path_in_scanned_resources_csv_path_223673.yml
0 → 100644
View file @
b9ba828c
---
title
:
Add scanned_resources CSV path to Security Report Summary
merge_request
:
36810
author
:
type
:
added
ee/spec/services/security/report_summary_service_spec.rb
View file @
b9ba828c
...
@@ -102,8 +102,14 @@ RSpec.describe Security::ReportSummaryService, '#execute' do
...
@@ -102,8 +102,14 @@ RSpec.describe Security::ReportSummaryService, '#execute' do
expect
(
result
[
:dast
][
:scanned_resources
].
length
).
to
eq
(
20
)
expect
(
result
[
:dast
][
:scanned_resources
].
length
).
to
eq
(
20
)
end
end
it
'returns the scanned_resources_csv_path as nil'
do
it
'returns the scanned_resources_csv_path'
do
expect
(
result
[
:dast
][
:scanned_resources_csv_path
]).
to
be_nil
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
end
context
'When no security scans ran'
do
context
'When no security scans ran'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment