Messages sent by `Slack notifications` for Merge Requests are badly formatted
Summary
The messages sent by the "Slack notifications" integrations are wrong: Merge Requests events should contain a proper link to the MR.
Steps to reproduce
Gitlab version: 9.2.4-ee (c771fef)
I'm running a Gitlab-ee instance using Docker:
docker run --detach \
--hostname my.domain \
--publish 8181:8181 \
--publish 9022:22 \
--add-host my.hook.domain:192.168.1.8 \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
--restart always \
--name gitlab \
gitlab/gitlab-ee:latest
I have a project configured with Slack notifications enabled for Merge Requests (in Project > Settings > Integrations > Slack notifications), which send messages to a Slack channel called gitlab.
Doing any action on a Merge Request (open, approve, or merge) triggers the hook and sends a message to my Slack channel, but it looks like there's a typo in the message.
What is the current bug behavior?
Raw message received:
bob opened [!123 My merge request title](http://my.gitlab.domain/my/project/merge_requests/123) in my/project: My merge request title
What is the expected correct behavior?
Raw message I should receive (this was the case in a previous Gitlab version):
bob opened merge request !123 in my/project: My merge request title
Where merge request !123 is a link to http://my.gitlab.domain/my/project/merge_requests/123
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:5.0.0GitLab information Version: 9.2.4-ee Revision: c771fef Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.1 URL: http://my.domain HTTP Clone URL: http://my.domain/some-group/some-project.git SSH Clone URL: git@my.domain:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.0.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.0.4 ? ... OK (5.0.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 6/9 ... ok 6/11 ... ok 20/12 ... ok 12/13 ... ok 18/15 ... ok 6/16 ... ok 20/17 ... ok 20/19 ... ok 20/20 ... ok 20/21 ... ok 20/22 ... ok 5/23 ... ok 5/24 ... ok 5/25 ... ok 17/26 ... ok 18/27 ... ok 20/28 ... ok 5/29 ... ok 17/30 ... ok 26/31 ... ok 26/32 ... ok 26/33 ... ok 28/34 ... ok 17/35 ... ok 28/36 ... ok 17/37 ... repository is empty Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) [...]
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) projects have namespace: ... 6/9 ... yes 6/11 ... yes 20/12 ... yes 12/13 ... yes 18/15 ... yes 6/16 ... yes 20/17 ... yes 20/19 ... yes 20/20 ... yes 20/21 ... yes 20/22 ... yes 5/23 ... yes 5/24 ... yes 5/25 ... yes 17/26 ... yes 18/27 ... yes 20/28 ... yes 5/29 ... yes 17/30 ... yes 26/31 ... yes 26/32 ... yes 26/33 ... yes 28/34 ... yes 17/35 ... yes 28/36 ... yes 17/37 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.11.1) Active users: 22
Checking GitLab ... Finished
Possible fixes
Use the proper syntax for custom URLs in messages: https://api.slack.com/docs/message-formatting#linking_to_urls