diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-08-25 13:53:20 +0200 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-09-01 14:00:45 +0200 |
commit | 56011f9f697b7ca42f786735a2249014dd3ef18d (patch) | |
tree | f11d0ae0c02795d2262ec955c84dc38a6e48b448 | |
parent | cc365e98067408a44922d89f7f266b77a68d9cb5 (diff) | |
download | gitlab-ce-56011f9f697b7ca42f786735a2249014dd3ef18d.tar.gz |
Refactorize CI::Build model
-rw-r--r-- | app/models/ci/build.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 76142c4b2b6..8a8f848d328 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -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? |