Add execution stage name in job trace
What does this MR do?
Adds a description for each of the execution stages
sections in the job trace.
Why was this MR needed?
First and main reason is to clearly show what stage
of the job script is being executed. It's very important especially in issues like #6697 (closed): The last line before ERROR: Job failed: execution took longer than 1h0m0s
is Pulling docker image gitlab/gitlab-runner-helper:x86_64-003fe500 ...
and by most people the image pull is blamed for the job hanging. This however is not true, because the timeout is reached earlier - at the script execution stage
, and the pull here is used to handle the upload_artifacts_on_failure
one and is not causing the timeout. This however is not seen clearly in the job trace. One could find this only by looking on the raw output, where the section marks (invisible normally) are added.
With the change here this should be clearly distinguished which also means that we should get a little less "misleading" reports in case of future problems.
The second reason is to make use of the sections folding, some time ago added to GitLab CI. The first printed line of each section is used as the "header" describing the folded part. Currently this is a little random (it depends on the used executor and the content of the script). With the change added here, the folded sections will describe the structure of the job - which is common to all cases.
Are there points in the code the reviewer needs to double check?
Does this MR meet the acceptance criteria?
-
Documentation created/updated -
Added tests for this feature/bug -
In case of conflicts with master
- branch was rebased
What are the relevant issue numbers?
closes #4816 (closed)