CI job and pipeline webhooks

Gearset's one to many webhook system.

Quinn Kuiper avatar
Written by Quinn Kuiper
Updated over a week ago

Webhook pooling

Gearset uses a "webhook pooling" mechanism. For this, the general rule is that for each repo, Gearset needs one webhook to run all CI jobs.

Once a valid webhook event has occurred, Gearset will figure out what CI job to run by:

  • Looking at which CI jobs are “attached” to that URL (For example, 3 jobs).

  • Looking at what type of event it is (push), and which branch is affected (e.g. testQA).

  • Check for CI jobs with the matching source repo and source branch.

When creating a new CI job you will notice that the Payload URL and the shared secret are the same, this is expected behavior.

How many Gearset webhooks should I have in my repo?

As mentioned above, Gearset needs one webhook to run all CI jobs. If you have a pipeline then another webhook will be needed as well.

Bringing the total number of needed webhooks to 2.

Notes:

  • Azure DevOps uses service hooks instead of webhooks and therefore uses 3 service hooks for the CI jobs and 3 for the pipeline.

  • AWS Code Commit users:

    • For all CI jobs you will need:

      • 1 SNS Topic and Subscription

      • 1 Trigger

    • For the Pipeline you will need:

      • 1 SNS Topic and Subscription

      • 1 Eventbridge Rule

      • 1 Trigger

Webhook errors

Pipelines is reliant on Webhooks to run as expected. Therefore, if users are wanting to view any errors they are able to click the view webhook errors button and use that to help with the troubleshooting.

Further information on checking your webhooks may be found here

Why do I have many different webhooks in my repo?

Since this is a newer feature, older CI jobs are still running off the 1 to 1 matching webhooks. These will continue to work as expected.

Setting up your webhooks

We recommend letting Gearset set up your webhooks automatically when creating a Pipeline or a CI Job.

For a new Pipeline, this modal will appear during the creation:

We recommend selecting the Add webhook button to automatically create your Pipeline webhook.

If this is not able to be created automatically, select the Manually set up a webhook option, which will then display the required steps to set the webhook up in your chosen git provider as each one is different.

When setting up a CI Job, Gearset will automatically set up the webhook for you where possible. You should see a pop up similar too the below if this is successful:

If this is not successful, select the Webhook setup... option from your CI Job here:

The modal will then guide you through how to setup the webhook in the git provider selected for that CI Job.

Did this answer your question?