GitLab Commits (Default branch)
By integrating GitLab Commits connector with DX, you can import metadata on individual GitLab commits from the trunk branch of your repositories—this data is often useful for teams that do trunk-based development. Please refer to the API documentation below and our schema explorer to see what data DX imports.
Before proceeding, please make sure that you have first enabled the GitLab connector by following the steps here.
Prerequisites
To connect GitLab to DX, you need:
- a GitLab account that can create a Group Access Token or a Service Account
- allowlist DX IP addresses if your GitLab instance is behind a firewall or has IP restrictions
Setup instructions
Follow the steps below to connect GitLab to DX.
Data connection
Step 1
Either create a Group Access Token with the Developer role and read_api scope, or create a group service account, add it to the group with the Developer role, and create an access token with the read_api scope.
Step 2
Grant the Group access to projects that you want to import.
Step 3
- Navigate to the connections page in DX and select “+ Connection” in the top right.
- Enter the credentials you have generated in the previous steps—refer to the information below for errors and troubleshooting.
- For GitLab-hosted instances, the API base URL should be https://gitlab.com/.
API reference
The table below lists the specific API endpoints that are used by DX.
| Endpoint | Documentation |
|---|---|
| groups | Link |
| projects/{projectSourceId}/repository/commits | Link |
Errors
The table below lists potential error codes 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 API token does not have access to any projects or repositories. |
Data Cloud API
Once the initial connection is created successfully, credentials can be managed via the Data Cloud API. This connector uses the same credential fields as GitLab (secrets.api_token).