Commit 51267258 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-microsoft-teams-notification-flags' into 'master'

Fix missing API notification flags for Microsoft Teams

See merge request gitlab-org/gitlab-ce!29824
parents 0cd04bf3 1ce2c4dc
---
title: Fix missing API notification flags for Microsoft Teams
merge_request: 29824
author: Seiji Suenaga
type: fixed
...@@ -1023,6 +1023,8 @@ Parameters: ...@@ -1023,6 +1023,8 @@ Parameters:
| Parameter | Type | Required | Description | | Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- | | --------- | ---- | -------- | ----------- |
| `webhook` | string | true | The Microsoft Teams webhook. For example, `https://outlook.office.com/webhook/...` | | `webhook` | string | true | The Microsoft Teams webhook. For example, `https://outlook.office.com/webhook/...` |
| `notify_only_broken_pipelines` | boolean | false | Send notifications for broken pipelines |
| `notify_only_default_branch` | boolean | false | Send notifications only for the default branch |
| `push_events` | boolean | false | Enable notifications for push events | | `push_events` | boolean | false | Enable notifications for push events |
| `issues_events` | boolean | false | Enable notifications for issue events | | `issues_events` | boolean | false | Enable notifications for issue events |
| `confidential_issues_events` | boolean | false | Enable notifications for confidential issue events | | `confidential_issues_events` | boolean | false | Enable notifications for confidential issue events |
......
...@@ -683,8 +683,9 @@ module API ...@@ -683,8 +683,9 @@ module API
name: :webhook, name: :webhook,
type: String, type: String,
desc: 'The Microsoft Teams webhook. e.g. https://outlook.office.com/webhook/…' desc: 'The Microsoft Teams webhook. e.g. https://outlook.office.com/webhook/…'
} },
], chat_notification_flags
].flatten,
'mattermost' => [ 'mattermost' => [
chat_notification_settings, chat_notification_settings,
chat_notification_flags, chat_notification_flags,
......
...@@ -289,6 +289,18 @@ describe MicrosoftTeamsService do ...@@ -289,6 +289,18 @@ describe MicrosoftTeamsService do
expect(result).to be_falsy expect(result).to be_falsy
end end
end end
context 'when disabled' do
let(:pipeline) do
create(:ci_pipeline, :failed, project: project, ref: 'not-the-default-branch')
end
before do
chat_service.notify_only_default_branch = false
end
it_behaves_like 'call Microsoft Teams API'
end
end end
end end
end end
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