BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9c2d4064
Commit
9c2d4064
authored
Sep 14, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pusher support because it's covered by notifications
parent
f049bdeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
20 deletions
+2
-20
pipelines_email_service.rb
app/models/project_services/pipelines_email_service.rb
+2
-12
pipeline_email_service_spec.rb
spec/models/project_services/pipeline_email_service_spec.rb
+0
-8
No files found.
app/models/project_services/pipelines_email_service.rb
View file @
9c2d4064
class
PipelinesEmailService
<
Service
class
PipelinesEmailService
<
Service
prop_accessor
:recipients
prop_accessor
:recipients
boolean_accessor
:add_pusher
boolean_accessor
:notify_only_broken_pipelines
boolean_accessor
:notify_only_broken_pipelines
validates
:recipients
,
validates
:recipients
,
presence:
true
,
presence:
true
,
if:
->
(
s
)
{
s
.
activated?
&&
!
s
.
add_pusher?
}
if:
->
(
s
)
{
s
.
activated?
}
def
initialize_properties
def
initialize_properties
self
.
properties
||=
{
notify_only_broken_pipelines:
true
}
self
.
properties
||=
{
notify_only_broken_pipelines:
true
}
...
@@ -58,9 +57,6 @@ class PipelinesEmailService < Service
...
@@ -58,9 +57,6 @@ class PipelinesEmailService < Service
name:
'recipients'
,
name:
'recipients'
,
placeholder:
'Emails separated by comma'
},
placeholder:
'Emails separated by comma'
},
{
type:
'checkbox'
,
{
type:
'checkbox'
,
name:
'add_pusher'
,
label:
'Add pusher to recipients list'
},
{
type:
'checkbox'
,
name:
'notify_only_broken_pipelines'
},
name:
'notify_only_broken_pipelines'
},
]
]
end
end
...
@@ -85,12 +81,6 @@ class PipelinesEmailService < Service
...
@@ -85,12 +81,6 @@ class PipelinesEmailService < Service
end
end
def
retrieve_recipients
(
data
)
def
retrieve_recipients
(
data
)
all_recipients
=
recipients
.
to_s
.
split
(
','
).
reject
(
&
:blank?
)
recipients
.
to_s
.
split
(
','
).
reject
(
&
:blank?
)
if
add_pusher?
&&
data
[
:user
].
try
(
:[]
,
:email
)
all_recipients
<<
data
[
:user
][
:email
]
end
all_recipients
end
end
end
end
spec/models/project_services/pipeline_email_service_spec.rb
View file @
9c2d4064
...
@@ -23,14 +23,6 @@ describe PipelinesEmailService do
...
@@ -23,14 +23,6 @@ describe PipelinesEmailService do
end
end
it
{
is_expected
.
to
validate_presence_of
(
:recipients
)
}
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
end
context
'when service is inactive'
do
context
'when service is inactive'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment