skirl

GitLab

A GitLab project's (or group's) pushes, tags, merge requests, issues, comments, pipelines and releases arrive as short messages, each linking to the thing itself. A pipeline that passes after failing replaces the failure on the same branch, so the topic shows each branch's latest result.

Setting it up#

In the app these steps are under Connect a system → GitLab, or a topic's Send to this topic tab, with the address, topic and a token filled in; New token makes the token.

A project (or group) webhook. A passed pipeline replaces the failed one on the same branch.

  1. Settings → Webhooks → Add new webhook:

    • URL: https://notify.example.com/gitlab?template=gitlab
  2. Custom headers → Add custom header:

    • Header name: Authorization
    • Header value: Bearer tk_replace_with_your_token
  3. Trigger:

    • Events: Push events, Tag push events, Comments, Work item events, Merge request events, Pipeline events, Releases events
  4. Add webhook, then Test → Push events.

The steps here show example values (https://notify.example.com, the topic gitlab, tk_replace_with_your_token): copy them from the app, where yours are filled in.

  • The events you tick in Skirl are in the URL (&events=…): after changing them, copy the address into GitLab again.
  • GitLab must be able to reach your server: gitlab.com cannot reach an address that only works at home.
  • Skirl's tests replay GitLab's own example deliveries against these steps; GitLab itself is too large to run in a test.

Events#

Event On at first What it means
Pushes Yes Commits pushed: who, how many, the branch, and the first five commits. A push with no commits is not sent.
Tags Yes A tag pushed, with its message. A deleted tag is not sent.
Merge request opened Yes A merge request opened or reopened: the branches and who opened it.
Merge request merged Yes A merge request merged.
Merge request closed Yes A merge request closed without merging.
Issue opened or reopened Yes Who opened it, and its description. Work items count as issues.
Issue closed Yes Who closed it.
Comments Yes A new comment on a merge request, an issue or a commit; edited comments are not sent.
Pipeline failed Yes A pipeline that failed, at priority 4.
Pipeline passed Yes A pipeline that passed, at priority 2. A pipeline's result replaces the last one on the same branch, passed or failed.
Release created Yes A release and its description.

Everything else is at priority 3. Anything else GitLab sends (a pipeline that starts or is running, an updated merge request) is answered normally and dropped.

What a message looks like#

A pipeline failing, from GitLab's own example delivery:

Pipeline failed on master · gitlab-org/gitlab-test
Pipeline #31, by root. test

Priority 4 · Tags: x, Gitlab Test

When the next pipeline on master passes, the same message becomes "Pipeline passed on master · gitlab-org/gitlab-test", at priority 2 with the tag white_check_mark.

A merge request merged:

MR !16 merged: Add input validation to booking form · flightjs/flight-management
feature/booking-validation → main, by agarcia

Priority 3 · Tags: twisted_rightwards_arrows, Flight Management

Tapping a message opens the project, the pipeline, the merge request, the issue, the comment or the release. The first tag shows as an emoji (❌, ✅, 🔀); the second is the project's name.

When nothing arrives#

  1. Press Test → Push events on the webhook in GitLab. It sends a push, and GitLab shows Skirl's answer.
  2. The answer is 401 or 403. The custom header must be named Authorization with the value Bearer followed by the token. 401: the token is wrong, rotated or revoked; 403: it is a token for another topic.
  3. The answer is 200 with "dropped":true. Skirl took it and dropped it on purpose: the event is not ticked in Skirl, or it is one Skirl does not send.
  4. A trigger is not ticked in GitLab. GitLab sends only the events ticked under Trigger.
  5. There is no answer at all: A sender gets no message through.

This page on GitHub