Skip to main content

How to set up GitLab

Updated this week

Setup takes about 10 minutes.

Introduction

Use the GitLab connector when you want Foundational to access source code in GitLab. The setup supports cloud deployments.


To make the connection, you need to:

  • Create or assign user credentials

  • Configure webhooks

  • Connect Foundational to GitLab


Prerequisites

Ensure you have:

  • Access to GitLab

  • Group or project Maintainer permissions to create webhooks

  • Permissions to create access tokens

  • Added Foundational IP addresses to the allowlist, see the article Allowing IP access to Foundational


Access permissions

Access to GitLab allows Foundational to determine data lineage and analyze pending and historical pull requests.

Foundational requires access so it can:

  • Read commits and pull requests

  • Track and analyze changes that affect data lineage

  • Comment in GitHub and perform CI (Continuous Integration) checks on pull requests


Create or assign user credentials

GitLab authentication uses an API access token. Select one option.

Option 1: Group access token (preferred)

Use a group access token to cover all projects in a group. See the GitLab article on group access tokens.

  1. To find your group, on the top bar select Search or go to and enter the name of the group.

  2. In GitLab, go to Settings > Access Tokens for the group.

  3. Click Add new token.

  4. Assign the following settings:

    • Role: Developer

    • Scope: api

  5. Give the token a descriptive name (for example foundational-app). This name appears as the author of Foundational merge request comments.

  6. Set the token to expire one year from now.

  7. Copy and save the token. You’ll need it to set up the connection.

Option 2: Project access token

Use this option if you cannot create a project access token. See the GitLab article on project access tokens.

  1. For each project you want to cover, go to Settings > Access Tokens.

  2. Click Add new token.

  3. Assign the following settings:

    • Role: Developer

    • Scope: api

  4. Copy and save the token. You’ll need it to set up the connection.


Configure network access

If GitLab access is restricted, add Foundational IP addresses to the allowlist, see Prerequisites.


Connect Foundational to GitLab

  1. In Foundational, open the Connectors & Integrations page.

  2. In Source Control, select the GitLab card and click Connect.

  3. Click Add Access Key.

  4. The initial setup screen opens. Click Start Setup.

  5. The Set Up New Connection screen opens.

  6. Enter the details:

    • API Access Token: The group or project access token you created earlier.

    • Webhook Secret Token: Auto-generated. Copy and save it. You’ll need to configure the webhooks.

  7. Click Next.

  8. The final setup screen opens. To complete the connection, click Save.


Configure webhooks

Webhooks notify Foundational about events such as new merge requests and new commits.

You can configure the webhook at the group level (preferred) or project level. To configure, see the GitLab article on webhooks.

Webhook settings

  1. Set the webhook URL to:

    <https://hooks.foundational.io/api/v1/gitlab_webhook>

  2. In the webhook Secret field, paste the Webhook Secret Token UUID from Foundational.

  3. Enable the following triggers:

    • Push events

    • Merge request events

    • Pipeline events

  4. Under SSL verification, ensure Enable SSL verification is selected.

That’s it. Foundational is now connected to GitLab.

Did this answer your question?