Add new keyword to support running after_script for canceled jobs

See Epic &10158 (closed) for full problem and solution description.

Step Issue
Backend, Step 1 #398774 (closed) <- You are here
Runner, Step 1 gitlab-runner#30827 (closed)
Backend, Step 2 #399215 (closed)
Frontend #399294 (closed)
Backend, Step 3 #399296 (closed)
Feature Flag Rollout #399302 (moved)

Proposal

Backend, Step 1

NOTE: Gitlab communicates with the runner through the Runner API - resource :jobs endpoint.

A new keyword should be added to minimize the impacts to existing users so that they can opt-in the fix. See the following example:

job:
  after_script:
    script:
      - echo "Execute this command after the `script` section completes."
    when: always

Runner will receive the new keyword when: always via the API

Implement this behind a feature flag which will be used for all related issues for the epic.

  • Update related issues with the name of the feature flag to be used.

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.

Edited by Caroline Simpson