Expiration times for environments

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:expire_in. And, just like artifacts can be "promoted" as non-expiring in the UI, so should be environments.

image

Alternative proposal

job:when:delay: 2 weeks could be a general-purpose feature to achieve almost the same.

In that case, a way to unschedule execution should be provided. After a job has been unscheduled, it behaves like a job:when:manual.

Example:

image

Links / references

cc @markpundsack @bikebilly

Edited by Jason Yavorsky