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
ac53e239
Commit
ac53e239
authored
Dec 05, 2019
by
Steve Abrams
Committed by
Robert Speicher
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BINARY_PACKAGE to conan_file_metadatum
Add filename reference to avoid repeated variables
parent
b178a781
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
ee/app/models/packages/conan_file_metadatum.rb
ee/app/models/packages/conan_file_metadatum.rb
+1
-0
ee/lib/api/conan_packages.rb
ee/lib/api/conan_packages.rb
+6
-0
ee/spec/requests/api/conan_packages_spec.rb
ee/spec/requests/api/conan_packages_spec.rb
+13
-0
No files found.
ee/app/models/packages/conan_file_metadatum.rb
View file @
ac53e239
...
...
@@ -19,4 +19,5 @@ class Packages::ConanFileMetadatum < ApplicationRecord
RECIPE_FILES
=
%w[conanfile.py conanmanifest.txt]
.
freeze
PACKAGE_FILES
=
%w[conaninfo.txt conanmanifest.txt conan_package.tgz]
.
freeze
PACKAGE_BINARY
=
'conan_package.tgz'
end
ee/lib/api/conan_packages.rb
View file @
ac53e239
...
...
@@ -187,6 +187,8 @@ module API
delete
do
authorize!
(
:destroy_package
,
project
)
track_event
(
'delete_package'
)
package
.
destroy
end
end
...
...
@@ -373,6 +375,8 @@ module API
package_file
=
::
Packages
::
PackageFileFinder
.
new
(
package
,
"
#{
params
[
:file_name
]
}
"
,
conan_file_type:
file_type
).
execute!
track_event
(
'pull_package'
)
if
params
[
:file_name
]
==
::
Packages
::
ConanFileMetadatum
::
PACKAGE_BINARY
present_carrierwave_file!
(
package_file
.
file
)
end
...
...
@@ -384,6 +388,8 @@ module API
current_package
=
package
||
::
Packages
::
Conan
::
CreatePackageService
.
new
(
project
,
current_user
,
params
).
execute
track_event
(
'push_package'
)
if
params
[
:file_name
]
==
::
Packages
::
ConanFileMetadatum
::
PACKAGE_BINARY
&&
params
[
'file.size'
].
positive?
# conan sends two upload requests, the first has no file, so we skip record creation if file.size == 0
::
Packages
::
Conan
::
CreatePackageFileService
.
new
(
current_package
,
uploaded_file
,
params
.
merge
(
conan_file_type:
file_type
)).
execute
unless
params
[
'file.size'
]
==
0
rescue
ObjectStorage
::
RemoteStoreError
=>
e
...
...
ee/spec/requests/api/conan_packages_spec.rb
View file @
ac53e239
...
...
@@ -434,6 +434,8 @@ describe API::ConanPackages do
project
.
add_maintainer
(
user
)
end
it_behaves_like
'a gitlab tracking event'
,
described_class
.
name
,
'delete_package'
it
'deletes a package'
do
expect
{
subject
}.
to
change
{
Packages
::
Package
.
count
}.
from
(
2
).
to
(
1
)
end
...
...
@@ -546,6 +548,12 @@ describe API::ConanPackages do
it_behaves_like
'an internal project with packages'
it_behaves_like
'a private project with packages'
it_behaves_like
'a project is not found'
context
'tracking the conan_package.tgz download'
do
let
(
:package_file
)
{
package
.
package_files
.
find_by
(
file_name:
::
Packages
::
ConanFileMetadatum
::
PACKAGE_BINARY
)
}
it_behaves_like
'a gitlab tracking event'
,
described_class
.
name
,
'pull_package'
end
end
end
...
...
@@ -783,6 +791,11 @@ describe API::ConanPackages do
it_behaves_like
'rejects invalid recipe'
it_behaves_like
'uploads a package file'
context
'tracking the conan_package.tgz upload'
do
let
(
:file_name
)
{
::
Packages
::
ConanFileMetadatum
::
PACKAGE_BINARY
}
it_behaves_like
'a gitlab tracking event'
,
described_class
.
name
,
'push_package'
end
end
def
temp_file
(
package_tmp
)
...
...
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