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
d5fec7ff
Commit
d5fec7ff
authored
Mar 09, 2021
by
James Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove join with Vulnerability model
parent
9062eda8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
+2
-3
ee/spec/finders/security/pipeline_vulnerabilities_finder_spec.rb
.../finders/security/pipeline_vulnerabilities_finder_spec.rb
+4
-4
No files found.
ee/app/finders/security/pipeline_vulnerabilities_finder.rb
View file @
d5fec7ff
...
@@ -59,9 +59,8 @@ module Security
...
@@ -59,9 +59,8 @@ module Security
def
vulnerabilities_by_finding_fingerprint
(
report_type
,
report
)
def
vulnerabilities_by_finding_fingerprint
(
report_type
,
report
)
Vulnerabilities
::
Finding
Vulnerabilities
::
Finding
.
by_project_fingerprints
(
report
.
findings
.
map
(
&
:project_fingerprint
))
.
by_project_fingerprints
(
report
.
findings
.
map
(
&
:project_fingerprint
))
.
where
(
.
by_projects
(
pipeline
.
project
)
project:
pipeline
.
project
,
.
by_report_types
(
report_type
)
report_type:
report_type
)
.
select
(
:vulnerability_id
,
:project_fingerprint
)
.
select
(
:vulnerability_id
,
:project_fingerprint
)
.
each_with_object
({})
do
|
finding
,
hash
|
.
each_with_object
({})
do
|
finding
,
hash
|
hash
[
finding
.
project_fingerprint
]
=
finding
.
vulnerability_id
hash
[
finding
.
project_fingerprint
]
=
finding
.
vulnerability_id
...
...
ee/spec/finders/security/pipeline_vulnerabilities_finder_spec.rb
View file @
d5fec7ff
...
@@ -97,13 +97,13 @@ RSpec.describe Security::PipelineVulnerabilitiesFinder do
...
@@ -97,13 +97,13 @@ RSpec.describe Security::PipelineVulnerabilitiesFinder do
project_fingerprint:
report_finding
.
project_fingerprint
)
project_fingerprint:
report_finding
.
project_fingerprint
)
end
end
#
there's something being cached... need to run this once to get rid of that
#
Need to warm the cache
described_class
.
new
(
pipeline:
pipeline
,
params:
{
report_type:
%w[dependency_scanning]
}).
execute
described_class
.
new
(
pipeline:
pipeline
,
params:
{
report_type:
%w[dependency_scanning]
}).
execute
expect
{
expect
do
described_class
.
new
(
pipeline:
pipeline
,
params:
{
report_type:
%w[dependency_scanning]
}).
execute
}.
to
issue_same_number_of_queries_as
{
described_class
.
new
(
pipeline:
pipeline
,
params:
{
report_type:
%w[sast]
}).
execute
described_class
.
new
(
pipeline:
pipeline
,
params:
{
report_type:
%w[sast]
}).
execute
end
.
to
issue_same_number_of_queries_as
{
described_class
.
new
(
pipeline:
pipeline
,
params:
{
report_type:
%w[dependency_scanning]
}).
execute
}
}
end
end
end
end
...
...
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