GitLab integration
Creating the GitLab Application
- Go to Admin Area -> Applications -> Applications -> New application Fill out the details as follows
- Replace
localhost:8080
with your DVC Studio domain and port if applicable. - Click Save application
- Copy the Application ID and Secret
Creating the webhook
The webhooks are created automatically per repository. To check if the webhook got created:
- Go to repository Settings -> Webhooks
- Scroll down to see Project Hooks
- Check if there is a hook pointing to your DVC Studio instance:
Configuring DVC Studio with the GitLab App
Merge the values.yaml
file with the following contents:
global:
scmProviders:
# Optional
# This is useful in cases where DVC Studio is on an internal
# network, but the webhook endpoint is on an external network.
# Default: `global.host` value.
#webhookHost: ""
gitlab:
enabled: true
# Set this if you're hosting GitLab on a
# custom domain
url: <GitLab URL>
clientId: <GitLab OAuth App Client ID>
secretKey: <GitLab OAuth App Secret Key>
webhookSecret: <GitLab Webhook Secret>
Replace the strings marked with < >
Troubleshooting
GitLab Webhook didn’t get created
If there is no webhook in the repository, it is likely due to the GitLab instance settings.
By default, GitLab blocks webhook requests to local networks. To fix this, you need to whitelist your domain in GitLab:
- Open Admin Area in GitLab
- Go to Settings -> Network
- Expand the Outbound requests panel
-
Select the checkbox: Allow requests to the local network from system hooks
-
In the textbox, Local IP addresses and domain names that hooks and services may access, either write:
- your studio domain, e.g. studio.example.com
- IP network range, e.g. 10.0.0.0/16
So if DVC Studio is configured with https://studio.example.com, write:
studio.example.com
More examples of using the allowlist can be found in GitLab’s documentation: Create an allowlist for local requests