Set Auto-Stop Environment Expiry Period when an environment is created
Today, you can set expiry period to environments with
environment:auto_stop_in keyword https://docs.gitlab.com/ee/ci/environments.html#environments-auto-stop.
This feature is useful to clean up environments regardless of it's state, which isn't covered by branch-deletion hook, however, it sets an expiry period only when a deployment job finishes. This is an inconvenient for a usecase like #199020 because it can't clean up empty environments.
We should set the expiry period when an environment is created. This way, this feature becomes really useful to cleanup stale environments in automation.
We will use the existing
auto_stop_in: keyboard on environment creation and not necessarily on deployment. If a deployment is done, the auto_stop timer will be reset to the deployment time instead of creation time.
review: environment: name: test auto_stop_in: 30 days on_stop: stop-review