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
0e22fdf8
Commit
0e22fdf8
authored
Feb 25, 2020
by
Michał Zając
Committed by
Kamil Trzciński
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for Security::PipelineVulnerabilitiesFinder behaviour
parent
3a0fc1b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
+5
-0
ee/lib/api/vulnerability_findings.rb
ee/lib/api/vulnerability_findings.rb
+5
-0
No files found.
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
View file @
0e22fdf8
...
...
@@ -73,6 +73,11 @@ module Security
end
end
# This finder is used for fetching vulnerabilities for any pipeline, if we used it to fetch
# vulnerabilities for a non-default-branch, the occurrences will be unpersisted, so we
# coerce the POROs into unpersisted AR records to give them a common object.
# See https://gitlab.com/gitlab-org/gitlab/issues/33588#note_291849433 for more context
# on why this happens.
def
normalize_report_occurrences
(
report_occurrences
,
vulnerabilities
)
report_occurrences
.
map
do
|
report_occurrence
|
occurrence_hash
=
report_occurrence
.
to_hash
...
...
ee/lib/api/vulnerability_findings.rb
View file @
0e22fdf8
...
...
@@ -56,6 +56,11 @@ module API
get
':id/vulnerability_findings'
do
authorize!
:read_vulnerability
,
user_project
# We might have to add rubocop:disable annotation here in case
# https://gitlab.com/gitlab-org/gitlab/issues/32763 happens, using
# Kaminari.paginate_array here is correct
# See https://gitlab.com/gitlab-org/gitlab/issues/33588#note_291849433
# for discussion
vulnerability_occurrences
=
paginate
(
Kaminari
.
paginate_array
(
vulnerability_occurrences_by
(
declared_params
)
...
...
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