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
bc70f918
Commit
bc70f918
authored
Feb 04, 2020
by
David Fernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix npm package uploads with unexpected structures
For example, when bundledDependencies is set to `false`
parent
7fe12297
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
ee/app/services/packages/create_dependency_service.rb
ee/app/services/packages/create_dependency_service.rb
+1
-1
ee/changelogs/unreleased/198471-npm-dependencies-uploads-with-bundledependencies-false.yml
...pm-dependencies-uploads-with-bundledependencies-false.yml
+5
-0
ee/spec/services/packages/create_dependency_service_spec.rb
ee/spec/services/packages/create_dependency_service_spec.rb
+20
-1
No files found.
ee/app/services/packages/create_dependency_service.rb
View file @
bc70f918
...
...
@@ -17,7 +17,7 @@ module Packages
private
def
create_dependency
(
type
)
return
unless
dependencies
.
key?
(
type
)
return
unless
dependencies
[
type
].
is_a?
(
Hash
)
names_and_version_patterns
=
dependencies
[
type
]
existing_ids
,
existing_names
=
find_existing_ids_and_names
(
names_and_version_patterns
)
...
...
ee/changelogs/unreleased/198471-npm-dependencies-uploads-with-bundledependencies-false.yml
0 → 100644
View file @
bc70f918
---
title
:
Fix npm package uploads when bundleDependencies is set to
false
merge_request
:
24355
author
:
type
:
fixed
ee/spec/services/packages/create_dependency_service_spec.rb
View file @
bc70f918
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Packages
::
CreateDependencyService
do
describe
'#execute'
do
let_it_be
(
:namespace
)
{
create
(
:namespace
)}
let_it_be
(
:version
)
{
'1.0.1'
.
freeze
}
let_it_be
(
:version
)
{
'1.0.1'
}
let_it_be
(
:package_name
)
{
"@
#{
namespace
.
path
}
/my-app"
.
freeze
}
context
'when packages are published'
do
...
...
@@ -89,6 +89,25 @@ describe Packages::CreateDependencyService do
.
and
change
{
Packages
::
DependencyLink
.
count
}.
by
(
1
)
end
end
context
'with a dependency not described with a hash'
do
let
(
:invalid_dependencies
)
{
dependencies
.
tap
{
|
d
|
d
[
'bundleDependencies'
]
=
false
}
}
subject
{
described_class
.
new
(
package
,
invalid_dependencies
).
execute
}
it
'creates dependencies and links'
do
expect
(
Packages
::
Dependency
)
.
to
receive
(
:ids_for_package_names_and_version_patterns
)
.
once
.
and_call_original
expect
{
subject
}
.
to
change
{
Packages
::
Dependency
.
count
}.
by
(
1
)
.
and
change
{
Packages
::
DependencyLink
.
count
}.
by
(
1
)
expect
(
dependency_names
).
to
match_array
(
%w(express)
)
expect
(
dependency_link_types
).
to
match_array
(
%w(dependencies)
)
end
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