Milestone change emails are not sending
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22279, we added milestone emails. This has been deployed to GitLab.com, but I didn't get an email for the change in https://gitlab.com/gitlab-org/gitlab-ce/issues/50352.
I checked that I was in the recipients list for a milestone change email, and I am:
[ gprd ] production> target = Issue.find(13464034)
=> #<Issue id:13464034 gitlab-org/gitlab-ce#50352>
[ gprd ] production> current_user = User.find_by_username('victorwu')
=> #<User id:711023 @victorwu>
[ gprd ] production> recipient = NotificationRecipientService.build_recipients(target, current_user, action: 'changed_milestone').find { |r| r.user.username == 'smcgivern' }
=> [#<NotificationRecipient:0x00007fe7738a1698 @custom_action=:changed_milestone_issue, @acting_user=#<User id:711023 @victorwu>, @target=#<Issue id:13464034 gitlab-org/gitlab-ce#50352>, @project=#<Project id:13083 gitlab-org/gitlab-ce>, @group=#<Group id:9970 @gitlab-org>, @user=#<User id:443319 @smcgivern>, @type=:participating, @reason=nil, @skip_read_ability=nil, @read_ability=:read_issue, @indexed_group_notification_settings={}, @notification_setting=#<NotificationSetting id: 1157101, user_id: 443319, source_id: nil, source_type: nil, level: 1, created_at: "2016-06-14 05:23:42", updated_at: "2017-07-13 22:11:46", new_note: false, new_issue: true, reopen_issue: false, close_issue: false, reassign_issue: false, new_merge_request: true, reopen_merge_request: false, close_merge_request: false, reassign_merge_request: false, merge_merge_request: false, failed_pipeline: false, success_pipeline: false, push_to_merge_request: nil, issue_due: nil, new_epic: nil>, @notification_level=:participating>]
The method appears to be missing, however: https://gitlab.com/gitlab-org/gitlab-ee/blob/v11.5.0-rc3-ee/app/mailers/emails/issues.rb @SteveAzz any idea what happened there? Will this definitely be in the first RC built after the freeze?
Even if we solve that, I think we have another problem: we can't pass milestone
to the mailer because it has to be delivered later, which means going through Sidekiq. We should pass the milestone ID instead and fetch it on the mailer side (https://github.com/mperham/sidekiq/wiki/Best-Practices#1-make-your-job-parameters-small-and-simple). @crollison could you check that locally and fix it if needed please?