Skip to content

Send notifications to Slack

Luke Duncalfe requested to merge 373321-add-notifications-to-slack into master

What does this MR do and why?

This MR enables Integrations::GitlabSlackApplication#notify to send notifications of certain GitLab events to Slack.

There are 3 integrations that interact with Slack. Integrations::GitlabSlackApplication is the only one that works with the GitLab for Slack app.

The notifications that Integrations::GitlabSlackApplication can now send are identical to those sent by the Integrations::Slack model, but the way we notify is different. In a future step we will deprecate Integrations::Slack to consolidate the Slack notifications functionality into one integration that works with the GitLab for Slack app &8673.

There is a separate documentation MR !104639 (merged).

Screenshots or screen recordings

Setting up integration

demo-setup

Configuring to receive issue notifications in a public Slack channel

demo-public

Configuring to receive issue notifications both a public and private Slack channel

demo-private

How to set up and validate locally

To QA this feature you must have access to the Ecosystem Test Slack Workspace.

  1. Start a new GitPod instance and configure the GitLab for Slack (dev) app to work with it (docs)
  2. Checkout this feature branch, bundle and yarn, and restart GDK (docs)
  3. Enable the flag. On the GitPod terminal: cd /workspace/gitlab && bundle exec rails c, then:
    Feature.enable(:integration_slack_app_notifications)
  4. Choose a project, and set up the Slack application integration.
  5. Once set up, you can specify a channel to post events to.
  6. Public channels will receive Slack posts with no further user action. Private channels require @GitLab (dev) to be invited to the channel first.
    • To post to a private channel, go to the private channel, type /add and choose "Add apps to this channel", then choose GitLab (dev).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #373321 (closed)

Edited by Luke Duncalfe

Merge request reports