Skip to content

Fix deprecated DeliveryJob message

Stan Hu requested to merge sh-fix-delivery-job-deprecation into master

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:

  1. Made sure notifications were working
  2. Applied the patch.
  3. Restarted Puma only.
  4. Created a new note. Sidekiq logs showed DeliveryJob being used, and e-mail was sent.
  5. Restarted Sidekiq.
  6. Created a new note. Sidekiq logs showed MailDeliveryJob being used, and e-mail was sent.
Edited by Stan Hu

Merge request reports