Commit f6e9cc71 authored by Marcel Amirault's avatar Marcel Amirault Committed by Jose Ivan Vargas

Update mattermost integration UI text

parent c36cf6d0
......@@ -11,7 +11,7 @@ const typeWithPlaceholder = {
const placeholderForType = {
[typeWithPlaceholder.SLACK]: __('Slack channels (e.g. general, development)'),
[typeWithPlaceholder.MATTERMOST]: __('Channel handle (e.g. town-square)'),
[typeWithPlaceholder.MATTERMOST]: __('my-channel'),
};
export default {
......
......@@ -4,29 +4,29 @@ module ServicesHelper
def service_event_description(event)
case event
when "push", "push_events"
s_("ProjectService|Event triggered when someone pushes to the repository.")
s_("ProjectService|Trigger event for pushes to the repository.")
when "tag_push", "tag_push_events"
s_("ProjectService|Event triggered when a new tag is pushed to the repository.")
s_("ProjectService|Trigger event for new tags pushed to the repository.")
when "note", "note_events"
s_("ProjectService|Event triggered when someone adds a comment.")
s_("ProjectService|Trigger event for new comments.")
when "confidential_note", "confidential_note_events"
s_("ProjectService|Event triggered when someone adds a comment on a confidential issue.")
s_("ProjectService|Trigger event for new comments on confidential issues.")
when "issue", "issue_events"
s_("ProjectService|Event triggered when an issue is created, updated, or closed.")
s_("ProjectService|Trigger event when an issue is created, updated, or closed.")
when "confidential_issue", "confidential_issue_events"
s_("ProjectService|Event triggered when a confidential issue is created, updated, or closed.")
s_("ProjectService|Trigger event when a confidential issue is created, updated, or closed.")
when "merge_request", "merge_request_events"
s_("ProjectService|Event triggered when a merge request is created, updated, or merged.")
s_("ProjectService|Trigger event when a merge request is created, updated, or merged.")
when "pipeline", "pipeline_events"
s_("ProjectService|Event triggered when a pipeline status changes.")
s_("ProjectService|Trigger event when a pipeline status changes.")
when "wiki_page", "wiki_page_events"
s_("ProjectService|Event triggered when a wiki page is created or updated.")
s_("ProjectService|Trigger event when a wiki page is created or updated.")
when "commit", "commit_events"
s_("ProjectService|Event triggered when a commit is created or updated.")
s_("ProjectService|Trigger event when a commit is created or updated.")
when "deployment"
s_("ProjectService|Event triggered when a deployment starts or finishes.")
s_("ProjectService|Trigger event when a deployment starts or finishes.")
when "alert"
s_("ProjectService|Event triggered when a new, unique alert is recorded.")
s_("ProjectService|Trigger event when a new, unique alert is recorded.")
end
end
......
......@@ -61,11 +61,11 @@ class ChatNotificationService < Service
def default_fields
[
{ type: 'text', name: 'webhook', placeholder: "e.g. #{webhook_placeholder}", required: true }.freeze,
{ type: 'text', name: 'username', placeholder: 'e.g. GitLab' }.freeze,
{ type: 'checkbox', name: 'notify_only_broken_pipelines' }.freeze,
{ type: 'text', name: 'webhook', placeholder: "#{webhook_placeholder}", required: true }.freeze,
{ type: 'text', name: 'username', placeholder: 'GitLab-integration' }.freeze,
{ type: 'checkbox', name: 'notify_only_broken_pipelines', help: 'Do not send notifications for successful pipelines.' }.freeze,
{ type: 'select', name: 'branches_to_be_notified', choices: branch_choices }.freeze,
{ type: 'text', name: 'labels_to_be_notified', placeholder: 'e.g. ~backend', help: 'Only supported for issue, merge request and note events.' }.freeze
{ type: 'text', name: 'labels_to_be_notified', placeholder: '~backend,~frontend', help: 'Send notifications for issue, merge request, and comment events with the listed labels only. Leave blank to receive notifications for all events.' }.freeze
].freeze
end
......
......@@ -2,13 +2,14 @@
class MattermostService < ChatNotificationService
include SlackMattermost::Notifier
include ActionView::Helpers::UrlHelper
def title
'Mattermost notifications'
s_('Mattermost notifications')
end
def description
'Receive event notifications in Mattermost'
s_('Send notifications about project events to Mattermost channels.')
end
def self.to_param
......@@ -16,21 +17,15 @@ class MattermostService < ChatNotificationService
end
def help
'This service sends notifications about projects events to Mattermost channels.<br />
To set up this service:
<ol>
<li><a href="https://docs.mattermost.com/developer/webhooks-incoming.html#enabling-incoming-webhooks">Enable incoming webhooks</a> in your Mattermost installation.</li>
<li><a href="https://docs.mattermost.com/developer/webhooks-incoming.html#creating-integrations-using-incoming-webhooks">Add an incoming webhook</a> in your Mattermost team. The default channel can be overridden for each event.</li>
<li>Paste the webhook <strong>URL</strong> into the field below.</li>
<li>Select events below to enable notifications. The <strong>Channel handle</strong> and <strong>Username</strong> fields are optional.</li>
</ol>'
docs_link = link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/mattermost'), target: '_blank', rel: 'noopener noreferrer'
s_('Send notifications about project events to Mattermost channels. %{docs_link}').html_safe % { docs_link: docs_link.html_safe }
end
def default_channel_placeholder
"Channel handle (e.g. town-square)"
'my-channel'
end
def webhook_placeholder
'http://mattermost.example.com/hooks/'
'http://mattermost.example.com/hooks/'
end
end
---
title: Update mattermost integration UI text
merge_request: 58570
author:
type: other
......@@ -4,18 +4,23 @@ group: Ecosystem
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
# Mattermost Notifications Service **(FREE)**
# Mattermost notifications service **(FREE)**
The Mattermost Notifications Service allows your GitLab project to send events (e.g., `issue created`) to your existing Mattermost team as notifications. This requires configurations in both Mattermost and GitLab.
Use the Mattermost notifications service to send notifications for GitLab events
(for example, `issue created`) to Mattermost. You must configure both [Mattermost](#configure-mattermost-to-receive-gitlab-notifications)
and [GitLab](#configure-gitlab-to-send-notifications-to-mattermost).
You can also use Mattermost slash commands to control GitLab inside Mattermost. This is the separately configured [Mattermost slash commands](mattermost_slash_commands.md).
You can also use [Mattermost slash commands](mattermost_slash_commands.md) to control
GitLab inside Mattermost.
## On Mattermost
## Configure Mattermost to receive GitLab notifications
To enable Mattermost integration you must create an incoming webhook integration:
To use the Mattermost integration you must create an incoming webhook integration
in Mattermost:
1. Sign in to your Mattermost instance.
1. Visit incoming webhooks, that is something like: `https://mattermost.example.com/your_team_name/integrations/incoming_webhooks/add`.
1. [Enable incoming webhooks](https://docs.mattermost.com/developer/webhooks-incoming.html#enabling-incoming-webhooks).
1. [Add an incoming webhook](https://docs.mattermost.com/developer/webhooks-incoming.html#creating-integrations-using-incoming-webhooks).
1. Choose a display name, description and channel, those can be overridden on GitLab.
1. Save it and copy the **Webhook URL** because we need this later for GitLab.
......@@ -29,36 +34,24 @@ to enable it on:
Display name override is not enabled by default, you need to ask your administrator to enable it on that same section.
## On GitLab
## Configure GitLab to send notifications to Mattermost
After you set up Mattermost, it's time to set up GitLab.
After the Mattermost instance has an incoming webhook set up, you can set up GitLab
to send the notifications.
Navigate to the [Integrations page](overview.md#accessing-integrations)
and select the **Mattermost notifications** service to configure it.
There, you see a checkbox with the following events that can be triggered:
and select the **Mattermost notifications** service. Select the GitLab events
you want to generate notifications for.
- Push
- Issue
- Confidential issue
- Merge request
- Note
- Confidential note
- Tag push
- Pipeline
- Wiki page
- Deployment
For each event you select, input the Mattermost channel you want to receive the
notification. You do not need to add the hash sign (`#`).
Below each of these event checkboxes, you have an input field to enter
which Mattermost channel you want to send that event message. Enter your preferred channel handle (the hash sign `#` is optional).
At the end, fill in your Mattermost details:
Then fill in the integration configuration:
| Field | Description |
| ----- | ----------- |
| **Webhook** | The incoming webhook URL which you have to set up on Mattermost, similar to: `http://mattermost.example/hooks/5xo…` |
| **Username** | Optional username which can be on messages sent to Mattermost. Fill this in if you want to change the username of the bot. |
| **Notify only broken pipelines** | If you choose to enable the **Pipeline** event and you want to be only notified about failed pipelines. |
| **Branches to be notified** | Select which types of branches to send notifications for. |
| **Labels to be notified** | Optional labels that the issue or merge request must have in order to trigger a notification. Leave blank to get all notifications. |
![Mattermost configuration](img/mattermost_configuration_v2.png)
| **Webhook** | The incoming webhook URL on Mattermost, similar to: `http://mattermost.example/hooks/5xo…`. |
| **Username** | (Optional) The username to show on messages sent to Mattermost. Fill this in to change the username of the bot. |
| **Notify only broken pipelines** | If you enable the **Pipeline** event and you want to be notified about failed pipelines only. |
| **Branches to be notified** | Select which branches to send notifications for. |
| **Labels to be notified** | (Optional) Labels that the issue or merge request must have to trigger a notification. Leave blank to get notifications for all issues and merge requests. |
......@@ -5802,9 +5802,6 @@ msgstr ""
msgid "Changing group URL can have unintended side effects."
msgstr ""
msgid "Channel handle (e.g. town-square)"
msgstr ""
msgid "Charts can't be displayed as the request for data has timed out. %{documentationLink}"
msgstr ""
......@@ -18975,6 +18972,9 @@ msgstr ""
msgid "Mattermost URL:"
msgstr ""
msgid "Mattermost notifications"
msgstr ""
msgid "MattermostService|Add to Mattermost"
msgstr ""
......@@ -24137,67 +24137,67 @@ msgstr ""
msgid "ProjectService|Enter new password"
msgstr ""
msgid "ProjectService|Event triggered when a commit is created or updated."
msgid "ProjectService|Issue URL"
msgstr ""
msgid "ProjectService|Event triggered when a confidential issue is created, updated, or closed."
msgid "ProjectService|Jenkins URL"
msgstr ""
msgid "ProjectService|Event triggered when a deployment starts or finishes."
msgid "ProjectService|Leave blank to use your current API key"
msgstr ""
msgid "ProjectService|Event triggered when a merge request is created, updated, or merged."
msgid "ProjectService|Leave blank to use your current password"
msgstr ""
msgid "ProjectService|Event triggered when a new tag is pushed to the repository."
msgid "ProjectService|Mock service URL"
msgstr ""
msgid "ProjectService|Event triggered when a new, unique alert is recorded."
msgid "ProjectService|New issue URL"
msgstr ""
msgid "ProjectService|Event triggered when a pipeline status changes."
msgid "ProjectService|Perform common operations on GitLab project: %{project_name}"
msgstr ""
msgid "ProjectService|Event triggered when a wiki page is created or updated."
msgid "ProjectService|TeamCity URL"
msgstr ""
msgid "ProjectService|Event triggered when an issue is created, updated, or closed."
msgid "ProjectService|To configure this integration, you should:"
msgstr ""
msgid "ProjectService|Event triggered when someone adds a comment on a confidential issue."
msgid "ProjectService|Trigger event for new comments on confidential issues."
msgstr ""
msgid "ProjectService|Event triggered when someone adds a comment."
msgid "ProjectService|Trigger event for new comments."
msgstr ""
msgid "ProjectService|Event triggered when someone pushes to the repository."
msgid "ProjectService|Trigger event for new tags pushed to the repository."
msgstr ""
msgid "ProjectService|Issue URL"
msgid "ProjectService|Trigger event for pushes to the repository."
msgstr ""
msgid "ProjectService|Jenkins URL"
msgid "ProjectService|Trigger event when a commit is created or updated."
msgstr ""
msgid "ProjectService|Leave blank to use your current API key"
msgid "ProjectService|Trigger event when a confidential issue is created, updated, or closed."
msgstr ""
msgid "ProjectService|Leave blank to use your current password"
msgid "ProjectService|Trigger event when a deployment starts or finishes."
msgstr ""
msgid "ProjectService|Mock service URL"
msgid "ProjectService|Trigger event when a merge request is created, updated, or merged."
msgstr ""
msgid "ProjectService|New issue URL"
msgid "ProjectService|Trigger event when a new, unique alert is recorded."
msgstr ""
msgid "ProjectService|Perform common operations on GitLab project: %{project_name}"
msgid "ProjectService|Trigger event when a pipeline status changes."
msgstr ""
msgid "ProjectService|TeamCity URL"
msgid "ProjectService|Trigger event when a wiki page is created or updated."
msgstr ""
msgid "ProjectService|To configure this integration, you should:"
msgid "ProjectService|Trigger event when an issue is created, updated, or closed."
msgstr ""
msgid "ProjectSettings|%{link_start}What are description templates?%{link_end}"
......@@ -27788,6 +27788,12 @@ msgstr ""
msgid "Send message"
msgstr ""
msgid "Send notifications about project events to Mattermost channels."
msgstr ""
msgid "Send notifications about project events to Mattermost channels. %{docs_link}"
msgstr ""
msgid "Send report"
msgstr ""
......@@ -36813,6 +36819,9 @@ msgstr ""
msgid "my-awesome-group"
msgstr ""
msgid "my-channel"
msgstr ""
msgid "n/a"
msgstr ""
......
......@@ -17,7 +17,7 @@ RSpec.describe ServiceEventEntity do
let(:event) { 'push' }
it 'exposes correct attributes' do
expect(subject[:description]).to eq('Event triggered when someone pushes to the repository.')
expect(subject[:description]).to eq('Trigger event for pushes to the repository.')
expect(subject[:name]).to eq('push_events')
expect(subject[:title]).to eq('push')
expect(subject[:value]).to be(true)
......@@ -29,7 +29,7 @@ RSpec.describe ServiceEventEntity do
let(:event) { 'note' }
it 'exposes correct attributes' do
expect(subject[:description]).to eq('Event triggered when someone adds a comment.')
expect(subject[:description]).to eq('Trigger event for new comments.')
expect(subject[:name]).to eq('note_events')
expect(subject[:title]).to eq('note')
expect(subject[:value]).to eq(false)
......
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