Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
0e548473
Commit
0e548473
authored
Oct 01, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: CI token removal regression from build trace
parent
9d825723
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
app/models/ci/build.rb
app/models/ci/build.rb
+10
-7
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+11
-0
No files found.
app/models/ci/build.rb
View file @
0e548473
...
...
@@ -143,12 +143,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
...
...
@@ -223,7 +217,7 @@ module Ci
end
end
def
trace
def
raw_
trace
if
File
.
exist?
(
path_to_trace
)
File
.
read
(
path_to_trace
)
else
...
...
@@ -232,6 +226,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
...
...
spec/models/ci/build_spec.rb
View file @
0e548473
...
...
@@ -178,6 +178,17 @@ describe Ci::Build do
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment