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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0d9fc516
Commit
0d9fc516
authored
Nov 26, 2019
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix change to default colors in job log
parent
f5a785a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
changelogs/unreleased/fix-job-log-default-colors.yml
changelogs/unreleased/fix-job-log-default-colors.yml
+5
-0
lib/gitlab/ci/ansi2json/parser.rb
lib/gitlab/ci/ansi2json/parser.rb
+2
-3
lib/gitlab/ci/ansi2json/style.rb
lib/gitlab/ci/ansi2json/style.rb
+2
-2
spec/lib/gitlab/ci/ansi2json/style_spec.rb
spec/lib/gitlab/ci/ansi2json/style_spec.rb
+4
-0
No files found.
changelogs/unreleased/fix-job-log-default-colors.yml
0 → 100644
View file @
0d9fc516
---
title
:
Fix change to default foreground and backgorund colors in job log
merge_request
:
20787
author
:
type
:
fixed
lib/gitlab/ci/ansi2json/parser.rb
View file @
0d9fc516
...
...
@@ -94,7 +94,7 @@ module Gitlab
def
on_38
(
stack
)
{
fg:
fg_color_256
(
stack
)
}
end
def
on_39
(
_
)
{
fg:
fg_color
(
9
)
}
end
def
on_39
(
_
)
{
fg:
nil
}
end
def
on_40
(
_
)
{
bg:
bg_color
(
0
)
}
end
...
...
@@ -114,8 +114,7 @@ module Gitlab
def
on_48
(
stack
)
{
bg:
bg_color_256
(
stack
)
}
end
# TODO: all the x9 never get called?
def
on_49
(
_
)
{
fg:
fg_color
(
9
)
}
end
def
on_49
(
_
)
{
bg:
nil
}
end
def
on_90
(
_
)
{
fg:
fg_color
(
0
,
'l'
)
}
end
...
...
lib/gitlab/ci/ansi2json/style.rb
View file @
0d9fc516
...
...
@@ -61,9 +61,9 @@ module Gitlab
case
when
changes
[
:reset
]
reset!
when
changes
[
:fg
]
when
changes
.
key?
(
:fg
)
@fg
=
changes
[
:fg
]
when
changes
[
:bg
]
when
changes
.
key?
(
:bg
)
@bg
=
changes
[
:bg
]
when
changes
[
:enable
]
@mask
|=
changes
[
:enable
]
...
...
spec/lib/gitlab/ci/ansi2json/style_spec.rb
View file @
0d9fc516
...
...
@@ -147,6 +147,10 @@ describe Gitlab::Ci::Ansi2json::Style do
[
%w[1]
,
%w[0]
,
''
,
'resets style from format bold'
],
[
%w[1 3]
,
%w[0]
,
''
,
'resets style from format bold and italic'
],
[
%w[1 3 term-fg-l-red term-bg-yellow]
,
%w[0]
,
''
,
'resets all formats and colors'
],
# default foreground
[
%w[31 42]
,
%w[39]
,
'term-bg-green'
,
'set foreground from red to default leaving background unchanged'
],
# default background
[
%w[31 42]
,
%w[49]
,
'term-fg-red'
,
'set background from green to default leaving foreground unchanged'
],
# misc
[[],
%w[1 30 42 3]
,
'term-fg-l-black term-bg-green term-bold term-italic'
,
'adds fg color, bg color and formats from no style'
],
[
%w[3 31]
,
%w[23 1 43]
,
'term-fg-l-red term-bg-yellow term-bold'
,
'replaces format italic with bold and adds a yellow background'
]
...
...
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