This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit 0e548473 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fix: CI token removal regression from build trace

parent 1ff5fe6a32ce
......@@ -143,12 +143,6 @@ def trace_html
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
......@@ -223,7 +217,7 @@ def extract_coverage(text, regex)
end
end
def trace
def raw_trace
if File.exist?(path_to_trace)
File.read(path_to_trace)
else
......@@ -232,6 +226,15 @@ def trace
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
......
......@@ -178,6 +178,17 @@
it { is_expected.to include(text) }
it { expect(subject.length).to be >= text.length }
end
context 'if build.trace hides token' do
let(:token) { 'my_secret_token' }
before do
build.project.update_attributes(token: token)
build.update_attributes(trace: token)
end
it { is_expected.to_not include(token) }
end
end
describe :timeout do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment