Ensure after_script is called for timed out pipelines
Status Update 2023-01-04
We have broken out the use cases of job/pipeline cancelation from this issue into a new epic (&10158 (closed)). We believe we can move forward with that use case sooner than the timeout case which is still represented here.
Release notes
Problem to Solve
It's possible to want a after_script
step for a gitlab-ci.yml, where it's important that it always run. However, the current behavior of after_script
is that if a build times out the cleanup stage is skipped (even though this does not appear to be the original intent: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/102#note_11619214).
Intended users
Proposal
Pending for this use case. The old proposal was moved to Ensure after_script is called for canceled jobs... (#387230 - closed) which will be scheduled first.
Possible Workaround
Users may be able to make use of the Job Event webhook to shut down or cleanup external environments. It should be assumed that no data outside the webhook payload will be available unless explicitly stored in global variables or some other method because the runner may have lost connectivity or otherwise may not be accessible to provide data required for the desired action to be taken.
Further details
Permissions and Security
Documentation
Availability & Testing
What does success look like, and how can we measure that?
What is the type of buyer?
Is this a cross-stage feature?
Links / references
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.