How to set up Slack notifications with Code Studio

  • Last updated
  • 2 minute read

Goal

Configuring Slack notifications with Acquia Code Studio

Prerequisites

  • Access to Code Studio Maintainer role (More on Gitlab Roles)
  • Slack administrative access to create incoming webhooks

Overview

Image
Acquia Code Studio Logo

Today’s DEVops workflow can consist of a number of different tools from code review to visual regression testing. Having an internal communication strategy has become an important part of the process, especially when it comes to notification. Knowing who to inform for what tasks can be a challenge. Acquia Code Studio has notification tools for integrating everything from Jira, Drone, Datadog to Slack, sending notifications and syncing your data to help bridge the gap between some of these tools.

Image
Slack Logo

As Slack has become a major player in the team communication space it is positioning itself to be a tool for teams to build their communication strategy around it. Code Studio has a simple integration into Slack that allows your team to customize the push notifications for sending information about the actions in the table below. Each action can be pushed to a separate slack channel or notify individual people. You also can control the branches for which notifications are to be sent and the labels or behaviors to be notified.

 

Triggers for Slack notifications

The following triggers are available for Slack notifications:

Trigger name

Trigger event

Push

A push to the repository.

Issue

An issue is created, updated, or closed.

Confidential issue

A confidential issue is created, updated, or closed.

Merge request

A merge request is created, updated, or merged.

Note

A comment is added.

Confidential note

A confidential note is added.

Tag push

A new tag is pushed to the repository.

Pipeline

A pipeline status changed.

Wiki page

A wiki page is created or updated.

Deployment

A deployment starts or finishes.

Alert

A new, unique alert is recorded.

Vulnerability

A new, unique vulnerability is recorded.

Below we will show you how to enable some simple notifications from Code Studio to Slack in 3 easy steps.

  1. Add Slack notifications integration

  2. Configure Slack Webhooks

  3. Complete Code Studio Notification Settings

  4. Test your new notifications

  1. Add Slack notifications integration

    1. On the top bar, select Menu > Projects and find your project.

    2. On the left sidebar, select

       Settings > Integrations

      .

    3. There are a number of integrations you can add, but let's focus on Slack notifications to send notifications about project events to Slack.

    Image

     

  2. Configure Slack Webhooks

    1. Next, open a new browser tab and sign in to your Slack team and start a new Incoming WebHooks configuration.

    2. Identify the Slack channel where notifications should be sent to by default. Select Add Incoming WebHooks integration to add the configuration.

    3. Copy the Webhook URL to use later when you configure GitLab.

    Image
    Webhooks Logo

    * Please note, this is a legacy custom integration - an outdated way for teams to integrate with Slack but find this to be the easiest way to connect Code Studio to Slack at this time. We recommend checking out their replacement: Slack apps and come back later for an update to this article.

  3. Complete Code Studio Notification Settings.

    1. On the left sidebar, go back to Settings > Integrations.

    2. Select Slack notifications.

    3. In the Enable integration section, select the Active checkbox.

    4. In the Trigger section, select the checkboxes for each type of GitLab event to send to Slack as a notification. For a full list, see Triggers for Slack notifications. By default, messages are sent to the channel you configured during Slack configuration.

     

    Optional. To send messages to a different channel, multiple channels, or as a direct message:

    • To send messages to channels, enter the Slack channel names, separated by commas.
    • To send direct messages, use the Member ID found in the user's Slack profile.
    • NOTE: Usernames and private channels are not supported.

     

    1. In Webhook, enter the webhook URL you copied in the Slack configuration step.

    2. Optional. In Username, enter the username of the Slack bot that sends the notifications.

    3. Select the Notify only broken pipelines checkbox to notify only on failures.

    4. In the Branches for which notifications are to be sent dropdown, select which types of branches to send notifications for.

    5. Leave the Labels to be notified field blank to get all notifications, or add labels that the issue or merge request must have to trigger a notification.

    6. Select Test settings to verify your information, and then select Save changes.

  4. Review new Slack Notification

    After completing the prior step, you should start to see new notifications in Slack. All you have to do now is test.

    Below is an example of an incoming Webhook creating a notification in slack when a new branch is merged has failed. 

    Image