Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bbda97dd
Commit
bbda97dd
authored
Jan 26, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
3e2ef953
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
changelogs/unreleased/fix-ms-teams-branch-setting.yml
changelogs/unreleased/fix-ms-teams-branch-setting.yml
+5
-0
lib/api/helpers/services_helpers.rb
lib/api/helpers/services_helpers.rb
+6
-0
spec/requests/api/services_spec.rb
spec/requests/api/services_spec.rb
+33
-1
No files found.
changelogs/unreleased/fix-ms-teams-branch-setting.yml
0 → 100644
View file @
bbda97dd
---
title
:
Fix missing API notification argument for Microsoft Teams
merge_request
:
23571
author
:
Seiji Suenaga
type
:
fixed
lib/api/helpers/services_helpers.rb
View file @
bbda97dd
...
...
@@ -675,6 +675,12 @@ module API
type:
String
,
desc:
'The Microsoft Teams webhook. e.g. https://outlook.office.com/webhook/…'
},
{
required:
false
,
name: :branches_to_be_notified
,
type:
String
,
desc:
'Branches for which notifications are to be sent'
},
chat_notification_flags
].
flatten
,
'mattermost'
=>
[
...
...
spec/requests/api/services_spec.rb
View file @
bbda97dd
...
...
@@ -241,10 +241,42 @@ describe API::Services do
end
it
'accepts a username for update'
do
put
api
(
"/projects/
#{
project
.
id
}
/services/
mattermost
"
,
user
),
params:
params
.
merge
(
username:
'new_username'
)
put
api
(
"/projects/
#{
project
.
id
}
/services/
#{
service_name
}
"
,
user
),
params:
params
.
merge
(
username:
'new_username'
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'properties'
][
'username'
]).
to
eq
(
'new_username'
)
end
end
describe
'Microsoft Teams service'
do
let
(
:service_name
)
{
'microsoft-teams'
}
let
(
:params
)
do
{
webhook:
'https://hook.example.com'
,
branches_to_be_notified:
'default'
,
notify_only_broken_pipelines:
false
}
end
before
do
project
.
create_microsoft_teams_service
(
active:
true
,
properties:
params
)
end
it
'accepts branches_to_be_notified for update'
do
put
api
(
"/projects/
#{
project
.
id
}
/services/
#{
service_name
}
"
,
user
),
params:
params
.
merge
(
branches_to_be_notified:
'all'
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'properties'
][
'branches_to_be_notified'
]).
to
eq
(
'all'
)
end
it
'accepts notify_only_broken_pipelines for update'
do
put
api
(
"/projects/
#{
project
.
id
}
/services/
#{
service_name
}
"
,
user
),
params:
params
.
merge
(
notify_only_broken_pipelines:
true
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
'properties'
][
'notify_only_broken_pipelines'
]).
to
eq
(
true
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment