Skip to main content

Manual setup of CI jobs and Pipeline webhooks in GitLab

Learn how to create webhooks for Gearset in Gitlab

Written by Evan Craven

You can confirm the setup of these webhooks via Settings → Webhooks in your GitLab project, as described in GitLab's webhook documentation.

How many webhooks do I need?

Unlike Azure DevOps, which requires a separate service hook for each event type, a single GitLab webhook can subscribe to multiple events. As mentioned here, Gearset needs one webhook to run all CI jobs, and one webhook for the Pipeline.

So for a single pipeline with X number of CI jobs, you should end up with 2 webhooks in total in your repository. Both are configured in exactly the same way, the only difference is the payload URL:

Webhook

Payload URL ends in

Pipeline

/pipeline (includes your Gearset Pipeline ID)

All CI jobs

/continuous-integration-job

Use the URL and secret provided by Gearset, the Pipeline webhook details are shown on your Gearset Pipeline, and the CI job webhook details are shown in the CI job's webhook setup modal.

To access the modal for Pipeline webhook setup, click here:

To access the modal for CI job webhook setup, click here:


Once clicked, expand the section to manually set up your webhook. The necessary Payload URL and Shared Secret section will then be visible.

Setting up each webhook

  • To set up the webhook, you need to have the Maintainer or Owner role for the project.

  • In GitLab, go to your project and select Settings → Webhooks.

  • Click Add new webhook.

  • Set the URL field to the payload URL provided by Gearset.

  • Set the Secret token field to the secret provided by Gearset.

  • Under Trigger, tick Push events (leave the branch filter set to All branches) and Merge request events.

  • Leave Enable SSL verification ticked.

  • Click Add webhook.

Repeat these steps for the second webhook, using its payload URL and secret.

After completing the above, you should see 2 webhook rows in Settings → Webhooks, each listing both Push events and Merge request events as its triggers, one pointing to the /pipeline URL and one pointing to the /continuous-integration-job URL.

Testing your webhooks

GitLab lets you verify a webhook is working without waiting for a real commit:

  • In Settings → Webhooks, find the webhook and select Test → Push events (or Merge request events).

  • To review deliveries, select Edit on the webhook and check Recent events, where you can inspect the request, the response code, and resend individual events.

A 200 response indicates Gearset received the event successfully.

Did this answer your question?