Skip to content

Automatically delete stale environments after 7 days instead of 3

What does this MR do and why?

This will avoid a race condition where an environment is created at the beginning of a Review app child pipeline, then deleted by a maintenance scheduled pipeline that runs before the Review app is actually deployed to the environment.

By cleaning up environments only 7 days after the last deployment occurred, we should avoid most of these race conditions (as it's less likely that a Review app wouldn't be re-deployed during the 7 days timeframe). See #435516 (comment 1702569629) for more details.

Testing the automated cleanup at https://gitlab.com/gitlab-org/gitlab/-/jobs/5795018939.

Edited by Rémy Coutable

Merge request reports