Extend Slack app to support notifications
## Background
There are currently 2 Slack integrations:
* Slack notifications: set up starting point is in Slack app. Sends notifications from GitLab to Slack
* Slack application: set up starting point is GitLab. Allows users to type `/commands` to do actions in GitLab
Slack notifications will be deprecated and its functionality will be brought into Slack application.
## Release Notes
The GitLab for Slack app is the new home for managing notifications from GitLab to your Slack workspace. Alongside existing app features such as slash commands and link previews, you can specify which Slack channels you want to notify based on merge requests, push events, issue changes, and many other GitLab events.
The Slack Notifications integration is now deprecated and will eventually be removed as we continue to expand support for our GitLab for Slack app to better meet your needs.
To keep your teams in sync with what's happening in GitLab, get the [GitLab for Slack app](https://gitlab.slack.com/apps/A676ADMV5-gitlab) today!

## Why are we moving notifications to the Slack App?
Beyond the fact that Slack has recommended Slack Apps over the legacy incoming webhooks functionality, we'll also gain the advantage of offering our slash commands and notifications together through a single integration. As we continue to consolidate our Slack functionality, less setup and configuration will be required for project maintainers. GitLab will be able to reach all of our customers in Slack seamlessly with upcoming improvements and bug fixes, such as adding new trigger types, adding support for Self-managed users, and building more fine-grained configuration of notifications.
## Why we need to deprecate Slack notifications
The current Slack notification integration uses [incoming webhooks](https://api.slack.com/legacy/custom-integrations/messaging/webhooks), but this method will be deprecated by Slack.
Message from Slack:
> You're reading this because you're looking for info on legacy custom integrations - an outdated way for teams to integrate with Slack. These integrations lack newer features and they will be deprecated and possibly removed in the future. We do not recommend their use.
> Instead, we suggest that you read about their replacement - [Slack apps](https://api.slack.com/start). Slack apps can be built just for your own workspace or distributed through the App Directory, and they can use the latest and greatest APIs and UI features.
## Current behavior
[Our docs](https://docs.gitlab.com/ee/user/project/integrations/slack.html#configure-slack) currently point the user to the deprecated way of creating webhooks:
> 1. Sign in to your Slack team and start a new Incoming WebHooks configuration.
> 1. Identify the Slack channel where notifications should be sent to by default. Select Add Incoming WebHooks integration to add the configuration.
> 1. Copy the Webhook URL to use later when you configure GitLab.
## Pre-requisites
- [x] Complete https://gitlab.com/gitlab-org/gitlab/-/issues/361732 as this will improve the user experience.
## Initially SaaS-only, self-managed in future
The Slack App is currently only available for SaaS customers. Until https://gitlab.com/groups/gitlab-org/-/epics/1211 is completed to support self-managed customers, this notifications feature will also be SaaS-only.
## Acceptance Criteria
- [ ] The GitLab Slack App must support all event types supported today within the Slack Integration (must have parity).
- [ ] Users should be able to configure each event type to send to different channels.
- [ ] Once the GitLab Slack app is added to a user's workspace, they should be able to go to `Settings` to configure notifications without additional steps.
- [ ] The approach should also allow flexibility to extend functionality for Direct Messages in the future.
## Dependencies
```mermaid
flowchart TB
id1["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/374720'>Record Slack app permission scopes to allow feature checking logic</a>"]
id2["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/372410'>Add notifications to Slack App integration - Part 1</a>"]
id3["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/373321'>Add notifications to Slack App integration - Part 2</a>"]
id4["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/381012'>[Feature flag] Enable Slack notifications in Slack Application integration</a>"]
id8["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/376240'>Warn user conditionally if they need to update their Slack application in order to use new notifications functionality</a>"]
id5["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/376134'>Warn users in UI that Slack notifications will soon be disabled</a>"]
id6["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/382796'>Refactor the architecture of the integration_form component</a>"]
id7["<a href='https://gitlab.com/gitlab-org/gitlab/-/issues/372411'>Deprecate old Slack Notifications integration</a>"]
subgraph Slack integration
id2-->id3
id3-->id4
id1-->id8
id8-->id4
end
subgraph Slack notifications integration
id6-->id5
id5-->id7
end
id4-->id7
```
## Next Steps
- [x] Part I of refactoring to enable Slack app to support notifications, including:
- https://gitlab.com/gitlab-org/gitlab/-/issues/372410+
- https://gitlab.com/gitlab-org/gitlab/-/issues/375345+
- https://gitlab.com/gitlab-org/gitlab/-/issues/375046+
- https://gitlab.com/gitlab-org/gitlab/-/issues/375050+
- https://gitlab.com/gitlab-org/gitlab/-/issues/375054+
- [x] Part II of refactor
- https://gitlab.com/gitlab-org/gitlab/-/issues/373321+
- https://gitlab.com/gitlab-org/gitlab/-/issues/378218+
- https://gitlab.com/gitlab-org/gitlab/-/issues/378219+
- https://gitlab.com/groups/gitlab-org/-/epics/9307+
- [x] UX Improvements
- https://gitlab.com/gitlab-org/gitlab/-/issues/374720+
- https://gitlab.com/gitlab-org/gitlab/-/issues/376240+
- [x] Release Pre-requisites
- https://gitlab.com/gitlab-org/gitlab/-/issues/374139+
- https://gitlab.com/gitlab-org/gitlab/-/issues/381112+
- Update GitLab's Slack Landing - https://about.gitlab.com/solutions/slack/
- [x] %"15.7" - Release Notifications functionality to Slack App
- [ ] Establish Migration workflow for users to migrate from Slack Notifications integration to Slack App
- [ ] Deprecate Slack Notifications
- https://gitlab.com/gitlab-org/gitlab/-/issues/372411+
- https://gitlab.com/gitlab-org/gitlab/-/issues/373762+
- [ ] End-of-life / removal of Slack Notifications integration
<!-- 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 -->
epic