Mark Prepare environment stage as system failure
What does this MR do?
Mark Prepare environment stage as system failure
Why was this MR needed?
The Prepare environment stage is used to echo on which hostname it the job running. If this fails we mark it as a BuildFailure which is not the case, it should be a system failure. If we fail to prepare the environment it's the Runner fault and not the users fault.
Since the failure is marked as system failure we no longer try to run the artifact upload on failure since the job didn't run and there is nothing to upload.
Having this marked as a system failure would make it more clear to the user that the problem is with the Runner environment, we add a link to the documentation to make it more simple for them to understand what might be going on.
Testing
The easiest way to test this is to use the shell executor.
- Update your bash profile to exit with error
echo "exit 1" > ~/.bash_logout
- Run
gitlab-runner
as the user that has the.bash_logut
with theexit 1
command - If you want to see the error in the master branch make sure you have an empty
/builds
directory so that you can see the errorcd No such file or directory
error on master
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