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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
dfb8fcbb
Commit
dfb8fcbb
authored
Sep 05, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use API helper to send artifact file through Workhorse
parent
83600e94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
lib/api/helpers.rb
lib/api/helpers.rb
+4
-0
lib/api/jobs.rb
lib/api/jobs.rb
+1
-1
spec/requests/api/jobs_spec.rb
spec/requests/api/jobs_spec.rb
+2
-3
No files found.
lib/api/helpers.rb
View file @
dfb8fcbb
...
...
@@ -432,6 +432,10 @@ module API
header
(
*
Gitlab
::
Workhorse
.
send_git_archive
(
repository
,
ref:
ref
,
format:
format
))
end
def
send_artifacts_entry
(
build
,
entry
)
header
(
*
Gitlab
::
Workhorse
.
send_artifacts_entry
(
build
,
entry
))
end
# The Grape Error Middleware only has access to env but no params. We workaround this by
# defining a method that returns the right value.
def
define_params_for_grape_middleware
...
...
lib/api/jobs.rb
View file @
dfb8fcbb
...
...
@@ -101,7 +101,7 @@ module API
entry
=
build
.
artifacts_metadata_entry
(
params
[
:artifact_path
])
not_found!
unless
entry
.
exists?
Gitlab
::
Workhorse
.
send_artifacts_entry
(
build
,
entry
)
send_artifacts_entry
(
build
,
entry
)
end
desc
'Download the artifacts file from a job'
do
...
...
spec/requests/api/jobs_spec.rb
View file @
dfb8fcbb
...
...
@@ -215,10 +215,9 @@ describe API::Jobs do
get_artifact_file
(
artifact
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
.
body
)
.
to
include
'Gitlab-Workhorse-Send-Data'
,
'artifacts-entry'
expect
(
response
.
headers
)
.
to
include
(
'Content-Type'
=>
'application/json'
)
.
to
include
(
'Content-Type'
=>
'application/json'
,
'Gitlab-Workhorse-Send-Data'
=>
/artifacts-entry/
)
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