Skip to content

POC: Extend Environment stop actions to include all finished deployments

Pam Artiaga requested to merge auto_stop_in-change-poc into master

Problem

The Environment auto_stop_in feature makes use of an AutoStopWorker, which runs an Environment's stop jobs. The stop jobs of an Environment is extracted from the last successful pipeline. This becomes a problem when the pipelines are failing because it will either pick up the stop jobs of an old successful pipeline, or there will be no jobs picked up at all if there are no successful pipelines.

Please see the Problem Discussion Thread for further details.

Solution

We have a few possible ways to resolve this problem, but ultimately we settled on changing the scope of an Environment's "stop actions" so that it picks up the jobs from the last finished pipeline -- where finished means successful, cancelled, or failed. This change will affect 1) how auto_stop_in works, and 2) the Environment's stop actions as displayed on the UI.

Please see the Solutions Proposal Thread for more details. See this and this for comments indicating the solutions we settled on.

This MR is a Proof of Concept of the solution described above.

Related links

Epic: Allow users to cleanup partial resources from f... (&10324)

Investigation Issue: Investigate solutions for `auto_stop_in` not en... (#429616 - closed)

Edited by Pam Artiaga

Merge request reports