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
3fbcc8ad
Commit
3fbcc8ad
authored
Jun 16, 2020
by
Alan Paruszewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return individual links to issue for each finding in Pipeline Security
parent
1710adae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
ee/app/models/vulnerabilities/occurrence.rb
ee/app/models/vulnerabilities/occurrence.rb
+1
-1
ee/spec/models/vulnerabilities/occurrence_spec.rb
ee/spec/models/vulnerabilities/occurrence_spec.rb
+26
-0
No files found.
ee/app/models/vulnerabilities/occurrence.rb
View file @
3fbcc8ad
...
@@ -205,7 +205,7 @@ module Vulnerabilities
...
@@ -205,7 +205,7 @@ module Vulnerabilities
occurrence_keys
.
each
do
|
occurrence_key
|
occurrence_keys
.
each
do
|
occurrence_key
|
loader
.
call
(
loader
.
call
(
occurrence_key
,
occurrence_key
,
feedback
.
select
{
|
f
|
occurrence_key
=
f
.
occurrence_key
}
feedback
.
select
{
|
f
|
occurrence_key
=
=
f
.
occurrence_key
}
)
)
end
end
end
end
...
...
ee/spec/models/vulnerabilities/occurrence_spec.rb
View file @
3fbcc8ad
...
@@ -529,6 +529,32 @@ RSpec.describe Vulnerabilities::Occurrence do
...
@@ -529,6 +529,32 @@ RSpec.describe Vulnerabilities::Occurrence do
subject
(
:load_feedback
)
{
occurrence
.
load_feedback
.
to_a
}
subject
(
:load_feedback
)
{
occurrence
.
load_feedback
.
to_a
}
it
{
is_expected
.
to
eq
(
expected_feedback
)
}
it
{
is_expected
.
to
eq
(
expected_feedback
)
}
context
'when you have multiple occurrences'
do
let_it_be
(
:occurrence_2
)
do
create
(
:vulnerabilities_occurrence
,
report_type: :dependency_scanning
,
project:
project
)
end
let_it_be
(
:feedback_2
)
do
create
(
:vulnerability_feedback
,
:dependency_scanning
,
:dismissal
,
project:
project
,
project_fingerprint:
occurrence_2
.
project_fingerprint
)
end
let
(
:expected_feedback
)
{
[[
feedback
],
[
feedback_2
]]
}
subject
(
:load_feedback
)
{
[
occurrence
,
occurrence_2
].
map
(
&
:load_feedback
)
}
it
{
is_expected
.
to
eq
(
expected_feedback
)
}
end
end
end
describe
'#state'
do
describe
'#state'
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