diff options
-rw-r--r-- | lib/gitlab/ci/trace.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/ci/trace/full.rb | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index 15c35c831d7..95fbcd1b281 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -9,12 +9,10 @@ module Gitlab end def type(job) - if job.complete? && job.job_artifacts_trace.exists? + if job.complete? 'Full' - elsif job.running? - 'Live' else - 'Undefined' + 'Live' end end end diff --git a/lib/gitlab/ci/trace/full.rb b/lib/gitlab/ci/trace/full.rb index 2e3cf7ce664..314f4be43a5 100644 --- a/lib/gitlab/ci/trace/full.rb +++ b/lib/gitlab/ci/trace/full.rb @@ -5,7 +5,7 @@ module Gitlab delegate :old_trace, to: :job def exist? - job.job_artifacts_trace&.exists? || old_trace.present? + job.job_artifacts_trace&.exists? || current_path.present? || old_trace.present? end def erase! @@ -26,11 +26,16 @@ module Gitlab end def paths - raise 'Full trace does not allow write operation' + [ + default_path, + deprecated_path + ].compact end def current_path - raise 'Full trace does not allow write operation' + @current_path ||= paths.find do |trace_path| + File.exist?(trace_path) + end end def default_directory |