Commit b7729478 authored by Imre Farkas's avatar Imre Farkas

Merge branch '350603-cablett-project-owner-notify' into 'master'

Replace use of project owner in disabled worker notifier

See merge request gitlab-org/gitlab!79078
parents 16f5b43f 2c695c80
......@@ -32,8 +32,12 @@ module AutoDevops
def email_receivers_for(pipeline, project)
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
......@@ -26,7 +26,7 @@ RSpec.describe AutoDevops::DisableWorker, '#perform' do
let(:namespace) { create(:namespace, owner: owner) }
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])
subject.perform(pipeline.id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment