Skip to content

Make color palettes in logs consistent

Miguel Rincon requested to merge 465350-better-color-handling into master

What does this MR do and why?

This change creates a single source of truth for the first 16 ansi colors used in the log pages.

With this change, colors produced using the 256 color palette (8-bit ansi colors) are updated to follow our base color palette (3/4-bit).

The our runners use mostly the base color palette, so no major changes are expected for most logs.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

No changes are expected in most logs, as the base colors are preserved:

image

However, some colors in the 256 palette are update to match the base colors:

master This MR
Screenshot_2024-08-05_at_14.16.24 Screenshot_2024-08-05_at_14.15.23

How to set up and validate locally

We've used https://gitlab.com/ajwalker/colourful/-/blob/main/.gitlab-ci.yml to generate the job log above.

stages:
  - colourful

variables:
    FF_TIMESTAMPS: "true"

colourful:
    stage: colourful
    image: alpine:latest
    script:
        # https://askubuntu.com/questions/27314/script-to-display-all-terminal-colors
        - apk add --no-cache gettext bash
        - bash -c 'for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo ""'
        - apk add --no-cache gettext
        - TERM=xterm msgcat --color=test
        - TERM=xterm-256color msgcat --color=test

Make sure you visit the full low viewer, it is located at /my-group/my-project/-/jobs/2516/viewer

Edited by Miguel Rincon

Merge request reports

Loading