Fine-grained Slack notifications
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
*This page may contain information related to upcoming products, features and functionality.
It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes.
Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.*
<!-- triage-serverless v3 PLEASE DO NOT REMOVE THIS SECTION -->
### Description
Increase granularity of notifications sent to Slack
### Proposal
Currently, users subscribing to notifications for Merge request events would receive a notification when a merge request is created, updated, or merged.
Instead, users could choose to subscribe to more granular event options for each Notification Type. For example, for the Merge Requests Notification Type, we could have options for users to configure subscriptions for each of the following events (for a given project).
| Trigger / Notification Type | Event | Action |
|-------------------------|--------------------------------|----------------------------------|
| Merge request events | Merge request created | Event will be triggered when a merge request is created |
| Merge request events | Merge request Ready for Review | Event will be triggered when a merge request is moved from Draft to Ready for Review |
| Merge request events | Merge request updated |Event will be triggered when a merge request is updated |
| Merge request events | Merge request merged | Event will be triggered when a merge request is merged |
| Merge request events | Merge request closed | Event will be triggered when a merge request is closed (without merging) |
| High level concept showing notification creation in the UI |
| ------ |
|  |
| Notification list | Notification details |
| ------ | ------ |
|  |  |
### Rationale
The DEV team is interested only in "Merge request created" events as they are supposed to review the source, put some comments and finally accept or reject it. It would be useful to have a dedicated Slack channel with MRC notification - the DEV team could indicate the MR status using emojis e.g. :mag: - under investigation, :thumbsup: - accepted, :thumbsdown: - rejected.
On the other side, the Product Owner and other teams are only interested in "Merge request accepted". They know which features have been completed and will be available soon. The separate Slack channel would a great place for such notifications.
#### To do
- [ ] Add User stories that focus on the Merge request event
- [ ] Test interaction design paradigm by identifying all possible conditions for Each Trigger type
- [ ] Gather feedback on user stories
### Design considerations
- Identify where a Stepper config flow would live for admin settings (e.g. Slack Application could include Notifications section and then Slash Commands section); or, a tabbed solution - how would this impact existing settings templates?
- How to surface the user settings (vs admin settings) for the Slack integration --> this could be added to DM issue
### Prioritization
By analyzing usage (Self-managed for this example), we can see see the usage patterns for what appear to be the most important categories of notification (based on May 2022):
1. MR notifications (83k)
1. Push notifications (49.6k)
1. Note notifications (31.8k)
1. Issue notifications (15k)
1. Tag Push notifications (13.3k)
See [dashboard [internal]](https://app.periscopedata.com/app/gitlab/822206/DRAFT:-Ecosystem-Usage).
This generally aligns with feedback from customers (in terms of priority), though Notes often don’t come up.
### Planning Breakdown & Solution Validation
I've marked this as ~"workflow::solution validation" as once we've determined an approach, we can then further break down the Epic into smaller / more achievable MVCs. One generic approach may solve for many related issues.
### Design source
- :pencil2: [Figma](https://www.figma.com/file/pgNN93RcReCEdRzYqCbPEO/Design%3A-Fine-Grained-Slack-Notifications-(%23299351)?node-id=1308%3A5405)
- :pencil2: [Mural](https://app.mural.co/t/gitlab2474/m/gitlab2474/1655929549822/98b62b54487aa976aa4bcce35e66625b647a644d?invited=true&sender=lvanc7268)
epic