Documentation


Slack notifications

Note

This document considers that the project is ready and that you successfully ran a first analysis on the code. If this is not the case yet, read the "Getting started" section.

Note

The notifications feature is only available on the Team plan. You can manage your current plan on your account page.

Now that the project is being analyzed (automatically or manually) by SymfonyInsight, you may like to receive notifications about the results of these analysis in your favorite messaging application.

Configure incoming WebHooks on your Slack team

The first step to be notified by SymfonyInsight in Slack is to configure Slack to receive incoming WebHooks.

To do so, go to https://<your-team>.slack.com/apps/A0F7XDUAZ-incoming-webhooks (replace <your-team> by your team identifier on Slack) and click on "Add Configuration".

Choose the channel you want to publish in (this can be changed afterwards) and click on "Add Incoming WebHook". This will give you a WebHook URL that should look like this: https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXX. Keep this URL close as you will need it to configure SymfonyInsight.

Add the notification configuration on SymfonyInsight

Notifications configuration can be put either in the .symfony.insight.yaml file or on the project edition page. While we usually recommend to put configuration in the file, notifications configuration can be sensitive as anyone having access to the WebHook URL can publish using it. It is therefore safer to put it in the SymfonyInsight Web interface, on the project edition page.

Note

You can learn more about how to configure SymfonyInsight on the dedicated documentation page.

Click on the "Edit project" link on the project page in SymfonyInsight and add the following lines in the "Advanced configuration" section:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
notifications:
    - type: slack

      # The Slack WebHook URL you got in the previous step
      url: https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXX

      # Where do SymfonyInsight should post notifications in Slack
      # You can notify either a channel (for instance '#insight')
      # or a user, as direct message (for instance, '@johndoe')
      channel: '#insight'

      # On which event SymfonyInsight should post notifications
      on_success: true  # Notify when an analysis succeeded
      on_failure: true  # Notify when an analysis failed or errored

Once configured, you should see notifications appear in Slack: