Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2c695c80
Commit
2c695c80
authored
Jan 25, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle multiple owners in disabled worker notifier
parent
99be341f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
app/workers/auto_devops/disable_worker.rb
app/workers/auto_devops/disable_worker.rb
+6
-2
spec/workers/auto_devops/disable_worker_spec.rb
spec/workers/auto_devops/disable_worker_spec.rb
+1
-1
No files found.
app/workers/auto_devops/disable_worker.rb
View file @
2c695c80
...
@@ -32,8 +32,12 @@ module AutoDevops
...
@@ -32,8 +32,12 @@ module AutoDevops
def
email_receivers_for
(
pipeline
,
project
)
def
email_receivers_for
(
pipeline
,
project
)
recipients
=
[
pipeline
.
user
&
.
email
]
recipients
=
[
pipeline
.
user
&
.
email
]
recipients
<<
project
.
owner
.
email
unless
project
.
group
recipients
.
uniq
.
compact
if
project
.
personal?
recipients
<<
project
.
owners
.
map
(
&
:email
)
end
recipients
.
flatten
.
uniq
.
compact
end
end
end
end
end
end
spec/workers/auto_devops/disable_worker_spec.rb
View file @
2c695c80
...
@@ -26,7 +26,7 @@ RSpec.describe AutoDevops::DisableWorker, '#perform' do
...
@@ -26,7 +26,7 @@ RSpec.describe AutoDevops::DisableWorker, '#perform' do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
owner
)
}
let
(
:namespace
)
{
create
(
:namespace
,
owner:
owner
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:auto_devops
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
:auto_devops
,
namespace:
namespace
)
}
it
'sends an email to pipeline user and project owner'
do
it
'sends an email to pipeline user and project owner
(s)
'
do
expect
(
NotificationService
).
to
receive_message_chain
(
:new
,
:autodevops_disabled
).
with
(
pipeline
,
[
user
.
email
,
owner
.
email
])
expect
(
NotificationService
).
to
receive_message_chain
(
:new
,
:autodevops_disabled
).
with
(
pipeline
,
[
user
.
email
,
owner
.
email
])
subject
.
perform
(
pipeline
.
id
)
subject
.
perform
(
pipeline
.
id
)
...
...
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