Step 5 of 15

Connect GitLab to Pullwise

Connect gitlab.com or self-managed GitLab to Pullwise with an access token and a merge request webhook, step by step with screenshots.

6 min For adminsUpdated

Works with gitlab.com and self-managed GitLab. You’ll create a token in GitLab, save it in Pullwise, then add a webhook in GitLab.

1. Create an access token in GitLab

Pick the token type that fits how you’ll roll Pullwise out:

Token Covers Where to create it
Group access token (recommended) Every project in the group Group → Settings → Access tokens
Project access token One project Project → Settings → Access tokens
Personal access token on a bot user Everything the user can access User → Preferences → Access tokens

Set:

  • Role: Developer or higher. Choose Maintainer if you plan to use auto-approve, so the token can approve merge requests.
  • Scopes: api. Pullwise needs it to read merge request diffs and post comments.
  • Expiration date: as long as your policy allows. Set a reminder to rotate it before it expires.

Select Create and copy the token straight away. GitLab only shows it once. GitLab tokens start with glpat-.

2. Save it in Pullwise

  1. Open SCM and select Connect on the GitLab card.
  2. Paste the Access token (1).
  3. Paste your Webhook secret (2).
  4. Self-managed GitLab only: set API base (3) to your instance’s API, for example https://gitlab.example.com/api/v4. Leave it blank for gitlab.com.
  5. Select Save.
  6. Switch GitLab on with the switch at the right of the card.
Connect GitLab dialog with the token and webhook secret entered
Access token (1), webhook secret (2), and API base (3) for self-managed only. Tap the image to enlarge it.
GitLab card showing Connected with its repositories listed
GitLab is Connected (1). Select Repositories (2) to see the projects the token can reach (3). Tap the image to enlarge it.

3. Add the webhook in GitLab

Your webhook URL includes your workspace subdomain. Type it below to fill in the URL:

Webhook URLhttps://your-subdomain.pullwise.ai/v1/webhooks/gitlab

In GitLab, open the project (or group) and go to Settings → Webhooks → Add new webhook:

Add new webhook
URL
https://acme.pullwise.ai/v1/webhooks/gitlab
Secret token
••••••••••••••••••••••••
TriggerPush eventsMerge request eventsComments
Enable SSL verification
Save
Illustration of the webhook form in GitLab, filled in. Labels match GitLab; the layout is simplified.
  1. URL (1): your webhook URL from above.
  2. Secret token (2): your webhook secret.
  3. Trigger (3): tick Merge request events only. Untick Push events.
  4. Leave Enable SSL verification on.
  5. Select Add webhook.

4. Test it

On the webhook’s row in GitLab, select Test → Merge request events.

What triggers a review

A merge request being opened, reopened, or updated with new commits. Comments, labels, approvals and pipeline events are ignored.

If something goes wrong

Open the webhook in GitLab (Edit → Recent events) to see each delivery and Pullwise’s response.

Response Cause Fix
401 The secret token doesn’t match Re-enter the same secret in GitLab and in Pullwise (SCM → Edit).
404 Wrong workspace subdomain in the URL Check the URL against your workspace address.
201 with ignored Not a merge request event, or GitLab is switched off in Pullwise Tick Merge request events and check the card says Connected.
Delivery fails or times out Self-managed GitLab can’t reach the internet Allow outbound HTTPS from GitLab to *.pullwise.ai.
Couldn’t list repositories under the card Token expired, revoked or missing the api scope Create a new token and save it with Edit.

More fixes in troubleshooting.

Next

Choose which repositories are reviewed. Also using GitHub or Bitbucket? Connect GitHub or Bitbucket first.

Stuck? Ask the assistant, check troubleshooting or contact support.

Choose which cookies we may use. You can change this at any time from the footer.

Cookie categories