Fix deprecated DeliveryJob message
Notifications generate this deprecation error:
DEPRECATION WARNING: Sending mail with DeliveryJob and
Parameterized::DeliveryJob is deprecated and will be removed in Rails
6.1. Please use MailDeliveryJob instead. (called from new_project_member
at /builds/gitlab-org/gitlab/app/services/notification_service.rb:360)
This was introduced in Rails: https://github.com/rails/rails/pull/34591.
To migrate, we simply need to set the Rails configuration to use
MailDeliveryJob
instead of DeliveryJob
and update the code to reflect
that.
Closes #208305 (closed)
Testing
On an Omnibus instance with a working SMTP server configured, I did the following:
- Made sure notifications were working
- Applied the patch.
- Restarted Puma only.
- Created a new note. Sidekiq logs showed
DeliveryJob
being used, and e-mail was sent. - Restarted Sidekiq.
- Created a new note. Sidekiq logs showed
MailDeliveryJob
being used, and e-mail was sent.
Edited by Stan Hu