Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-01 12:43:06 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-10-05 21:06:29 +0300
commit38b0bd31e30c54e78a851bcdc021accb53cd7df7 (patch)
tree54cffdbf6fd5c83c9f3729a40d55a8be5a71dcd1 /app
parent9a26120c718be30f956b972174e1fccffa711acb (diff)
Fix: CI token removal regression from build trace
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 8096d4fa5ae..f0cf20247dc 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -145,12 +145,6 @@ module Ci
html ||= ''
end
- def trace
- if project && read_attribute(:trace).present?
- read_attribute(:trace).gsub(project.token, 'xxxxxx')
- end
- end
-
def started?
!pending? && !canceled? && started_at
end
@@ -225,7 +219,7 @@ module Ci
end
end
- def trace
+ def raw_trace
if File.exist?(path_to_trace)
File.read(path_to_trace)
else
@@ -234,6 +228,15 @@ module Ci
end
end
+ def trace
+ trace = raw_trace
+ if project && trace.present?
+ trace.gsub(project.token, 'xxxxxx')
+ else
+ trace
+ end
+ end
+
def trace=(trace)
unless Dir.exists? dir_to_trace
FileUtils.mkdir_p dir_to_trace