Skip to content

Add external environments and deployments to GitLab

Problem to Solve

When someone is using environments & deployments feature in GitLab, it is possible to see in a merge request widget when a merge request was deployed to production. But, when you are not using GitLab to deploy, then it is not possible to see this in a merge request widget because there is no way for an external deployment tool to provide the information.

Use Case

It'd give us the ability to link a particular GitLab commit or merge request to any Heroku app it was deployed to. In their particular case, they'd need to be able to tell GitLab:

  1. The sha in question
  2. The name of the app that was deployed to
  3. The depoyed web url
  4. The status of the deploy ("pending", "successful", "errored")

..and have that show up and linked when viewing a commit or merge request.

This is being requested specifically for Heroku, but you could imagine any deployment engine providing this information.

Proposal

We will make it possible to use environments & deployments feature even when someone is not using GitLab to deploy their software. In order to ship this feature we can generalize the action that created a deployment. We can either create a simplified entity that describes a deployment action or just allow creating deployments without specifying the action that triggered it. The deployment itself stores following data: internal id, environment that deployment has been created for, Git branch / SHA, when a deployment has been created and by whom.

The most simple change is removing the need of having CI/CD job associated with a deployment.

/cc @ayufan @bikebilly @andrewn @jameslopez @stanhu

Edited by Jason Yavorsky