diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-01-09 14:15:35 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-01-09 12:52:21 -0500 |
commit | 84df96e4556b85c0ba1445e790f67a70e4a1f57a (patch) | |
tree | 06a0002d72377595667975f3d5d1111f72f3c9ba | |
parent | 76bd8ddd4fa8e10354c70859565c41e382d88cf6 (diff) | |
download | gitlab-ce-84df96e4556b85c0ba1445e790f67a70e4a1f57a.tar.gz |
Merge branch 'remove-successful-pipeline-emails-for-now' into 'master'
Make successful pipeline emails off for watchers
Closes #24845
See merge request !8176
-rw-r--r-- | app/models/notification_setting.rb | 4 | ||||
-rw-r--r-- | app/services/notification_service.rb | 5 | ||||
-rw-r--r-- | changelogs/unreleased/remove-successful-pipeline-emails-for-now.yml | 4 | ||||
-rw-r--r-- | doc/workflow/notifications.md | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb index 43fc218de2b..58f6214bea7 100644 --- a/app/models/notification_setting.rb +++ b/app/models/notification_setting.rb @@ -37,6 +37,10 @@ class NotificationSetting < ActiveRecord::Base :success_pipeline ] + EXCLUDED_WATCHER_EVENTS = [ + :success_pipeline + ] + store :events, accessors: EMAIL_EVENTS, coder: JSON before_create :set_events diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 9a7af5730d2..c3b61e68eab 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -591,7 +591,10 @@ class NotificationService custom_action = build_custom_key(action, target) recipients = target.participants(current_user) - recipients = add_project_watchers(recipients, project) + + unless NotificationSetting::EXCLUDED_WATCHER_EVENTS.include?(custom_action) + recipients = add_project_watchers(recipients, project) + end recipients = add_custom_notifications(recipients, project, custom_action) recipients = reject_mention_users(recipients, project) diff --git a/changelogs/unreleased/remove-successful-pipeline-emails-for-now.yml b/changelogs/unreleased/remove-successful-pipeline-emails-for-now.yml new file mode 100644 index 00000000000..47d484e5c84 --- /dev/null +++ b/changelogs/unreleased/remove-successful-pipeline-emails-for-now.yml @@ -0,0 +1,4 @@ +--- +title: Make successful pipeline emails off for watchers +merge_request: 8176 +author: diff --git a/doc/workflow/notifications.md b/doc/workflow/notifications.md index c936e8833c6..4c52974e103 100644 --- a/doc/workflow/notifications.md +++ b/doc/workflow/notifications.md @@ -73,7 +73,7 @@ In all of the below cases, the notification will be sent to: ...with notification level "Participating" or higher -- Watchers: users with notification level "Watch" +- Watchers: users with notification level "Watch" (however successful pipeline would be off for watchers) - Subscribers: anyone who manually subscribed to the issue/merge request - Custom: Users with notification level "custom" who turned on notifications for any of the events present in the table below |