Support \r line breaks in job logs
Summary
With the new refactoring of job logs it appears that \r
alone wasn't considered as a line break.
This has never been parsed as a line break but the way we were displaying it before (with Ansi2html
) it was somehow rendered as new line. With the refactoring to Ansi2json
as we don't parse \r
as a line break it wasn't rendered.
Steps to reproduce
https://dev.gitlab.org/gitlab/omnibus-gitlab/-/jobs/5589369
From line 3581
we see that text that should be displayed in multiple lines gets rendered inline.
In the specific case, \r
was rendered by the terminal in order to refresh the current line (e.g. to refresh a progress bar).
In our job log it's fine to render these as separate lines.
Example Project
https://dev.gitlab.org/gitlab/omnibus-gitlab/-/jobs/5589369
What is the current bug behavior?
line one\rline two
are displayed inline as line one line two
What is the expected correct behavior?
line one
line two