Add force stop option for environments in the UI

What does this MR do and why?

Add force stop option for environments in the UI

Until now, the only way to stop an environment without running its on_stop job was through the REST API with force=true. Environments whose on_stop job can no longer run, for example because the source branch was deleted before an auto_stop_in timer fired, were left stuck in the stopping state with no way out from the UI. Users had to file support tickets or reach for the API to recover.

Exposing force stop in the UI lets users resolve these stuck environments themselves, and lets them stop many environments at once without spending compute minutes running on_stop jobs they don't need. The Rails stop endpoint now accepts a force parameter and permits a forced stop while an environment is in the stopping state, reusing the existing stop_environment permission so no new authorization logic is needed.

Resolves #432937

Changelog: added

References

Screenshots or screen recordings

Video Demo:

Before After
header-stopping-before.png header-stopping-after.png
modal-on-stop-after.png modal-on-stop-after-checked.png
modal-on-stop-before.png modal-stopping-after.png
row-stopping-before.png row-stopping-after.png

How to set up and validate locally

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 #432937

Edited by Hannes Lange

Merge request reports

Loading
Loading