Can't set mattermost username / channel from API
Summary
I can't set username and channel in Mattermost notification integration with API as it is described in API docs.
Steps to reproduce
curl -XPUT -v -H "Content-Type: application/json" --header "Private-Token: <private-token>" https://gitlab.example.com/api/v3/projects/825/services/mattermost -d '{
"webhook": "http://www.example.org/hook/1234",
"username": "TestUser"
}'
GitLab returns:
{
"id":507,
"title":"Mattermost notifications",
"created_at":"2017-11-07T13:22:56.063+01:00",
"updated_at":"2017-11-07T13:39:12.662+01:00",
"active":true,
"push_events":true,
"issues_events":true,
"merge_requests_events":true,
"tag_push_events":true,
"note_events":true,
"pipeline_events":true,
"job_events":true,
"properties":{
"webhook":"http://www.example.org/hook/1234",
"notify_only_broken_pipelines":true,
"notify_only_default_branch":true
}
}
Example Project
I created a project on gitlab.com and tried the upper curl. Result is the same, username field is not set.
What is the current bug behavior?
Username field in Mattermost notification integration is not populated. According to API docs, this should be possible.
What is the expected correct behavior?
Username should be set to TestUser.
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.1.0 Redis Version: 3.2.5 Git Version: 2.13.6 Sidekiq Version:5.0.4 Go Version: unknown
GitLab information Version: 10.1.1 Revision: cc27e5f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://xxxxxxxx HTTP Clone URL: https://xxxxxxxx/some-group/some-project.git SSH Clone URL: git@xxxxxxxx:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.9.3 Repository storage paths:
- default: /opt/gitlab-storage/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git