Multiple on_stop action for an environment
What does this MR do and why?
Introduces multiple on_stop action jobs for the same environment. It runs the on_stop action jobs that are defined in parallel (default system behaviour).
Related Customer request issue - #22456 (closed)
The implementation follows the same suggestion below which as discussed in #22456 (comment 835059613)
- When an environment is stopped, find the latest deployment record of the environment.
- Find the associted pipeline of the deployment record.
- Group deployment records in the same pipeline/commit by each target environment. e.g. deployment-A and deployment-B are targetting the
developmentenvironment.- Select only successfully-executed deployments. e.g. If a deployment job is still not executed yet, then don't run the corresponding
on_stopjob.- Trigger
on_stopjobs of the deployments.
Screenshots or screen recordings
-
When there is a single
on_stopaction it invokes the corresponding job and redirects to the job url. single_on_stop_action_for_environment -
When there are multiple
on_stopactions it invokes the corresponding jobs and redirects to the environment url. multiple_on_stop_action_for_enviornment
How to set up and validate locally
Can use the above .gitlab-ci.yml and test the scenarios as shown in the screen recordings.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #22456 (closed)