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
1646149f
Commit
1646149f
authored
May 28, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
parent
4467fbd0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
2 deletions
+44
-2
app/controllers/projects/artifacts_controller.rb
app/controllers/projects/artifacts_controller.rb
+10
-2
changelogs/unreleased/218557-geo-design-thumbnails-are-not-replicated.yml
...eased/218557-geo-design-thumbnails-are-not-replicated.yml
+5
-0
changelogs/unreleased/sh-fix-artifacts-download-404.yml
changelogs/unreleased/sh-fix-artifacts-download-404.yml
+5
-0
spec/controllers/projects/artifacts_controller_spec.rb
spec/controllers/projects/artifacts_controller_spec.rb
+18
-0
spec/features/projects/artifacts/user_downloads_artifacts_spec.rb
...tures/projects/artifacts/user_downloads_artifacts_spec.rb
+6
-0
No files found.
app/controllers/projects/artifacts_controller.rb
View file @
1646149f
...
...
@@ -111,7 +111,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
def
build
@build
||=
begin
build
=
build_from_id
||
build_from_ref
build
=
build_from_id
||
build_from_
sha
||
build_from_
ref
build
&
.
present
(
current_user:
current_user
)
end
end
...
...
@@ -125,7 +125,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
project
.
builds
.
find_by_id
(
params
[
:job_id
])
if
params
[
:job_id
]
end
def
build_from_ref
def
build_from_sha
return
if
params
[
:job
].
blank?
return
unless
@ref_name
commit
=
project
.
commit
(
@ref_name
)
...
...
@@ -134,6 +135,13 @@ class Projects::ArtifactsController < Projects::ApplicationController
project
.
latest_successful_build_for_sha
(
params
[
:job
],
commit
.
id
)
end
def
build_from_ref
return
if
params
[
:job
].
blank?
return
unless
@ref_name
project
.
latest_successful_build_for_ref
(
params
[
:job
],
@ref_name
)
end
def
artifacts_file
@artifacts_file
||=
build
&
.
artifacts_file_for_type
(
params
[
:file_type
]
||
:archive
)
end
...
...
changelogs/unreleased/218557-geo-design-thumbnails-are-not-replicated.yml
0 → 100644
View file @
1646149f
---
title
:
Fix Geo replication for design thumbnails
merge_request
:
32703
author
:
type
:
fixed
changelogs/unreleased/sh-fix-artifacts-download-404.yml
0 → 100644
View file @
1646149f
---
title
:
Fix 404s downloading build artifacts
merge_request
:
32741
author
:
type
:
fixed
spec/controllers/projects/artifacts_controller_spec.rb
View file @
1646149f
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
describe
Projects
::
ArtifactsController
do
include
RepoHelpers
let
(
:user
)
{
project
.
owner
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
...
...
@@ -447,6 +449,22 @@ describe Projects::ArtifactsController do
expect
(
response
).
to
redirect_to
(
path
)
end
end
context
'with a failed pipeline on an updated master'
do
before
do
create_file_in_repo
(
project
,
'master'
,
'master'
,
'test.txt'
,
'This is test'
)
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
sha
,
ref:
project
.
default_branch
,
status:
'failed'
)
get
:latest_succeeded
,
params:
params_from_ref
(
project
.
default_branch
)
end
it_behaves_like
'redirect to the job'
end
end
end
end
spec/features/projects/artifacts/user_downloads_artifacts_spec.rb
View file @
1646149f
...
...
@@ -32,5 +32,11 @@ describe "User downloads artifacts" do
it_behaves_like
"downloading"
end
context
"via SHA"
do
let
(
:url
)
{
latest_succeeded_project_artifacts_path
(
project
,
"
#{
pipeline
.
sha
}
/download"
,
job:
job
.
name
)
}
it_behaves_like
"downloading"
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