Skip to content

Auto stop environments after a certain period

Problem

Review apps are short lived by definition. Unfortunately, stale branches are ubiquitous (gitlab-ce has ~1,600). Keeping all as review apps would is a burden.

Proposal

Just like artifacts can expire, environments should be able to be configured to stop after a certain time, as defined in job:environment:auto_stop_in. And, just like artifacts can be "promoted" as non-expiring in the UI, so should be environments.

The auto_stop_in: value for environment is renewed per deployment, this means if an environment is about to be stopped and got a new deployment, the auto_stop_in: is extended to the new value. Thus, active environments will never be expired and only inactive/stale environments will be stopped automatically.

Environments

  • Add a column for Auto stops in
  • If an environment will auto stop, show button to prevent it from auto-stopping
  • Realign No deployments with deployments column
  • Do not display Auto stop in or button if the environment is not set to auto stop Environments

Environments Details

  • If an environment will auto stop, Add Auto stops in xx weeks next to the title
  • If an environment will auto stop, show button to prevent it Environment_Details

Button tooltip

Tooltip

Links / references

PoC

!18115 (closed) is complete.

MRs to be merged into master

backend

frontend

  • Create MR for persisting and controlling auto-stop branched off BE MR. => !20372 (merged)

Feature Flag

This feature is built behind auto_stop_environments feature flag and disabled by default until we make sure it's deemed stable.

cc @markpundsack @bikebilly

Edited by Shinya Maeda