@@ -7,9 +7,11 @@ title: "Connecting EMBL GitLab and Slack"
omit_header_text:true
---
This quick tutorial shows you how to connect [EMBL GitLab][embl-gitlab] with a Slack workspace. This can be very useful when you want to stay informed about activities in your repository without having to check your emails all the time - in fact, you may decide to disable email notifications for the repository because Slack notifications are quicker to see, manage and act upon!
This quick tutorial shows you how to connect [EMBL GitLab][embl-gitlab] with a Slack workspace.
This can be very useful when you want to stay informed about activities in your repository without having to check your emails all the time - in fact, you may decide to disable email notifications for the repository because Slack notifications are quicker to see, manage and act upon!
This tutorial also shows you the power of so-called [webhooks][gitlab-webhook]! Webhooks are a very powerful technique to connect different services with one another via automated notifications. If you haven't heard about this concept, you can find nice introductions with illustrations [here](https://snipcart.com/blog/what-are-webhooks-explained-example) or [here](https://www.getvero.com/resources/webhooks/).
This tutorial also shows you the power of so-called [webhooks][gitlab-webhook]! Webhooks are a very powerful technique to connect different services with one another via automated notifications.
If you haven't heard about this concept, you can find nice introductions with illustrations [here](https://snipcart.com/blog/what-are-webhooks-explained-example) or [here](https://www.getvero.com/resources/webhooks/).
So let's start to connect EMBL Gitlab and Slack!
...
...
@@ -17,7 +19,9 @@ So let's start to connect EMBL Gitlab and Slack!
We start with Slack!
First, decide in which channel the automated notifications should appear in. Either use an existing channel (public or private) or, as in my case, create a new repository-specific channel that exists only for the purpose of receiving automated notifications. For the following example, we call the channel `gitlab_integration`.
First, decide in which channel the automated notifications should appear in.
Either use an existing channel (public or private) or, as in my case, create a new repository-specific channel that exists only for the purpose of receiving automated notifications.
For the following example, we call the channel `gitlab_integration`.
You then need to install a Slack App called [**Incoming WebHooks**][incoming-webhooks] in your workspace. Click **Add to Slack**
...
...
@@ -28,7 +32,9 @@ and specify the Slack channel that shall be used for the integration (`gitlab_in
Finally, hit the **Add Incoming WebHooks Integration** button and you are set. If all goes well, you should now see a **Webhook URL** field. Make sure to copy this address, which you will need in the next step.
Finally, hit the **Add Incoming WebHooks Integration** button and you are set.
If all goes well, you should now see a **Webhook URL** field.
Make sure to copy this address, which you will need in the next step.
Go to the landing page of the Gitlab repository you want to add the integration to, navigate to **Settings > Integrations > Slack notifications**.
Now, select all triggers you want to receive automated notifications for and enter the exact name of the Slack channel this should be sent to (here: `gitlab_integration`). Lastly, paste the webhook URL from Slack in the **Webhook** field and select for an arbitrary name that should be displayed in Slack for incoming messages. I choose **automated_notifications** to make it clear this was a message that was automatically generated.
Now, select all triggers you want to receive automated notifications for and enter the exact name of the Slack channel this should be sent to (here: `gitlab_integration`).
Lastly, paste the webhook URL from Slack in the **Webhook** field and select for an arbitrary name that should be displayed in Slack for incoming messages.
I choose **automated_notifications** to make it clear this was a message that was automatically generated.
@@ -47,7 +55,8 @@ Hit the **Test settings and save changes** button and you should be good to go!
## Test whether it works
After hitting the **Test settings and save changes** button, you should already have a new notification in your corresponding Slack channel. If not, revise all settings. Now, if you create a new issue, for example, you should receive a new notification instantly.
After hitting the **Test settings and save changes** button, you should already have a new notification in your corresponding Slack channel.
If not, revise all settings. Now, if you create a new issue, for example, you should receive a new notification instantly.
@@ -73,12 +82,13 @@ On Gitlab visit **Settings > Integrations > Slack notifications** once again and
## Be productive
Hopefully, this helps you to stay (even more) productive. Webhooks can be used in many other cases that support it. You may want to disable email notifications now for the repository.
Hopefully, this helps you to stay (even more) productive.
Webhooks can be used in many other cases that support it.
You may want to disable email notifications now for the repository.