{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/comments/205018461","pull_request_review_id":140198737,"id":205018461,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTAxODQ2MQ==","diff_hunk":"@@ -0,0 +1,51 @@\n+import personApi from \"./personApi\";\n+import updateOrgchart from \"./updateOrgchart\";\n+import updateSearch from \"./updateSearch\";\n+\n+import { logger } from \"./config\";\n+\n+class ExternalUpdate {\n+  constructor(cfg) {\n+    this.personApi = personApi(cfg);\n+    this.orgchartService = updateOrgchart(cfg);\n+    this.searchService = updateSearch(cfg);\n+  }\n+\n+  handler() {\n+    return (req, res) => {\n+      ExternalUpdate.getUserId(req.body)\n+        .then(userId => this.getAndDistributeUpdate(userId))\n+        .then(updatedProfile => {\n+          logger.info(\n+            `successfully distributed update for ${updatedProfile.userId}`\n+          );\n+          res.end();\n+        })\n+        .catch(e => {\n+          logger.error(e);\n+          res.status(503);\n+          res.end();\n+        });\n+    };\n+  }\n+\n+  async getAndDistributeUpdate(userId) {\n+    return this.personApi(userId)\n+      .then(updatedProfile => this.searchService(updatedProfile))\n+      .then(updatedProfile => this.orgchartService(updatedProfile));","path":"lib/externalUpdate.js","position":35,"original_position":35,"commit_id":"01390f329b6670353f66a438fc4162722e527711","original_commit_id":"01390f329b6670353f66a438fc4162722e527711","user":{"login":"Gregoor","id":4051932,"node_id":"MDQ6VXNlcjQwNTE5MzI=","avatar_url":"https://avatars1.githubusercontent.com/u/4051932?v=4","gravatar_id":"","url":"https://api.github.com/users/Gregoor","html_url":"https://github.com/Gregoor","followers_url":"https://api.github.com/users/Gregoor/followers","following_url":"https://api.github.com/users/Gregoor/following{/other_user}","gists_url":"https://api.github.com/users/Gregoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Gregoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gregoor/subscriptions","organizations_url":"https://api.github.com/users/Gregoor/orgs","repos_url":"https://api.github.com/users/Gregoor/repos","events_url":"https://api.github.com/users/Gregoor/events{/privacy}","received_events_url":"https://api.github.com/users/Gregoor/received_events","type":"User","site_admin":false},"body":"Are those promises run sequentially because the orgchart should only update if the search update succeeded? Or could they also run in parallel?","created_at":"2018-07-25T08:12:10Z","updated_at":"2018-07-25T08:22:44Z","html_url":"https://github.com/mozilla-iam/dino-park-profile-publisher/pull/1#discussion_r205018461","pull_request_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/comments/205018461"},"html":{"href":"https://github.com/mozilla-iam/dino-park-profile-publisher/pull/1#discussion_r205018461"},"pull_request":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1","id":203498769,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNDk4NzY5","html_url":"https://github.com/mozilla-iam/dino-park-profile-publisher/pull/1","diff_url":"https://github.com/mozilla-iam/dino-park-profile-publisher/pull/1.diff","patch_url":"https://github.com/mozilla-iam/dino-park-profile-publisher/pull/1.patch","issue_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues/1","number":1,"state":"open","locked":false,"title":"First version of the profile publisher.","user":{"login":"fiji-flo","id":3604775,"node_id":"MDQ6VXNlcjM2MDQ3NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/3604775?v=4","gravatar_id":"","url":"https://api.github.com/users/fiji-flo","html_url":"https://github.com/fiji-flo","followers_url":"https://api.github.com/users/fiji-flo/followers","following_url":"https://api.github.com/users/fiji-flo/following{/other_user}","gists_url":"https://api.github.com/users/fiji-flo/gists{/gist_id}","starred_url":"https://api.github.com/users/fiji-flo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiji-flo/subscriptions","organizations_url":"https://api.github.com/users/fiji-flo/orgs","repos_url":"https://api.github.com/users/fiji-flo/repos","events_url":"https://api.github.com/users/fiji-flo/events{/privacy}","received_events_url":"https://api.github.com/users/fiji-flo/received_events","type":"User","site_admin":false},"body":"Squashed and signed.","created_at":"2018-07-24T11:43:46Z","updated_at":"2018-07-25T08:22:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1ff70fc7ea368e8bd2d461116a89a78bf30c1d4","assignee":null,"assignees":[],"requested_reviewers":[{"login":"akatsoulas","id":900565,"node_id":"MDQ6VXNlcjkwMDU2NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/900565?v=4","gravatar_id":"","url":"https://api.github.com/users/akatsoulas","html_url":"https://github.com/akatsoulas","followers_url":"https://api.github.com/users/akatsoulas/followers","following_url":"https://api.github.com/users/akatsoulas/following{/other_user}","gists_url":"https://api.github.com/users/akatsoulas/gists{/gist_id}","starred_url":"https://api.github.com/users/akatsoulas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akatsoulas/subscriptions","organizations_url":"https://api.github.com/users/akatsoulas/orgs","repos_url":"https://api.github.com/users/akatsoulas/repos","events_url":"https://api.github.com/users/akatsoulas/events{/privacy}","received_events_url":"https://api.github.com/users/akatsoulas/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues/1/comments","statuses_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/statuses/01390f329b6670353f66a438fc4162722e527711","head":{"label":"fiji-flo:master","ref":"master","sha":"01390f329b6670353f66a438fc4162722e527711","user":{"login":"fiji-flo","id":3604775,"node_id":"MDQ6VXNlcjM2MDQ3NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/3604775?v=4","gravatar_id":"","url":"https://api.github.com/users/fiji-flo","html_url":"https://github.com/fiji-flo","followers_url":"https://api.github.com/users/fiji-flo/followers","following_url":"https://api.github.com/users/fiji-flo/following{/other_user}","gists_url":"https://api.github.com/users/fiji-flo/gists{/gist_id}","starred_url":"https://api.github.com/users/fiji-flo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiji-flo/subscriptions","organizations_url":"https://api.github.com/users/fiji-flo/orgs","repos_url":"https://api.github.com/users/fiji-flo/repos","events_url":"https://api.github.com/users/fiji-flo/events{/privacy}","received_events_url":"https://api.github.com/users/fiji-flo/received_events","type":"User","site_admin":false},"repo":{"id":141595897,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE1OTU4OTc=","name":"dino-park-profile-publisher","full_name":"fiji-flo/dino-park-profile-publisher","owner":{"login":"fiji-flo","id":3604775,"node_id":"MDQ6VXNlcjM2MDQ3NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/3604775?v=4","gravatar_id":"","url":"https://api.github.com/users/fiji-flo","html_url":"https://github.com/fiji-flo","followers_url":"https://api.github.com/users/fiji-flo/followers","following_url":"https://api.github.com/users/fiji-flo/following{/other_user}","gists_url":"https://api.github.com/users/fiji-flo/gists{/gist_id}","starred_url":"https://api.github.com/users/fiji-flo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiji-flo/subscriptions","organizations_url":"https://api.github.com/users/fiji-flo/orgs","repos_url":"https://api.github.com/users/fiji-flo/repos","events_url":"https://api.github.com/users/fiji-flo/events{/privacy}","received_events_url":"https://api.github.com/users/fiji-flo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fiji-flo/dino-park-profile-publisher","description":null,"fork":true,"url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher","forks_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/forks","keys_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/teams","hooks_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/hooks","issue_events_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/issues/events{/number}","events_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/events","assignees_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/assignees{/user}","branches_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/branches{/branch}","tags_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/tags","blobs_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/languages","stargazers_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/stargazers","contributors_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/contributors","subscribers_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/subscribers","subscription_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/subscription","commits_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/contents/{+path}","compare_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/merges","archive_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/downloads","issues_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/issues{/number}","pulls_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/labels{/name}","releases_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/releases{/id}","deployments_url":"https://api.github.com/repos/fiji-flo/dino-park-profile-publisher/deployments","created_at":"2018-07-19T15:06:45Z","updated_at":"2018-07-24T11:42:38Z","pushed_at":"2018-07-24T11:42:37Z","git_url":"git://github.com/fiji-flo/dino-park-profile-publisher.git","ssh_url":"git@github.com:fiji-flo/dino-park-profile-publisher.git","clone_url":"https://github.com/fiji-flo/dino-park-profile-publisher.git","svn_url":"https://github.com/fiji-flo/dino-park-profile-publisher","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-iam:master","ref":"master","sha":"0221fd0af9f2d47dc653e7a56788146bae942d63","user":{"login":"mozilla-iam","id":22923188,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyOTIzMTg4","avatar_url":"https://avatars1.githubusercontent.com/u/22923188?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-iam","html_url":"https://github.com/mozilla-iam","followers_url":"https://api.github.com/users/mozilla-iam/followers","following_url":"https://api.github.com/users/mozilla-iam/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-iam/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-iam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-iam/subscriptions","organizations_url":"https://api.github.com/users/mozilla-iam/orgs","repos_url":"https://api.github.com/users/mozilla-iam/repos","events_url":"https://api.github.com/users/mozilla-iam/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-iam/received_events","type":"Organization","site_admin":false},"repo":{"id":141308689,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEzMDg2ODk=","name":"dino-park-profile-publisher","full_name":"mozilla-iam/dino-park-profile-publisher","owner":{"login":"mozilla-iam","id":22923188,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyOTIzMTg4","avatar_url":"https://avatars1.githubusercontent.com/u/22923188?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-iam","html_url":"https://github.com/mozilla-iam","followers_url":"https://api.github.com/users/mozilla-iam/followers","following_url":"https://api.github.com/users/mozilla-iam/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-iam/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-iam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-iam/subscriptions","organizations_url":"https://api.github.com/users/mozilla-iam/orgs","repos_url":"https://api.github.com/users/mozilla-iam/repos","events_url":"https://api.github.com/users/mozilla-iam/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-iam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-iam/dino-park-profile-publisher","description":null,"fork":false,"url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher","forks_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/forks","keys_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/teams","hooks_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/hooks","issue_events_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/events","assignees_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/tags","blobs_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/languages","stargazers_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/stargazers","contributors_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/contributors","subscribers_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/subscribers","subscription_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/subscription","commits_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/merges","archive_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/downloads","issues_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/deployments","created_at":"2018-07-17T15:26:54Z","updated_at":"2018-07-23T16:31:53Z","pushed_at":"2018-07-24T15:04:40Z","git_url":"git://github.com/mozilla-iam/dino-park-profile-publisher.git","ssh_url":"git@github.com:mozilla-iam/dino-park-profile-publisher.git","clone_url":"https://github.com/mozilla-iam/dino-park-profile-publisher.git","svn_url":"https://github.com/mozilla-iam/dino-park-profile-publisher","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1"},"html":{"href":"https://github.com/mozilla-iam/dino-park-profile-publisher/pull/1"},"issue":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues/1"},"comments":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-iam/dino-park-profile-publisher/statuses/01390f329b6670353f66a438fc4162722e527711"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Gregoor"}}