GitLab Cloud Integration

The GitLab integration allows Velocity to ingest GitLab's information for monitoring and insights.

Prerequisites

Before you start, our team will provide you with the URIs needed for the setup. To get them, reach out to us in your dedicated Slack channel or email us at support@velocity.tech

This document describes the Gitlab Cloud integration. If your team has Gitlab on-prem, please contact us through our dedicated Slack channel with your organization or email us at support@velocity.tech.

Overview

This setup includes steps for both you and the Velocity team. We’ve split the process into two parts, with an additional step handled by our team in between.

Step 1 - Configure the GitLab Application

Once you receive the URIs from the Velocity team, you'll have to configure the Velocity app within their GitLab instance using the Redirect URI provided.

  1. Create the Application:

    • Log in to your GitLab instance.

    • Navigate to Preferences by clicking on your avatar and choosing Preferences.

    • Click on Applications.

    • Click on New Application.

    • Fill in the necessary details:

      • Name: Provide a name for the application. Make sure to have a descriptive name, such as Velocity Integration.

      • Redirect URI: Use the Redirect URI sent to you by Velocity's team.

    • Enable the following scopes as required by the application:

      • api

      • read_repository

    • Save the application.

  2. Share needed information with Velocity:

    • After saving, GitLab will provide an Application ID and Secret.

    • Send Velocity's team these values via the communication channels mentioned above.

Step 2 - Velocity to Confirm Application Setup

Step 3 - Authorize the Application

Complete this part only after Velocity's team indicated that the application setup has been completed on Velocity's end.

Now that the application is configured, you should authorize the application.

Invoke the Authorize URI:

  • Open the email sent to you by Velocity's team (before Step 1).

  • Copy the Authorize URI and paste it into your browser to start the authorization process.

  • This URI will redirect to GitLab where you'll need to approve the application to access your account.

  • Click the "Authorize <App Name>" button:

Step 4 - Verify the installation

To verify the installation, go back to the applications screen in Gitlab:

  • Log in to GitLab.

  • Navigate to Preferences by clicking on your avatar and choosing Preferences.

  • Click on Applications.

  • Under Authorized Applications, you should see the new configured app:

Step 5 - Add a Webhook to Your GitLab Project or Group

Follow these steps:

  1. Navigate to the Webhooks Settings:

    • For a project: Go to your GitLab project, then click on Settings > Webhooks in the left sidebar.

    • For a group: Go to your GitLab group, then click on Settings > Webhooks.

  2. Add a New Webhook:

    • Click on the Add webhook button.

  3. Enter the Webhook URL:

    • In the URL field, enter the following URL:

      https://api.velocity.tech/api/v1/webhooks/gitlab/
  4. Name the Webhook:

    • Set the Name field, to Velocity Integration

  5. Add a Custom HTTP Header:

    • Scroll to the Custom HTTP headers section.

    • Click Add custom HTTP header button.

    • Set the header name to X-Velocity-Auth.

    • Set the header value to the installation_id you received from Velocity.

  6. Configure Triggers:

    • In the Trigger section,

      • In the Triggers section, check all the boxes to ensure the webhook responds to all relevant events.

  7. Save the Webhook:

    • Click Add webhook at the bottom of the page to save your settings.

  8. Verify the Webhook:

    • Use the Test button next to your newly added webhook.

    • Select a Push events test.

    • You should receive a 200 OK response, confirming the webhook is working correctly.

Following these steps will successfully add and verify the webhook, enabling your GitLab project or group to communicate seamlessly with Velocity through the configured URL and authentication.

Last updated