When user clicks at Cancel button for pipeline/build, ensure `after_script` is executed
Why are we doing this work
This is the PE part of the work to get after_script working when user clicks at Cancel button for a pipeline/build.
Relevant links
Related to Ensure after_script is called for canceled jobs... (#387230 - closed) which will be the first step introducing a new keyword to support the use case.
Implementation plan
There is already a MR !39842 (closed) for this issue open. Once this runner issue is ready/done, this MR will need to be worked on (e.g. resolving conflicts and verifying working as expected) to get the Gitlab frontend and backend part ready.
Verification steps
- Create a new project
- Setup the CI by editing
CI/CD->Pipelines->Editorwith the following content:image: busybox:latest build: script: - echo "Do your build here" - sleep 30 after_script: - echo "After script for build is executed even if it's canceled." - Save the configuration
- Go to
CI/CD->Pipelines, click the Cancel button for the started pipeline - Once the pipeline stops, click through and open up the build logs for
build - Verify that the
after_scriptshows up in the logs.
Edited by James Heimbuck