Skip to content

GitLabCI - properly display OSC 8 links in job logs

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

We're using ansible-lint inside our GitLabCI Pipeline. ansible-lint generates clickable links to its rule-specific documentation for each linting rule violation.
It does this by using the ANSI escape sequence OSC 8.
This sequence is supported in many terminal emulators: https://github.com/Alhadis/OSC8-Adoption
However, in GitLab CI job output, the links get mangled so they don't work anymore. The only way to make them work is by disabling color output for ansible-lint entirely.
Example screenshot from Windows Terminal: grafik

Example screenshot from GitLabCI job trace: grafik As you can see, the links get truncated in two places:

  • at the beginning, removing the "h" from the "https" schema
  • in the URI part where it omits the first character of the specific rule which got violated
Edited by PirMei