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

  1. Set up a Pipeline with a deploy_environment and stop_environment jobs 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
  1. Create a Merge Request based off the above branch, an MR pipeline should run.
  2. Wait for the deploy_environment job to complete successfully, creating the production environment.
  3. Click the stop_environment job 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

Merge request reports

Loading