Skip to content

GitLab Webhook Setup

Chuck edited this page Nov 13, 2026 · 2 revisions

GitLab Webhook Setup

Glint does nothing until GitLab sends it events. This page covers adding the webhook, choosing an authentication mode and checking that deliveries work.


Project webhook

  1. In the GitLab project, open Settings → Webhooks and click Add new webhook.

  2. Fill in:

    Field Value
    URL http(s)://<glint-host>:<port>/webhook
    Secret token or Signing token See Authentication
    Trigger ✅ Merge request events, ✅ Releases events
    SSL verification Leave enabled if Glint is served over HTTPS with a certificate GitLab trusts
  3. Leave every other trigger unchecked. Glint answers other events with 200 and ignores them, but each one is still a wasted request.

  4. Click Add webhook.

You need the Maintainer role on the project to manage webhooks.

Group webhook

On GitLab tiers that offer group webhooks, add the same webhook under the group's Settings → Webhooks to cover every project in the group. Glint uses the project ID from each payload, so one instance can serve any number of projects — as long as GITLAB_TOKEN can access them.


Authentication

Every request to /webhook must authenticate, or Glint answers 401 and does nothing.

Signing token (recommended, GitLab 19.0+)

  1. In the webhook form, generate a Signing token. GitLab shows a value starting with whsec_.
  2. Set WEBHOOK_SIGNING_TOKEN to that value and restart Glint.

GitLab then signs each delivery following the Standard Webhooks spec (webhook-id, webhook-timestamp and webhook-signature headers). Glint recomputes the HMAC-SHA256 signature over the exact bytes it received and rejects:

  • a missing or wrong signature;
  • a timestamp more than 5 minutes away from Glint's clock (replay protection) — keep the Glint host's clock synchronised with NTP.

Unlike the secret token, the signature also proves the payload wasn't modified in transit.

Secret token (any GitLab version)

  1. Generate a long random value, e.g. openssl rand -hex 32.
  2. Put it in the webhook's Secret token field and in WEBHOOK_SECRET.

GitLab sends it back unchanged in the X-Gitlab-Token header, and Glint compares it in constant time. It authenticates the sender but doesn't protect the payload, so serve Glint over HTTPS if the traffic crosses an untrusted network.

Both set

If both variables are set, Glint checks only the signing token. A webhook that sends only a secret token then gets 401. Use one mode per Glint instance and configure every webhook that points at it the same way.


Local network deliveries

By default GitLab refuses to send webhooks to private addresses (10.x, 192.168.x, localhost, …) and shows "Invalid url given" when you save the webhook. An administrator can allow it under Admin Area → Settings → Network → Outbound requests, either with Allow requests to the local network from webhooks and integrations or, more narrowly, by adding Glint's host to the allowlist on the same page.


Testing a delivery

  • Test → Merge request events on the webhook sends a sample payload. Expect a response of 202 if the sample MR's action is open/reopen, or 200 with Ignored: action '…' otherwise — both prove the URL and authentication work.
  • Edit → Recent events shows each delivery's request, response code and body. A 401 means an authentication mismatch; see Troubleshooting.
  • Glint logs each accepted event ([webhook] Processing MR !12 in project 34…) and each failure.

A 202 only means Glint accepted the event. The summary itself is produced in the background, so check Glint's log if no comment appears.


Which events trigger work

Event Action Glint does
Merge request open, reopen Posts an AI summary comment
Merge request update, merge, close, approved, … Nothing (200 Ignored)
Release create Rewrites the release description with AI notes
Release update, delete Nothing (200 Ignored)
Anything else — Nothing (200 Ignored)

New commits pushed to an open MR don't trigger a new summary. To get a fresh one, close and reopen the MR. Re-summarising on update is on the roadmap.

Clone this wiki locally