Skip to main content
GitLab
Updated this week

Introduction

To enable the GitLab connector you need a group access token. If your GitLab instance is behind a firewall or has IP restrictions, you must allowlist DX IP addresses in order to accept inbound API requests. Note—DX does not read, access, or store source code from your repositories.

Steps to connect

Step 1

Create a GitLab group access token to be used for the DX Data Cloud connection.
Select Developer as the role and enable the read_api scope to grant API read access.

Step 2

Grant the Group access to projects that you want to import.

Step 3

Navigate to the Data Cloud > Connections screen within DX, then add a connection using your credentials generated in the previous steps. For most instances, the Gitlab API Base Url will be https://gitlab.com/. Do not append your organization name at the end of https://gitlab.com.

API Reference

Here is a list of the endpoints we reference while importing data from GitLab

Endpoint URL

Link to Endpoint Documentation

Permissions Needed

groups

Group access token with read_api scope

projects

Group access token with read_api scope

groups/#{group_id}/projects

Group access token with read_api scope

projects/#{project_id}/merge_requests

Group access token with read_api scope

groups/#{group_id}/members

Group access token with read_api scope

projects/#{project_id}/merge_requests/#{merge_request_id}/approval_state

Group access token with read_api scope

projects/#{project_source_id}/repository/commits

Group access token with read_api scope

projects/#{project_id}/merge_requests/#{merge_request_id}/notes

Group access token with read_api scope

Errors

This table lists error codes that you may encounter when adding a connection in DX.

Error

Description

invalid_credentials

Your API credentials entered are not valid.

invalid_permissions

Your API token does not have the permissions required by DX.

no_resources

Your service account does not have access to any projects or repositories.

Did this answer your question?