Skip to content

Mark Prepare environment stage as system failure

Steve Xuereb requested to merge prepare-env-sys-failure into master

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.

  1. Update your bash profile to exit with error echo "exit 1" > ~/.bash_logout
  2. Run gitlab-runner as the user that has the .bash_logut with the exit 1 command
  3. 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 error cd No such file or directory error on master
Before

Screen_Shot_2020-03-10_at_09.59.14

After

Screen_Shot_2020-03-10_at_09.58.10

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?

#1379 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports