Make Slack notifications use a user's Slack username for a "mention"
Summary
We love Gitlab and Slack. Unfortunately, the integration of the 2 leaves something to be desired when it comes to notifying users.
Here's my attempt at writing the ideal scenario:
Feature: Slack Notification Highlighting when mentioning a user
Scenario:
Given the "Dan" user has set his "Slack" user
Given the "Infrastructure" project has the Slack integration
When the "Dan" user comments on an issue in project "Infrastructure" mentioning the "Justin" user
then the message posted to Slack should translate the Gitlab username to the Slack username
and the "Justin" user will receive a Slack "mention"
I suppose the key changes in this feature would be as follows:
- Add the slack field to the User model
- Maybe have this line use the User's slack field when it's present (I think that would do it)
- Maybe changes are needed on https://github.com/stevenosloan/slack-notifier (I'll need to take a closer look there)
feature proposal in GitLab FOSS
Our Workaround
-
In order to generate a Slack "mention" for the Gitlab user,
justin.awesome.com
, who has the Slack username,@justin
, I have to write a comment like this:<@justin> could you review this please?
-
This works by Slack's message formatting
-
Ideally, I'd be able to write a comment like this:
@justin.awesome.com could you review this please?
- And the
@justin
Slack user would receive a mention in Slack
- And the
-