{"action":"opened","number":6890,"pull_request":{"url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6890","id":81548323,"html_url":"https://github.com/DoSomething/phoenix/pull/6890","diff_url":"https://github.com/DoSomething/phoenix/pull/6890.diff","patch_url":"https://github.com/DoSomething/phoenix/pull/6890.patch","issue_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6890","number":6890,"state":"open","locked":false,"title":"Potentially cleaner dedupe and one bugfix","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\nThis is a potentially mistaken optimization and a bug fix.\r\n\r\n💹 __The potentially mistaken optimization:__ I was thinking it might make more sense to use the `PUT /v1/users/drupal_id/:uid` route to make the corresponding change in Northstar each time we update a user in Phoenix. It'd mean we wouldn't have to build up a queue of \"borked\" accounts to delete and re-create.\r\n\r\nThis _should_ be a safe call since each of these scripts should always leave us with valid \"updates\" for Northstar's data (if run in this order `remove-duplicate-emails` → `unset-duplicate-mobiles` → `sanitize-mobile-numbers` → `unset-duplicate-mobiles`).\r\n\r\nAnd the `dosomething_northstar_update_user` method already falls back to using the `POST /v1/users` endpoint if the given Drupal ID returns a 404.\r\n\r\n🐛 __The bug fix:__ the `dosomething_northstar_register_user` was logging an error to Watchdog on successful responses. It should do the _opposite_ of that.\r\n\r\n#### How should this be reviewed?\r\nLet's refresh Thor Phoenix & Thor Northstar from prod, and then try running the modified scripts from this branch. If we're faced with a ton of errors then it's probably not a good improvement. 😇 \r\n\r\n#### Any background context you want to provide?\r\n🌅\r\n\r\n#### Relevant tickets\r\nReferences #6409.\r\n\r\n#### Checklist\r\n- [ ] Documentation added for new features/changed endpoints.\r\n- [ ] Tested on staging.\r\n- [ ] Pinged a PM if this is a larger PR that would benefit from some additional testing love.","created_at":"2016-08-16T21:30:03Z","updated_at":"2016-08-16T21:30:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39f7aa280dca91ab4b2559e42567a797898195a0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6890/commits","review_comments_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6890/comments","review_comment_url":"https://api.github.com/repos/DoSomething/phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6890/comments","statuses_url":"https://api.github.com/repos/DoSomething/phoenix/statuses/ad8b936c4a37b8e8d7761437807a3a9950096279","head":{"label":"DFurnes:potentially-cleaner-dedupe-and-one-bugfix","ref":"potentially-cleaner-dedupe-and-one-bugfix","sha":"ad8b936c4a37b8e8d7761437807a3a9950096279","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"repo":{"id":23975099,"name":"phoenix","full_name":"DFurnes/phoenix","owner":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DFurnes/phoenix","description":"A Drupal 7 distribution that powers the DoSomething.org web platform.","fork":true,"url":"https://api.github.com/repos/DFurnes/phoenix","forks_url":"https://api.github.com/repos/DFurnes/phoenix/forks","keys_url":"https://api.github.com/repos/DFurnes/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DFurnes/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DFurnes/phoenix/teams","hooks_url":"https://api.github.com/repos/DFurnes/phoenix/hooks","issue_events_url":"https://api.github.com/repos/DFurnes/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/DFurnes/phoenix/events","assignees_url":"https://api.github.com/repos/DFurnes/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/DFurnes/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/DFurnes/phoenix/tags","blobs_url":"https://api.github.com/repos/DFurnes/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DFurnes/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DFurnes/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/DFurnes/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DFurnes/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/DFurnes/phoenix/languages","stargazers_url":"https://api.github.com/repos/DFurnes/phoenix/stargazers","contributors_url":"https://api.github.com/repos/DFurnes/phoenix/contributors","subscribers_url":"https://api.github.com/repos/DFurnes/phoenix/subscribers","subscription_url":"https://api.github.com/repos/DFurnes/phoenix/subscription","commits_url":"https://api.github.com/repos/DFurnes/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/DFurnes/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/DFurnes/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/DFurnes/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/DFurnes/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/DFurnes/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DFurnes/phoenix/merges","archive_url":"https://api.github.com/repos/DFurnes/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DFurnes/phoenix/downloads","issues_url":"https://api.github.com/repos/DFurnes/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/DFurnes/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/DFurnes/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/DFurnes/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DFurnes/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/DFurnes/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/DFurnes/phoenix/deployments","created_at":"2014-09-12T20:07:06Z","updated_at":"2016-01-29T19:33:17Z","pushed_at":"2016-08-16T21:10:20Z","git_url":"git://github.com/DFurnes/phoenix.git","ssh_url":"git@github.com:DFurnes/phoenix.git","clone_url":"https://github.com/DFurnes/phoenix.git","svn_url":"https://github.com/DFurnes/phoenix","homepage":"http://www.dosomething.org/","size":19199,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"DoSomething:dev","ref":"dev","sha":"c4627beb7e35385230734c351f28ffe5f8fc5e55","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":13592927,"name":"phoenix","full_name":"DoSomething/phoenix","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/phoenix","description":":fire: The DoSomething.org website & content API.","fork":false,"url":"https://api.github.com/repos/DoSomething/phoenix","forks_url":"https://api.github.com/repos/DoSomething/phoenix/forks","keys_url":"https://api.github.com/repos/DoSomething/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/phoenix/teams","hooks_url":"https://api.github.com/repos/DoSomething/phoenix/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/phoenix/events","assignees_url":"https://api.github.com/repos/DoSomething/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/phoenix/tags","blobs_url":"https://api.github.com/repos/DoSomething/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/phoenix/languages","stargazers_url":"https://api.github.com/repos/DoSomething/phoenix/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/phoenix/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/phoenix/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/phoenix/subscription","commits_url":"https://api.github.com/repos/DoSomething/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/phoenix/merges","archive_url":"https://api.github.com/repos/DoSomething/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/phoenix/downloads","issues_url":"https://api.github.com/repos/DoSomething/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/DoSomething/phoenix/deployments","created_at":"2013-10-15T14:50:48Z","updated_at":"2016-07-06T20:16:27Z","pushed_at":"2016-08-16T21:30:03Z","git_url":"git://github.com/DoSomething/phoenix.git","ssh_url":"git@github.com:DoSomething/phoenix.git","clone_url":"https://github.com/DoSomething/phoenix.git","svn_url":"https://github.com/DoSomething/phoenix","homepage":"http://www.dosomething.org/","size":20424,"stargazers_count":28,"watchers_count":28,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":109,"forks":20,"open_issues":109,"watchers":28,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6890"},"html":{"href":"https://github.com/DoSomething/phoenix/pull/6890"},"issue":{"href":"https://api.github.com/repos/DoSomething/phoenix/issues/6890"},"comments":{"href":"https://api.github.com/repos/DoSomething/phoenix/issues/6890/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6890/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/phoenix/pulls/6890/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/phoenix/statuses/ad8b936c4a37b8e8d7761437807a3a9950096279"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":12,"deletions":17,"changed_files":4}}
{"actor":{"display_login":"DFurnes"}}