Ability to include multiple Mattermost webhooks on a single gitlab CI build pipe
Problem to solve
In the current implementation of GitLab CI, the ability exists to include a webhook to mattermost to notify a users particular channel when certain conditions are met. Although there is no ability to include more than a single Mattermost channel notification. So for example if more than one condition is satisfied, the user will only still get a single Mattermost channel notification
See proposal below...
The enhancement I would be thinking about would include in detail the following scenario: User has 5 jobs in their build pipe. Out of the 5 jobs, 3 of them run nightly during a gitlab CI scheduled run. What this means is upon a PUSH, 2 of the 5 jobs always run. Lets assume those 2 jobs are maven builds. Therefore the user would have a BUILD channel in Mattermost that they have created a webhook against.
Now lets assume the remaining 3 jobs are Sonar scanning, Xray scanning and Fortify scanning. Because these code scans are resource intensive, they are offloaded to a nightly scheduled job run in gitlab CI. Although when these scheduled jobs are triggered, the end result will still notify the one and only gitlab CI Mattermost webhook which exists which is to the BUILD channel, which essentially is not what these jobs are doing.
The ideal solution is the ability to include more than one webhook on a projects integration screen, where the user has the ability to associate a "scheduled" event run with a unique Mattermost webhook. Of course this same functionality can be rolled out on all webhooks as seen fit.
A design consideration would be to leverage the schedule variables that are passed into the scheduled jobs. Perhaps the webhook can be triggered much like the scheduling that IF a particular variable is present, then the logic would execute, otherwise it would be suppressed
(Include use cases, benefits, and/or goals)
What does success look like, and how can we measure that?
Success would be a gitlab CI user has the ability to associate at a minimum, two Mattermost webhooks for a given gitLab CI project. One for typical repository behavior (pushes, commits, adding comments, etc..) and one for scheduled job execution. (If no way to measure success, link to an issue that will implement a way to measure this)