diff options
author | lulalala <mark@goodlife.tw> | 2018-05-09 12:49:33 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-05-17 03:54:51 +0300 |
commit | dc174e9655267e89e1b7c63f8c9f4dac069069c7 (patch) | |
tree | 33cebe2481870434098f88f253090f2de91b873d /app/services/notification_recipient_service.rb | |
parent | 179a1ee7c669e758f8dc9fb5e9c8f2563012a6e1 (diff) |
Notify with email when merge request became unmergeable
Display MR unmergeable reasons
Diffstat (limited to 'app/services/notification_recipient_service.rb')
-rw-r--r-- | app/services/notification_recipient_service.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb index 5658699664d..4fa38665abc 100644 --- a/app/services/notification_recipient_service.rb +++ b/app/services/notification_recipient_service.rb @@ -18,6 +18,10 @@ module NotificationRecipientService Builder::NewNote.new(*a).notification_recipients end + def self.build_merge_request_unmergeable_recipients(*a) + Builder::MergeRequestUnmergeable.new(*a).notification_recipients + end + module Builder class Base def initialize(*) @@ -330,5 +334,26 @@ module NotificationRecipientService note.author end end + + class MergeRequestUnmergeable < Base + attr_reader :target + def initialize(merge_request) + @target = merge_request + end + + def build! + target.merge_participants.each do |user| + add_recipients(user, :participating, nil) + end + end + + def custom_action + :unmergeable_merge_request + end + + def acting_user + nil + end + end end end |