From 9c2d40649e0792652c3d41d3c19f2e45c0db5b03 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Wed, 14 Sep 2016 21:43:52 +0800
Subject: [PATCH] Remove pusher support because it's covered by notifications

---
 .../project_services/pipelines_email_service.rb    | 14 ++------------
 .../pipeline_email_service_spec.rb                 |  8 --------
 2 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/app/models/project_services/pipelines_email_service.rb b/app/models/project_services/pipelines_email_service.rb
index ec3c1bc85ee..b4e36a7c3de 100644
--- a/app/models/project_services/pipelines_email_service.rb
+++ b/app/models/project_services/pipelines_email_service.rb
@@ -1,10 +1,9 @@
 class PipelinesEmailService < Service
   prop_accessor :recipients
-  boolean_accessor :add_pusher
   boolean_accessor :notify_only_broken_pipelines
   validates :recipients,
     presence: true,
-    if: ->(s) { s.activated? && !s.add_pusher? }
+    if: ->(s) { s.activated? }
 
   def initialize_properties
     self.properties ||= { notify_only_broken_pipelines: true }
@@ -57,9 +56,6 @@ class PipelinesEmailService < Service
       { type: 'textarea',
         name: 'recipients',
         placeholder: 'Emails separated by comma' },
-      { type: 'checkbox',
-        name: 'add_pusher',
-        label: 'Add pusher to recipients list' },
       { type: 'checkbox',
         name: 'notify_only_broken_pipelines' },
     ]
@@ -85,12 +81,6 @@ class PipelinesEmailService < Service
   end
 
   def retrieve_recipients(data)
-    all_recipients = recipients.to_s.split(',').reject(&:blank?)
-
-    if add_pusher? && data[:user].try(:[], :email)
-      all_recipients << data[:user][:email]
-    end
-
-    all_recipients
+    recipients.to_s.split(',').reject(&:blank?)
   end
 end
diff --git a/spec/models/project_services/pipeline_email_service_spec.rb b/spec/models/project_services/pipeline_email_service_spec.rb
index 1368a2925e8..68a96b9251f 100644
--- a/spec/models/project_services/pipeline_email_service_spec.rb
+++ b/spec/models/project_services/pipeline_email_service_spec.rb
@@ -23,14 +23,6 @@ describe PipelinesEmailService do
       end
 
       it { is_expected.to validate_presence_of(:recipients) }
-
-      context 'when pusher is added' do
-        before do
-          subject.add_pusher = true
-        end
-
-        it { is_expected.not_to validate_presence_of(:recipients) }
-      end
     end
 
     context 'when service is inactive' do
-- 
GitLab