Allow dynamic merge request URLs that reuse environments currently belonging to other MR
As mentioned at #17066 (comment 264232774) developers including myself are planning to use 'Truly Dynamic Environment URLs' so that review apps run on a fixed set of known-up-front urls. I know other people have also mentioned use cases where they have limited physical hardware. (The background is that we have to pre-register the urls our system is running at with external systems, something we can't do on the fly.)
We will obviously have to deal with selecting which environment ourselves, probably using a "fifo" style approach, and the script will do the
echo CI_ENVIRONMENT_URL=https://review-app-1.mycompany.com/ >> deploy.env part.
However who deals with making sure the review app is disassociated from the old MR?
To describe in more detail, we have 9 available deployments urls, dev-1 through dev-9, and say they are associated with merge requests numbered 1-9, and all MR are still open and hence all review environments in use.
If the user opens MR 10, as all review apps are in use, we'll pick the oldest, dev-1 to use. Who tells MR 1 that it's review app has been deleted? Does gitlab do this automatically when it sees MR10 is deploying to MR 1's review app?
Also vaguely relates to #18982.