Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
74d8e7eb0fd5
Unverified
Commit
ed517340
authored
Jun 21, 2016
by
Tomasz Maczukin
Browse files
Handle error on trace raw download with old builds (DB stored)
parent
b9322063b471
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/controllers/projects/builds_controller.rb
View file @
74d8e7eb
...
...
@@ -78,7 +78,7 @@ def erase
end
def
raw
if
@build
.
has_trace?
if
@build
.
has_trace
_file
?
send_file
@build
.
path_to_trace
,
type:
'text/plain; charset=utf-8'
,
disposition:
'inline'
else
render_404
...
...
app/models/ci/build.rb
View file @
74d8e7eb
...
...
@@ -208,6 +208,10 @@ def extract_coverage(text, regex)
end
end
def
has_trace_file?
File
.
exist?
(
path_to_trace
)
||
(
project
.
ci_id
&&
File
.
exist?
(
old_path_to_trace
))
end
def
has_trace?
raw_trace
.
present?
end
...
...
app/views/projects/builds/_sidebar.html.haml
View file @
74d8e7eb
...
...
@@ -100,7 +100,7 @@
-
elsif
@build
.
runner
\##{@build.runner.id}
.btn-group.btn-group-justified
{
role: :group
}
-
if
@build
.
has_trace?
-
if
@build
.
has_trace
_file
?
=
link_to
'Raw'
,
raw_namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
-
if
@build
.
active?
=
link_to
"Cancel"
,
cancel_namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'btn btn-sm btn-default'
,
method: :post
...
...
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