Commit 72fcea58 authored by Kati Paizee's avatar Kati Paizee

Edit Slack topic for style

parent 812a57a4
...@@ -10,27 +10,27 @@ The Slack notifications service enables your GitLab project to send events ...@@ -10,27 +10,27 @@ The Slack notifications service enables your GitLab project to send events
(such as issue creation) to your existing Slack team as notifications. Setting up (such as issue creation) to your existing Slack team as notifications. Setting up
Slack notifications requires configuration changes for both Slack and GitLab. Slack notifications requires configuration changes for both Slack and GitLab.
You can also use Slack slash commands to control GitLab inside Slack. This is the You can also use [Slack slash commands](slack_slash_commands.md)
separately configured [Slack slash commands](slack_slash_commands.md). to control GitLab from Slack. Slash commands are configured separately.
## Slack configuration ## Configure Slack
1. Sign in to your Slack team and [start a new Incoming WebHooks configuration](https://my.slack.com/services/new/incoming-webhook). 1. Sign in to your Slack team and [start a new Incoming WebHooks configuration](https://my.slack.com/services/new/incoming-webhook).
1. Identify the Slack channel where notifications should be sent to by default. 1. Identify the Slack channel where notifications should be sent to by default.
Select **Add Incoming WebHooks integration** to add the configuration. Select **Add Incoming WebHooks integration** to add the configuration.
1. Copy the **Webhook URL**, which is used later in the GitLab configuration. 1. Copy the **Webhook URL** to use later when you configure GitLab.
## GitLab configuration ## Configure GitLab
1. On the top bar, select **Menu > Projects** and find your project. 1. On the top bar, select **Menu > Projects** and find your project.
1. On the left sidebar, select **Settings > Integrations**. 1. On the left sidebar, select **Settings > Integrations**.
1. Select the **Slack notifications** integration to configure it. 1. Select **Slack notifications**.
1. In the **Enable integration** section, select the **Active** checkbox. 1. In the **Enable integration** section, select the **Active** checkbox.
1. In the **Trigger** section, select the checkboxes for each type of GitLab 1. 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 event to send to Slack as a notification. For a full list, see
[Triggers available for Slack notifications](#triggers-available-for-slack-notifications). [Triggers for Slack notifications](#triggers-for-slack-notifications).
By default, messages are sent to the channel you configured during By default, messages are sent to the channel you configured during
[Slack integration](#slack-configuration). [Slack configuration](#configure-slack).
1. (Optional) To send messages to a different channel, multiple channels, or as 1. (Optional) To send messages to a different channel, multiple channels, or as
a direct message: a direct message:
- *To send messages to channels,* enter the Slack channel names, separated by - *To send messages to channels,* enter the Slack channel names, separated by
...@@ -40,38 +40,38 @@ separately configured [Slack slash commands](slack_slash_commands.md). ...@@ -40,38 +40,38 @@ separately configured [Slack slash commands](slack_slash_commands.md).
NOTE: NOTE:
Usernames and private channels are not supported. Usernames and private channels are not supported.
1. In **Webhook**, enter the webhook URL you copied from the previous 1. In **Webhook**, enter the webhook URL you copied in the
[Slack integration](#slack-configuration) step. [Slack configuration](#configure-slack) step.
1. (Optional) In **Username**, enter the username of the Slack bot that sends 1. (Optional) In **Username**, enter the username of the Slack bot that sends
the notifications. the notifications.
1. Select the **Notify only broken pipelines** checkbox to notify only on failures. 1. Select the **Notify only broken pipelines** checkbox to notify only on failures.
1. In the **Branches to be notified** dropdown, select which types of branches 1. In the **Branches to be notified** dropdown, select which types of branches
to send notifications for. to send notifications for.
1. Leave the **Labels to be notified** field blank to get all notifications or 1. Leave the **Labels to be notified** field blank to get all notifications, or
add labels that the issue or merge request must have in order to trigger a add labels that the issue or merge request must have to trigger a
notification. notification.
1. Select **Test settings** to verify your information, and then select 1. Select **Test settings** to verify your information, and then select
**Save changes**. **Save changes**.
Your Slack team now starts receiving GitLab event notifications as configured. Your Slack team now starts receiving GitLab event notifications as configured.
### Triggers available for Slack notifications ## Triggers for Slack notifications
The following triggers are available for Slack notifications: The following triggers are available for Slack notifications:
| Trigger | Description | | Trigger name | Trigger event |
|------------------------|-------------| |------------------------|------------------------------------------------------|
| **Push** | Triggered by a push to the repository. | | **Push** | A push to the repository. |
| **Issue** | Triggered when an issue is created, updated, or closed. | | **Issue** | An issue is created, updated, or closed. |
| **Confidential issue** | Triggered when a confidential issue is created, updated, or closed. | | **Confidential issue** | A confidential issue is created, updated, or closed. |
| **Merge request** | Triggered when a merge request is created, updated, or merged. | | **Merge request** | A merge request is created, updated, or merged. |
| **Note** | Triggered when someone adds a comment. | | **Note** | A comment is added. |
| **Confidential note** | Triggered when someone adds a confidential note. | | **Confidential note** | A confidential note is added. |
| **Tag push** | Triggered when a new tag is pushed to the repository. | | **Tag push** | A new tag is pushed to the repository. |
| **Pipeline** | Triggered when a pipeline status changes. | | **Pipeline** | A pipeline status changed. |
| **Wiki page** | Triggered when a wiki page is created or updated. | | **Wiki page** | A wiki page is created or updated. |
| **Deployment** | Triggered when a deployment starts or finishes. | | **Deployment** | A deployment starts or finishes. |
| **Alert** | Triggered when a new, unique alert is recorded. | | **Alert** | A new, unique alert is recorded. |
## Troubleshooting ## Troubleshooting
...@@ -81,45 +81,48 @@ for errors relating to your Slack service. ...@@ -81,45 +81,48 @@ for errors relating to your Slack service.
### Something went wrong on our end ### Something went wrong on our end
This is a generic error shown in the GitLab UI and does not mean much by itself. You might get this generic error message in the GitLab UI.
Review [the logs](../../../administration/logs.md#productionlog) to find Review [the logs](../../../administration/logs.md#productionlog) to find
an error message and keep troubleshooting from there. the error message and keep troubleshooting from there.
### `certificate verify failed` ### `certificate verify failed`
You may see an entry similar to the following in your Sidekiq log: You might see an entry like the following in your Sidekiq log:
```plaintext ```plaintext
2019-01-10_13:22:08.42572 2019-01-10T13:22:08.425Z 6877 TID-abcdefg ProjectServiceWorker JID-3bade5fb3dd47a85db6d78c5 ERROR: {:class=>"ProjectServiceWorker", :service_class=>"SlackService", :message=>"SSL_connect returned=1 errno=0 state=error: certificate verify failed"} 2019-01-10_13:22:08.42572 2019-01-10T13:22:08.425Z 6877 TID-abcdefg ProjectServiceWorker JID-3bade5fb3dd47a85db6d78c5 ERROR: {:class=>"ProjectServiceWorker", :service_class=>"SlackService", :message=>"SSL_connect returned=1 errno=0 state=error: certificate verify failed"}
``` ```
This is probably a problem either with GitLab communicating with Slack, or GitLab This issue occurs when there is a problem with GitLab communicating with Slack,
communicating with itself. The former is less likely, as Slack's security certificates or GitLab communicating with itself.
should _hopefully_ always be trusted. We can establish which we're dealing with by using The former is less likely, as Slack security certificates should always be trusted.
the below rails console script.
```shell To view which of these problems is the cause of the issue:
# start a rails console:
sudo gitlab-rails console -e production
# or for source installs: 1. Start a Rails console:
bundle exec rails console -e production
```
```ruby ```shell
# run this in the Rails console sudo gitlab-rails console -e production
# replace <SLACK URL> with your actual Slack URL
result = Net::HTTP.get(URI('https://<SLACK URL>'));0
# replace <GITLAB URL> with your actual GitLab URL # for source installs:
result = Net::HTTP.get(URI('https://<GITLAB URL>'));0 bundle exec rails console -e production
``` ```
1. Run the following commands:
```ruby
# replace <SLACK URL> with your actual Slack URL
result = Net::HTTP.get(URI('https://<SLACK URL>'));0
# replace <GITLAB URL> with your actual GitLab URL
result = Net::HTTP.get(URI('https://<GITLAB URL>'));0
```
If GitLab is not trusting HTTPS connections to itself, then you may If GitLab does not trust HTTPS connections to itself,
need to [add your certificate to the GitLab trusted certificates](https://docs.gitlab.com/omnibus/settings/ssl.html#install-custom-public-certificates). [add your certificate to the GitLab trusted certificates](https://docs.gitlab.com/omnibus/settings/ssl.html#install-custom-public-certificates).
If GitLab is not trusting connections to Slack, then the GitLab If GitLab does not trust connections to Slack,
OpenSSL trust store is incorrect. Some typical causes: the GitLab OpenSSL trust store is incorrect. Typical causes are:
- Overriding the trust store with `gitlab_rails['env'] = {"SSL_CERT_FILE" => "/path/to/file.pem"}`. - Overriding the trust store with `gitlab_rails['env'] = {"SSL_CERT_FILE" => "/path/to/file.pem"}`.
- Accidentally modifying the default CA bundle `/opt/gitlab/embedded/ssl/certs/cacert.pem`. - Accidentally modifying the default CA bundle `/opt/gitlab/embedded/ssl/certs/cacert.pem`.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment