Fix "Stop" button for deployment jobs fails in Merge Request widget UI
What does this MR do and why?
This MR adds stop action to a list of supported actions in the job_action_button. It can use the same mutation and error message as a play job, as it basically plays the job named "stop".
References
Screenshots or screen recordings
| Before | After |
|---|---|
| Screen_Recording_2025-06-12_at_15.34.36 | Screen_Recording_2025-06-12_at_15.34.57 |
How to set up and validate locally
- Set up a Pipeline with a
deploy_environmentandstop_environmentjobs as follows:
Click to expand
stages:
- deploy
- stop
deploy_environment:
stage: deploy
environment:
name: production
on_stop: stop_environment
script:
- exit 0
rules:
- if: $CI_MERGE_REQUEST_ID
stop_environment:
stage: stop
environment:
name: production
action: stop
script:
- exit 0
when: manual
rules:
- if: $CI_MERGE_REQUEST_ID
- Create a Merge Request based off the above branch, an MR pipeline should run.
- Wait for the
deploy_environmentjob to complete successfully, creating theproductionenvironment. - Click the
stop_environmentjob button from the MR widget; verify the job runs and the environment is stopped.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #505591 (closed)
Edited by Anna Vovchenko