Refactorize CI::Build model

This commit is contained in:
Tomasz Maczukin 2016-08-25 13:53:20 +02:00
parent cc365e9806
commit 56011f9f69
No known key found for this signature in database
GPG Key ID: 7E9EB2E4B0F625CD
1 changed files with 10 additions and 2 deletions

View File

@ -209,7 +209,7 @@ module Ci
end
def has_trace_file?
File.exist?(path_to_trace) || (project.ci_id && File.exist?(old_path_to_trace))
File.exist?(path_to_trace) || has_old_trace_file?
end
def has_trace?
@ -219,7 +219,7 @@ module Ci
def raw_trace
if File.file?(path_to_trace)
File.read(path_to_trace)
elsif project.ci_id && File.file?(old_path_to_trace)
elsif has_old_trace_file?
# Temporary fix for build trace data integrity
File.read(old_path_to_trace)
else
@ -228,6 +228,14 @@ module Ci
end
end
##
# Deprecated
#
# This is a hotfix for CI build data integrity, see #4246
def has_old_trace_file?
project.ci_id && File.exist?(old_path_to_trace)
end
def trace
trace = raw_trace
if project && trace.present? && project.runners_token.present?