Job logs show empty sections
Overview
A job might not use all the sections, for example this specific job so GitLab Runner creates a section for the cache but has no output like the following:
[0Ksection_start:1561016085:restore_cache
[0Ksection_end:1561016086:restore_cache
[0Ksection_start:1561016086:download_artifacts
[0Ksection_end:1561016088:download_artifacts
This leads to show a collapsible button for an empty section like below:
GitLab Runner will create a section, and execute the script and then close the section again and since there is no output of that section it will show up empty to the user.
Possible Fixes
- Make GitLab Runner send any empty section. This might not be ideal because the runner doesn't know if there is going to be any output or not before creating the section, and it is also can be considered weird behavior is some sections are missing, it might lead to user think that the section was never executed.
- Rails should check if there are any bytes between sections if so convert it.
- It seems that there's some potential optimisation there: do not execute sections that does not make sense. We seem to execute all of them, even if they are empty.
Edited by Steve Xuereb