Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of Slack user-group mentioning in the alert message #585

Merged
merged 1 commit into from
Oct 22, 2020

Conversation

ArXa1L
Copy link
Contributor

@ArXa1L ArXa1L commented Oct 20, 2020

Hello,
My team has a single channel for alerts across all our applications. For each application we added a separate Slack user-group (@gitlab_duty/@teamcity_duty for example) that contains one or several engineers on duty and we would like to mention these groups in the alert message.

Moira uses Slack API chat.postMessage for sending alert messages and that requires us to specify that user group by using the rather complicated syntax <!Subteam^SAZ94GDB8> (see https://api.slack.com/reference/surfaces/formatting#mentioning-groups). We can't get user-group ID from the Slack Desktop App and we have to use Slack API in order to do that.

There is another way: we can specify additional property Parse with value full in PostMessageParameters which change how Slack treats the message (see https://api.slack.com/methods/chat.postMessage#formatting). In my opinion this way is more user-friendly and the required changes are minor.

@ArXa1L ArXa1L requested a review from a team as a code owner October 20, 2020 17:11
@coveralls
Copy link

coveralls commented Oct 20, 2020

Coverage Status

Coverage decreased (-0.02%) to 75.247% when pulling 1038a91 on ArXa1L:feature/slack/parse into 85cf51d on moira-alert:master.

@ArXa1L
Copy link
Contributor Author

ArXa1L commented Oct 21, 2020

According to unofficial information, the "Parse" can be deprecated and will be removed soon. Just in case, I added one more property that changes in similar way how Slack API processes the message (see https://api.slack.com/methods/chat.postMessage#arg_link_names)

beevee
beevee previously approved these changes Oct 22, 2020
feat(slack): add 'LinkNames: 1' post message argument
@beevee beevee merged commit 7d6abbb into moira-alert:master Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants