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

  1. Create a new project
  2. Setup the CI by editing CI/CD -> Pipelines -> Editor with 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."
  3. Save the configuration
  4. Go to CI/CD -> Pipelines, click the Cancel button for the started pipeline
  5. Once the pipeline stops, click through and open up the build logs for build
  6. Verify that the after_script shows up in the logs.
Edited by James Heimbuck