The Jenkins console output has grey lines over grey background and is not readable:
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
jjb: update tox v4 jobs to decrease verbosity | integration/config | master | +12 -12 | |
dockerfiles: lower tox 4 verbosity | integration/config | master | +49 -1 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | hashar | T345695 Deal with tox 4 upgrading | |||
Resolved | hashar | T347241 Tox verbose outputs has poor contrast in Jenkins console output |
Event Timeline
Then ANSI sequences are rendered by the Jenkins ANSI Color Plugin. I has some several mappings between the ANSI colors and the HTML/CSS rendered color. We use xterm and the defaults are defined at https://github.com/jenkinsci/ansicolor-plugin/blob/master/src/main/java/hudson/plugins/ansicolor/AnsiColorMap.java#L79
When looking at the Jenkins configuration, it states that got edited, I am not sure what got edited but here is our plugin XML configuration (only including the xterm mapping which is the one globally enabled:
<hudson.plugins.ansicolor.AnsiColorBuildWrapper_-DescriptorImpl plugin="ansicolor@0.7.5"> <globalColorMapName>xterm</globalColorMapName> <colorMaps> <hudson.plugins.ansicolor.AnsiColorMap> <name>xterm</name> <normalMap class="enum-map" enum-type="hudson.plugins.ansicolor.AnsiColorMap$Color"> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>BLACK</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#000000</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>RED</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#CD0000</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>GREEN</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#00CD00</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>YELLOW</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#CDCD00</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>BLUE</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#1E90FF</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>MAGENTA</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#CD00CD</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>CYAN</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#00CDCD</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>WHITE</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#E5E5E5</string> </entry> </normalMap> <brightMap class="enum-map" enum-type="hudson.plugins.ansicolor.AnsiColorMap$Color"> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>BLACK</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#4C4C4C</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>RED</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#FF0000</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>GREEN</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#00FF00</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>YELLOW</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#FFFF00</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>BLUE</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#4682B4</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>MAGENTA</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#FF00FF</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>CYAN</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#00FFFF</string> </entry> <entry> <hudson.plugins.ansicolor.AnsiColorMap_-Color>WHITE</hudson.plugins.ansicolor.AnsiColorMap_-Color> <string>#FFFFFF</string> </entry> </brightMap> </hudson.plugins.ansicolor.AnsiColorMap>
If I look at the Jenkins console HTML, the poor contrast lines have style="color: #E5E5E5" which is a light grey. In the XML configuration that is WHITE from the Normal map (and would be a #FFFFFF in the Bright map).
Tox uses colorama and there is a single occurrence of Fore.WHITE in v4.8.0 code:
class ToxHandler(logging.StreamHandler): ... @staticmethod def _get_formatter(level: int, enabled_level: int, is_colored: bool) -> logging.Formatter: # noqa: FBT001 color: int | str = "" if is_colored: if level >= logging.ERROR: color = Fore.RED elif level >= logging.WARNING: color = Fore.CYAN else: color = Fore.WHITE
The xterm map uses the Jenkins defaults colors for Background/Foreground (respectively black and some light grey). Maybe we can change the color map to gnome-terminal which uses a Black background and white foreground.
The built-in defaults for reference:
public static final AnsiColorMap XTerm = new AnsiColorMap( "xterm", "#000000", "#CD0000", "#00CD00", "#CDCD00", "#1E90FF", "#CD00CD", "#00CDCD", "#E5E5E5", "#4C4C4C", "#FF0000", "#00FF00", "#FFFF00", "#4682B4", "#FF00FF", "#00FFFF", "#FFFFFF", null, null ); public static final AnsiColorMap VGA = new AnsiColorMap( "vga", "#000000", "#AA0000", "#00AA00", "#AA5500", "#0000AA", "#AA00AA", "#00AAAA", "#AAAAAA", "#555555", "#FF5555", "#55FF55", "#FFFF55", "#5555FF", "#FF55FF", "#55FFFF", "#FFFFFF", Color.WHITE.ordinal(), Color.BLACK.ordinal() ); public static final AnsiColorMap CSS = new AnsiColorMap( "css", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", null, null ); public static final AnsiColorMap GnomeTerminal = new AnsiColorMap( "gnome-terminal", "#2E3436", "#CC0000", "#4E9A06", "#C4A000", "#3465A4", "#75507B", "#06989A", "#D3D7CF", "#2E3436", "#CC0000", "#4E9A06", "#C4A000", "#3465A4", "#75507B", "#06989A", "#D3D7CF", Color.WHITE.ordinal(), Color.BLACK.ordinal() );
I have manually edited https://integration.wikimedia.org/ci/job/pywikibot-core-tox-docker/ to change the color map to gnome-terminal. That did not reflect on the existing build. I have rebuild one that used tox v4 but the output has extra newlines:
Possibly due to a poor interaction with the timestamper plugin which looks like https://github.com/jenkinsci/ansicolor-plugin/issues/255 Disable Empty new lines before and after ANSI Color Block.
An alternative, we run tox in verbose mode tox -v, I guess the tox 4 image can remove the verbose flag which kind of work around the debug output being white on white.
Change 963992 had a related patch set uploaded (by Hashar; author: Hashar):
[integration/config@master] dockerfiles: lower tox 4 verbosity
Change 963992 merged by jenkins-bot:
[integration/config@master] dockerfiles: lower tox 4 verbosity
Mentioned in SAL (#wikimedia-releng) [2023-10-06T19:40:01Z] <hashar> Updating docker-pkg files for https://gerrit.wikimedia.org/r/c/integration/config/+/963992/ "lower tox 4 verbosity" # T347241
Successfully published image docker-registry.wikimedia.org/releng/tox-pywikibot:4.8.0-2
Successfully published image docker-registry.wikimedia.org/releng/tox-acme-chief:4.8.0-2
Successfully published image docker-registry.wikimedia.org/releng/tox-mysqld:4.8.0-2
Successfully published image docker-registry.wikimedia.org/releng/zuul-cloner:0.3.0-s4
Successfully published image docker-registry.wikimedia.org/releng/tox-buster:4.8.0-2
Successfully published image docker-registry.wikimedia.org/releng/tox-poolcounter:4.8.0-2
Successfully published image docker-registry.wikimedia.org/releng/tox-java8:4.8.0-2
Change 964075 had a related patch set uploaded (by Hashar; author: Hashar):
[integration/config@master] jjb: update tox v4 jobs to decrease verbosity
Among other jobs, two pywikibot related jobs got updated to drop -v when invoking tox:
Change 964075 merged by jenkins-bot:
[integration/config@master] jjb: update tox v4 jobs to decrease verbosity