ci_run_n_monitor: fix padding in links

8f557b84f6 was done because `text` is sometimes just an int,
but the fix was only applies to the padding calculation.

Unfortunately, the padding direction is also different between strings
and integers, which means the behaviour is now incoherent.

Let's convert `text` to a string before we start doing anything so that
everything afterwards is coherent.

Fixes: 8f557b84f6 ("ci: crnm: fix hyperlink format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35587>
This commit is contained in:
Eric Engestrom 2025-06-17 15:46:16 +02:00 committed by Marge Bot
parent 21ed913198
commit 14fedcfb8d

View file

@ -611,7 +611,8 @@ def __job_duration_record(dict_item: tuple) -> str:
def link2print(url: str, text: str, text_pad: int = 0) -> str:
text_pad = len(str(text)) if text_pad < 1 else text_pad
text = str(text)
text_pad = len(text) if text_pad < 1 else text_pad
return f"{URL_START}{url}\a{text:{text_pad}}{URL_END}"