CI Lint tool should break lines instead of joining them with a literal "\n" in job scripts
Problem to solve
When the CI Lint tool is used in GitLab CE to validate a .gitlab-ci.yml
file and the validation is succesfull, the resulting job descriptions (before_script
, script
, and after_script
) concatenate all lines with a literal \n
, instead graphically breaking lines. This makes the CI Lint tool less usable, since jobs with long scripts become harder to read, both because lines are joined together and because the resulting table overflows horizontal page space in the user's browser.
Intended users
GitLab CE users (Sasha and Devon, I guess).
Further details
A sample .gitlab-ci.yml
file that demonstrates this behavior is:
job:
script:
- Command1
- Command2
- command3
If the contents above are pasted into the CI Lint tool and the validate button is pressed, the output looks like (before_script
and after_script
lines omitted):
Parameter | Value |
---|---|
Test Job - job | Command1\nCommand2\nCommand3 |
Tag list: | |
Only policy: refs, branches, tags | |
Except policy: | |
Environment: | |
When: on_success |
For better readability and usefulness (consider, for instance a developer who is copying the parsed job instructions and pasting them into a local debugging script or Docker image), the output should look like (before_script
and after_script
lines omitted):
Parameter | Value |
---|---|
Command1 |
|
Test Job - job | Command2 |
Command3 |
|
Tag list: | |
Only policy: refs, branches, tags | |
Except policy: | |
Environment: | |
When: on_success |
Note: I don't know how to properly fill in the following template sections, so I'm leaving them empty. I'll be happy to improve the description if anyone presents good suggestions.