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
f09b53ee
Commit
f09b53ee
authored
Jul 06, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor loading of vulnerability feedback
parent
c8e83c99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
ee/app/models/vulnerabilities/occurrence.rb
ee/app/models/vulnerabilities/occurrence.rb
+7
-6
No files found.
ee/app/models/vulnerabilities/occurrence.rb
View file @
f09b53ee
...
...
@@ -119,14 +119,15 @@ module Vulnerabilities
}
BatchLoader
.
for
(
params
).
batch
do
|
items
,
loader
|
project_ids
=
items
.
group_by
{
|
i
|
i
[
:project_id
]
}
categories
=
items
.
group_by
{
|
i
|
i
[
:category
]
}
fingerprints
=
items
.
group_by
{
|
i
|
i
[
:project_fingerprint
]
}
project_ids
=
items
.
map
{
|
i
|
i
[
:project_id
]
}
categories
=
items
.
map
{
|
i
|
i
[
:category
]
}
fingerprints
=
items
.
map
{
|
i
|
i
[
:project_fingerprint
]
}
Vulnerabilities
::
Feedback
.
all_preloaded
.
where
(
project_id:
project_ids
.
keys
,
category:
categories
.
keys
,
project_fingerprint:
fingerprints
.
keys
).
find_each
do
|
feedback
|
project_id:
project_ids
.
uniq
,
category:
categories
.
uniq
,
project_fingerprint:
fingerprints
.
uniq
).
each
do
|
feedback
|
loaded_params
=
{
project_id:
feedback
.
project_id
,
category:
feedback
.
category
,
...
...
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