BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
build.rb
app/models/ci/build.rb
+10
-7
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