Integrating your Gitlab application with DeepSource requires a Gitlab application. This document outlines the configuration, permission requirements and app configuration to get started with your GitLab account and DeepSource Enterprise.

Creating a GitLab application

  1. On the top right corner, click on your profile picture. From the drop-down menu, select "Preferences".
  2. Select "Applications" from the sidebar which appears on the left.
  3. You'd be prompted to fill a form to create a new application. Enter the following details:

๐Ÿ“˜

Replace ORGANIZATION_NAME with the name of your organization, and HOSTNAME with the actual hostname on which you plan to deploy DeepSource to.

FieldValueExample
NameDeepSource ORGANIZATION_NAMEDeepSource Stark International
Redirect URIhttps://`HOSTNAME`/accounts/gitlab/login/callback/bifrost/https://deepsource.stark.com/accounts/gitlab/login/callback/bifrost/
Confidentialtrue
ScopeCheck true for api, read_user and read_repository
  1. Click on "Save Application".
  2. You will get APPLICATION_ID and SECRET. Enter these values in the DeepSource Enterprise admin console.

Configure webhooks for the GitLab application

Gitlab Self-hosted

  1. Navigate to the Admin section and go to System Hooks.
  2. Create a new system hook with the following information:
    1. URL: https://<deepsource-installation-url>/services/webhooks/gitlab/
    2. Secret token: Set this to the same value as set in the configuration (in the values.yaml file or the Admin Console config panel).
    3. Select "push events" and "merge request events" as triggers.
    4. Set "SSL Verification" to true.

Gitlab Cloud

  1. Navigate to the project or group that you want to create webhooks on. (Gitlab does not allow an org-wide option to enable webhooks).
  2. Go to Settings > Webhooks > Add new webhook, and enter the following:
    1. URL: https://<deepsource-installation-url>/services/webhooks/gitlab/
    2. Secret token: Set this to the same value as set in the configuration (in the values.yaml file or the Admin Console config panel).
    3. Select "push events" and "merge request events" as triggers.
    4. Enable SSL verification.

Configuring the GitLab application in the Admin Console

After you create your GitLab application, you need to configure these in the Admin Console for the application to use it.

  1. Visit the Admin Console
  2. Navigate to Application -> Config.
  3. Select the checkbox for GitLab.
  4. Fill up the values from the previous step for:
    1. GitLab Application ID
    2. GitLab Application Name
    3. GitLab Application Secret
    4. GitLab Host Domain
    5. GitLab Webhook Secret
  5. Click Save config

๐Ÿ“˜

You can ignore the Custom Redirect URI Hostname field if you are using the same domain for all traffic.


Whatโ€™s Next

Connect Google Source Repositories