diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-01-25 21:36:22 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-01-25 21:36:22 +0900 |
commit | 575bd66ac0d513acd5d43524180898a76364a1d0 (patch) | |
tree | c93ac39a9662861f58c3b8789e302b38737542db | |
parent | b320ad35b92806ed4d144af8894ed44598f777d5 (diff) | |
download | gitlab-ce-feature/sm/artifacts-trace-2.tar.gz |
-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 |