{"action":"closed","number":765,"pull_request":{"url":"https://api.github.com/repos/alphagov/notifications-api/pulls/765","id":97335002,"html_url":"https://github.com/alphagov/notifications-api/pull/765","diff_url":"https://github.com/alphagov/notifications-api/pull/765.diff","patch_url":"https://github.com/alphagov/notifications-api/pull/765.patch","issue_url":"https://api.github.com/repos/alphagov/notifications-api/issues/765","number":765,"state":"closed","locked":false,"title":"Send Notify's 2FA codes via only one queue","user":{"login":"jennyd","id":1822424,"avatar_url":"https://avatars.githubusercontent.com/u/1822424?v=3","gravatar_id":"","url":"https://api.github.com/users/jennyd","html_url":"https://github.com/jennyd","followers_url":"https://api.github.com/users/jennyd/followers","following_url":"https://api.github.com/users/jennyd/following{/other_user}","gists_url":"https://api.github.com/users/jennyd/gists{/gist_id}","starred_url":"https://api.github.com/users/jennyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennyd/subscriptions","organizations_url":"https://api.github.com/users/jennyd/orgs","repos_url":"https://api.github.com/users/jennyd/repos","events_url":"https://api.github.com/users/jennyd/events{/privacy}","received_events_url":"https://api.github.com/users/jennyd/received_events","type":"User","site_admin":false},"body":"At the moment Notify's 2FA codes and internal emails go first to a `notify` queue, but then are put on the shared `send-sms/email` queues along with all other notifications, and they can take some time to arrive if big jobs are being processed.\r\n\r\nThis change means that these codes won't be delayed by large jobs going through the `send-sms/email` queues. `send_user_sms_code` now works much more like the endpoints for sending notifications, by persisting the notification and only using the `deliver_sms` task (instead of using `send_sms` as well).\r\n\r\nThe workers consuming the `notify` queue should be able to handle the deliver task as well, so no change should be needed to the celery workers to support this.\r\n\r\nI think there's also a change in behaviour here: previously, if the Notify service was in research mode, 2FA codes would not have been sent out, making it impossible to log into the admin. Now, a call to this endpoint will always send out the notification even if we've put the Notify service into research mode, since we set the notification's key type to `normal` and ignore the service's research mode setting when sending the notification to the queue.\r\n\r\nI'm opening this now to get feedback on the approach so far for this one endpoint. If people are happy with this I'd aim to carry on to do similar things to the rest of the API endpoints which use notifications internally:\r\n\r\n- [ ] `send_user_confirm_new_email`\r\n- [ ] `send_user_email_verification`\r\n- [ ] `send_already_registered_email`\r\n- [ ] `send_user_reset_password`\r\n- [ ] `create_invited_user`","created_at":"2016-12-09T16:09:23Z","updated_at":"2016-12-12T15:16:59Z","closed_at":"2016-12-12T15:16:59Z","merged_at":"2016-12-12T15:16:59Z","merge_commit_sha":"33e74a6b072cdae9b40c51ec18101bc5f264d3dc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/765/commits","review_comments_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/765/comments","review_comment_url":"https://api.github.com/repos/alphagov/notifications-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/notifications-api/issues/765/comments","statuses_url":"https://api.github.com/repos/alphagov/notifications-api/statuses/7332874415245be45828325059089cefa1c5513d","head":{"label":"alphagov:use-notify-queue-to-deliver","ref":"use-notify-queue-to-deliver","sha":"7332874415245be45828325059089cefa1c5513d","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46422101,"name":"notifications-api","full_name":"alphagov/notifications-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/notifications-api","description":"Notifications api","fork":false,"url":"https://api.github.com/repos/alphagov/notifications-api","forks_url":"https://api.github.com/repos/alphagov/notifications-api/forks","keys_url":"https://api.github.com/repos/alphagov/notifications-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/notifications-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/notifications-api/teams","hooks_url":"https://api.github.com/repos/alphagov/notifications-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/notifications-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/notifications-api/events","assignees_url":"https://api.github.com/repos/alphagov/notifications-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/notifications-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/notifications-api/tags","blobs_url":"https://api.github.com/repos/alphagov/notifications-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/notifications-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/notifications-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/notifications-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/notifications-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/notifications-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/notifications-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/notifications-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/notifications-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/notifications-api/subscription","commits_url":"https://api.github.com/repos/alphagov/notifications-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/notifications-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/notifications-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/notifications-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/notifications-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/notifications-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/notifications-api/merges","archive_url":"https://api.github.com/repos/alphagov/notifications-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/notifications-api/downloads","issues_url":"https://api.github.com/repos/alphagov/notifications-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/notifications-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/notifications-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/notifications-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/notifications-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/notifications-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/notifications-api/deployments","created_at":"2015-11-18T13:57:17Z","updated_at":"2016-11-06T22:04:31Z","pushed_at":"2016-12-12T15:16:59Z","git_url":"git://github.com/alphagov/notifications-api.git","ssh_url":"git@github.com:alphagov/notifications-api.git","clone_url":"https://github.com/alphagov/notifications-api.git","svn_url":"https://github.com/alphagov/notifications-api","homepage":null,"size":12664,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"32a21bfd3a5f10922d1c07c86b37994c75b9cf62","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":46422101,"name":"notifications-api","full_name":"alphagov/notifications-api","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/notifications-api","description":"Notifications api","fork":false,"url":"https://api.github.com/repos/alphagov/notifications-api","forks_url":"https://api.github.com/repos/alphagov/notifications-api/forks","keys_url":"https://api.github.com/repos/alphagov/notifications-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/notifications-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/notifications-api/teams","hooks_url":"https://api.github.com/repos/alphagov/notifications-api/hooks","issue_events_url":"https://api.github.com/repos/alphagov/notifications-api/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/notifications-api/events","assignees_url":"https://api.github.com/repos/alphagov/notifications-api/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/notifications-api/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/notifications-api/tags","blobs_url":"https://api.github.com/repos/alphagov/notifications-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/notifications-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/notifications-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/notifications-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/notifications-api/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/notifications-api/languages","stargazers_url":"https://api.github.com/repos/alphagov/notifications-api/stargazers","contributors_url":"https://api.github.com/repos/alphagov/notifications-api/contributors","subscribers_url":"https://api.github.com/repos/alphagov/notifications-api/subscribers","subscription_url":"https://api.github.com/repos/alphagov/notifications-api/subscription","commits_url":"https://api.github.com/repos/alphagov/notifications-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/notifications-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/notifications-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/notifications-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/notifications-api/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/notifications-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/notifications-api/merges","archive_url":"https://api.github.com/repos/alphagov/notifications-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/notifications-api/downloads","issues_url":"https://api.github.com/repos/alphagov/notifications-api/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/notifications-api/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/notifications-api/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/notifications-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/notifications-api/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/notifications-api/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/notifications-api/deployments","created_at":"2015-11-18T13:57:17Z","updated_at":"2016-11-06T22:04:31Z","pushed_at":"2016-12-12T15:16:59Z","git_url":"git://github.com/alphagov/notifications-api.git","ssh_url":"git@github.com:alphagov/notifications-api.git","clone_url":"https://github.com/alphagov/notifications-api.git","svn_url":"https://github.com/alphagov/notifications-api","homepage":null,"size":12664,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/765"},"html":{"href":"https://github.com/alphagov/notifications-api/pull/765"},"issue":{"href":"https://api.github.com/repos/alphagov/notifications-api/issues/765"},"comments":{"href":"https://api.github.com/repos/alphagov/notifications-api/issues/765/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/765/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/notifications-api/pulls/765/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/notifications-api/statuses/7332874415245be45828325059089cefa1c5513d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"jennyd","id":1822424,"avatar_url":"https://avatars.githubusercontent.com/u/1822424?v=3","gravatar_id":"","url":"https://api.github.com/users/jennyd","html_url":"https://github.com/jennyd","followers_url":"https://api.github.com/users/jennyd/followers","following_url":"https://api.github.com/users/jennyd/following{/other_user}","gists_url":"https://api.github.com/users/jennyd/gists{/gist_id}","starred_url":"https://api.github.com/users/jennyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennyd/subscriptions","organizations_url":"https://api.github.com/users/jennyd/orgs","repos_url":"https://api.github.com/users/jennyd/repos","events_url":"https://api.github.com/users/jennyd/events{/privacy}","received_events_url":"https://api.github.com/users/jennyd/received_events","type":"User","site_admin":false},"comments":1,"review_comments":8,"commits":3,"additions":95,"deletions":76,"changed_files":4}}
{"actor":{"display_login":"jennyd"}}