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?