Use GitLab's deployment and environment features for tracking deployments to GitLab.com
GitLab's deployment and environments feature allows you to track when merge requests get deployed to a certain environment. Using this feature we would be able to record deployments, without having to do so using JSON files managed using the GitLab API.
Sadly, the current implementations of the deployments and environments features are not adequate for our own use. For example, deployments are only recorded when triggered from the default branch. The associations between merge requests and deployments are also not persisted. Instead, merge requests simply show the latest deployment of the target branch. Not only does this mean the data is simply incorrect, it also means we won't be able to keep a record of what environments a merge request made it into.
Before we can start using these features, we would have to make (at least) the following changes:
- Whenever a merge request is deployed, we persist what deploy it was deployed in.
- Users should be able to deploy from any branch. We will need this since our auto deployer uses separate branches. Other users may also need this, for example when deploying a
develop
branch to staging. - When a deploy is created, we need to store the commits that were deployed (in addition to the merge requests). This allows one to figure out which deployment first deployed a commit to a certain environment. This is also helpful for users that rely less on merge requests, or don't use them at all.
- When viewing a deployment, we should be able to see the merge requests and commits that were deployed (probably with both being on separate tabs as to not clutter the UI).
With these changes made, we can start triggering deployments from our auto deploy branches. We can then start using this to generate QA issues, if they are still desired.
Some related issues: