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
4d180e42
Commit
4d180e42
authored
Nov 10, 2020
by
Tetiana Chupryna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent augmenting for orphan dependencies
parent
f8aeff16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
ee/lib/gitlab/ci/reports/dependency_list/report.rb
ee/lib/gitlab/ci/reports/dependency_list/report.rb
+1
-1
ee/spec/lib/gitlab/ci/reports/dependency_list/report_spec.rb
ee/spec/lib/gitlab/ci/reports/dependency_list/report_spec.rb
+13
-0
No files found.
ee/lib/gitlab/ci/reports/dependency_list/report.rb
View file @
4d180e42
...
...
@@ -51,7 +51,7 @@ module Gitlab
def
augment_ancestors!
@dependencies
.
each_value
do
|
dep
|
next
unless
dep
.
iid
next
unless
dep
.
location
[
:ancestors
]
next
if
dep
.
location
[
:top_level
]
if
dep
.
vulnerabilities
.
empty?
...
...
ee/spec/lib/gitlab/ci/reports/dependency_list/report_spec.rb
View file @
4d180e42
...
...
@@ -44,6 +44,19 @@ RSpec.describe Gitlab::Ci::Reports::DependencyList::Report do
expect
(
ancestors
.
last
).
to
eq
({
name:
direct
[
:name
],
version:
direct
[
:version
]
})
end
context
'when dependency path info is not full'
do
let
(
:orphan_dependency
)
{
build
:dependency
,
:with_vulnerabilities
,
iid:
3
}
before
do
report
.
add_dependency
(
orphan_dependency
)
end
it
'returns array of hashes'
do
expect
(
dependencies
).
to
be_an
(
Array
)
expect
(
dependencies
.
first
).
to
be_a
(
Hash
)
end
end
context
'with multiple dependency files matching same package manager'
do
let
(
:indirect_other
)
{
build
:dependency
,
:with_vulnerabilities
,
iid:
32
}
let
(
:direct_other
)
{
build
:dependency
,
:direct
,
:with_vulnerabilities
}
...
...
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