crnm: default wo coloring when unknown GitLab job status

When GitLab adds new job statuses, we need to upgrade the coloring dictionary.
By having a default value for non-colored output, we handle future unknown
status, and avoid crashes.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38919>
This commit is contained in:
Sergi Blanch Torne 2025-12-12 11:18:53 +01:00 committed by Marge Bot
parent d75f5e0add
commit c5f5b6b78d

View file

@ -45,7 +45,7 @@ REFRESH_WAIT_LOG = 10
REFRESH_WAIT_JOBS = 6
MAX_ENABLE_JOB_ATTEMPTS = 3
STATUS_COLORS = {
STATUS_COLORS = defaultdict(lambda: "", {
"created": "",
"running": "[blue]",
"success": "[green]",
@ -55,7 +55,7 @@ STATUS_COLORS = {
"manual": "",
"pending": "",
"skipped": "",
}
})
COMPLETED_STATUSES = frozenset({"success", "failed"})
RUNNING_STATUSES = frozenset({"created", "pending", "running"})