{"action":"created","comment":{"url":"https://api.github.com/repos/google/startup-os/pulls/comments/218887511","pull_request_review_id":156927174,"id":218887511,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODg4NzUxMQ==","diff_hunk":"@@ -0,0 +1,162 @@\n+/*\n+ * Copyright 2018 The StartupOS Authors.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *    https://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package com.google.startupos.tools.reviewer.job.sync;\n+\n+import com.google.startupos.tools.reviewer.localserver.service.Protos;\n+import org.kohsuke.github.GHIssueComment;\n+import org.kohsuke.github.GHPullRequest;\n+import org.kohsuke.github.GHPullRequestReviewComment;\n+import org.kohsuke.github.GHRepository;\n+import org.kohsuke.github.GitHub;\n+\n+import java.io.IOException;\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.stream.Collectors;\n+\n+public class RecipientGitHubDiff {\n+  private GHPullRequest pullRequest;\n+  private List<GHPullRequestReviewComment> commentList;\n+  private String repoName;\n+\n+  public RecipientGitHubDiff(String repoName, int diffNumber, String login, String password)\n+      throws IOException {\n+    this.repoName = repoName;\n+    GitHub gitHub = GitHub.connectUsingPassword(login, password);\n+    GHRepository repository = gitHub.getRepository(repoName);\n+    pullRequest = repository.getPullRequest(diffNumber);\n+    commentList = pullRequest.listReviewComments().asList();\n+  }\n+\n+  public Protos.Diff getDiff() throws IOException {\n+\n+    Protos.Diff.Builder diff = Protos.Diff.newBuilder();\n+\n+    // diff.setId();\n+    diff.setAuthor(Protos.Author.newBuilder().setEmail(pullRequest.getUser().getEmail()).build());\n+\n+    //    diff.addReviewer(Protos.Reviewer.newBuilder()\n+    //        .setEmail(pullRequest.listReviews().asList().get(1).)\n+    //        .setNeedsAttention()\n+    //        .setApproved()\n+    //        .build());\n+    diff.setDescription(pullRequest.getBody());\n+    //    diff.setBug();","path":"tools/reviewer/job/sync/RecipientGitHubDiff.java","position":58,"original_position":58,"commit_id":"6a04c2812986504dc13064c5138cc65e2ed5f187","original_commit_id":"6a04c2812986504dc13064c5138cc65e2ed5f187","user":{"login":"val-fed","id":24932505,"node_id":"MDQ6VXNlcjI0OTMyNTA1","avatar_url":"https://avatars0.githubusercontent.com/u/24932505?v=4","gravatar_id":"","url":"https://api.github.com/users/val-fed","html_url":"https://github.com/val-fed","followers_url":"https://api.github.com/users/val-fed/followers","following_url":"https://api.github.com/users/val-fed/following{/other_user}","gists_url":"https://api.github.com/users/val-fed/gists{/gist_id}","starred_url":"https://api.github.com/users/val-fed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/val-fed/subscriptions","organizations_url":"https://api.github.com/users/val-fed/orgs","repos_url":"https://api.github.com/users/val-fed/repos","events_url":"https://api.github.com/users/val-fed/events{/privacy}","received_events_url":"https://api.github.com/users/val-fed/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2018-09-19T17:08:34Z","updated_at":"2018-09-19T17:08:34Z","html_url":"https://github.com/google/startup-os/pull/332#discussion_r218887511","pull_request_url":"https://api.github.com/repos/google/startup-os/pulls/332","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/startup-os/pulls/comments/218887511"},"html":{"href":"https://github.com/google/startup-os/pull/332#discussion_r218887511"},"pull_request":{"href":"https://api.github.com/repos/google/startup-os/pulls/332"}},"in_reply_to_id":218733089},"pull_request":{"url":"https://api.github.com/repos/google/startup-os/pulls/332","id":216410976,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NDEwOTc2","html_url":"https://github.com/google/startup-os/pull/332","diff_url":"https://github.com/google/startup-os/pull/332.diff","patch_url":"https://github.com/google/startup-os/pull/332.patch","issue_url":"https://api.github.com/repos/google/startup-os/issues/332","number":332,"state":"open","locked":false,"title":"DRAFT - Get GitHub diff using GitHub API","user":{"login":"val-fed","id":24932505,"node_id":"MDQ6VXNlcjI0OTMyNTA1","avatar_url":"https://avatars0.githubusercontent.com/u/24932505?v=4","gravatar_id":"","url":"https://api.github.com/users/val-fed","html_url":"https://github.com/val-fed","followers_url":"https://api.github.com/users/val-fed/followers","following_url":"https://api.github.com/users/val-fed/following{/other_user}","gists_url":"https://api.github.com/users/val-fed/gists{/gist_id}","starred_url":"https://api.github.com/users/val-fed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/val-fed/subscriptions","organizations_url":"https://api.github.com/users/val-fed/orgs","repos_url":"https://api.github.com/users/val-fed/repos","events_url":"https://api.github.com/users/val-fed/events{/privacy}","received_events_url":"https://api.github.com/users/val-fed/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-18T19:01:49Z","updated_at":"2018-09-19T17:08:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84d366654c5cfe589e9cbe6d4936080297db7e9c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/startup-os/pulls/332/commits","review_comments_url":"https://api.github.com/repos/google/startup-os/pulls/332/comments","review_comment_url":"https://api.github.com/repos/google/startup-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/startup-os/issues/332/comments","statuses_url":"https://api.github.com/repos/google/startup-os/statuses/6a04c2812986504dc13064c5138cc65e2ed5f187","head":{"label":"google:get_github_diff_using_github_api","ref":"get_github_diff_using_github_api","sha":"6a04c2812986504dc13064c5138cc65e2ed5f187","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":122602787,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2MDI3ODc=","name":"startup-os","full_name":"google/startup-os","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/startup-os","description":"Working examples of Google's Open Source stack and deployment to the cloud.","fork":false,"url":"https://api.github.com/repos/google/startup-os","forks_url":"https://api.github.com/repos/google/startup-os/forks","keys_url":"https://api.github.com/repos/google/startup-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/startup-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/startup-os/teams","hooks_url":"https://api.github.com/repos/google/startup-os/hooks","issue_events_url":"https://api.github.com/repos/google/startup-os/issues/events{/number}","events_url":"https://api.github.com/repos/google/startup-os/events","assignees_url":"https://api.github.com/repos/google/startup-os/assignees{/user}","branches_url":"https://api.github.com/repos/google/startup-os/branches{/branch}","tags_url":"https://api.github.com/repos/google/startup-os/tags","blobs_url":"https://api.github.com/repos/google/startup-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/startup-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/startup-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/startup-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/startup-os/statuses/{sha}","languages_url":"https://api.github.com/repos/google/startup-os/languages","stargazers_url":"https://api.github.com/repos/google/startup-os/stargazers","contributors_url":"https://api.github.com/repos/google/startup-os/contributors","subscribers_url":"https://api.github.com/repos/google/startup-os/subscribers","subscription_url":"https://api.github.com/repos/google/startup-os/subscription","commits_url":"https://api.github.com/repos/google/startup-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/startup-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/startup-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/startup-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/startup-os/contents/{+path}","compare_url":"https://api.github.com/repos/google/startup-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/startup-os/merges","archive_url":"https://api.github.com/repos/google/startup-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/startup-os/downloads","issues_url":"https://api.github.com/repos/google/startup-os/issues{/number}","pulls_url":"https://api.github.com/repos/google/startup-os/pulls{/number}","milestones_url":"https://api.github.com/repos/google/startup-os/milestones{/number}","notifications_url":"https://api.github.com/repos/google/startup-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/startup-os/labels{/name}","releases_url":"https://api.github.com/repos/google/startup-os/releases{/id}","deployments_url":"https://api.github.com/repos/google/startup-os/deployments","created_at":"2018-02-23T09:48:29Z","updated_at":"2018-09-19T16:58:40Z","pushed_at":"2018-09-18T20:10:54Z","git_url":"git://github.com/google/startup-os.git","ssh_url":"git@github.com:google/startup-os.git","clone_url":"https://github.com/google/startup-os.git","svn_url":"https://github.com/google/startup-os","homepage":"","size":1770,"stargazers_count":162,"watchers_count":162,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":35,"open_issues":31,"watchers":162,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"5036d0ae30e444cac72aae2949610918f01e157c","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":122602787,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2MDI3ODc=","name":"startup-os","full_name":"google/startup-os","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/startup-os","description":"Working examples of Google's Open Source stack and deployment to the cloud.","fork":false,"url":"https://api.github.com/repos/google/startup-os","forks_url":"https://api.github.com/repos/google/startup-os/forks","keys_url":"https://api.github.com/repos/google/startup-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/startup-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/startup-os/teams","hooks_url":"https://api.github.com/repos/google/startup-os/hooks","issue_events_url":"https://api.github.com/repos/google/startup-os/issues/events{/number}","events_url":"https://api.github.com/repos/google/startup-os/events","assignees_url":"https://api.github.com/repos/google/startup-os/assignees{/user}","branches_url":"https://api.github.com/repos/google/startup-os/branches{/branch}","tags_url":"https://api.github.com/repos/google/startup-os/tags","blobs_url":"https://api.github.com/repos/google/startup-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/startup-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/startup-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/startup-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/startup-os/statuses/{sha}","languages_url":"https://api.github.com/repos/google/startup-os/languages","stargazers_url":"https://api.github.com/repos/google/startup-os/stargazers","contributors_url":"https://api.github.com/repos/google/startup-os/contributors","subscribers_url":"https://api.github.com/repos/google/startup-os/subscribers","subscription_url":"https://api.github.com/repos/google/startup-os/subscription","commits_url":"https://api.github.com/repos/google/startup-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/startup-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/startup-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/startup-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/startup-os/contents/{+path}","compare_url":"https://api.github.com/repos/google/startup-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/startup-os/merges","archive_url":"https://api.github.com/repos/google/startup-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/startup-os/downloads","issues_url":"https://api.github.com/repos/google/startup-os/issues{/number}","pulls_url":"https://api.github.com/repos/google/startup-os/pulls{/number}","milestones_url":"https://api.github.com/repos/google/startup-os/milestones{/number}","notifications_url":"https://api.github.com/repos/google/startup-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/startup-os/labels{/name}","releases_url":"https://api.github.com/repos/google/startup-os/releases{/id}","deployments_url":"https://api.github.com/repos/google/startup-os/deployments","created_at":"2018-02-23T09:48:29Z","updated_at":"2018-09-19T16:58:40Z","pushed_at":"2018-09-18T20:10:54Z","git_url":"git://github.com/google/startup-os.git","ssh_url":"git@github.com:google/startup-os.git","clone_url":"https://github.com/google/startup-os.git","svn_url":"https://github.com/google/startup-os","homepage":"","size":1770,"stargazers_count":162,"watchers_count":162,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":35,"open_issues":31,"watchers":162,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/startup-os/pulls/332"},"html":{"href":"https://github.com/google/startup-os/pull/332"},"issue":{"href":"https://api.github.com/repos/google/startup-os/issues/332"},"comments":{"href":"https://api.github.com/repos/google/startup-os/issues/332/comments"},"review_comments":{"href":"https://api.github.com/repos/google/startup-os/pulls/332/comments"},"review_comment":{"href":"https://api.github.com/repos/google/startup-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/startup-os/pulls/332/commits"},"statuses":{"href":"https://api.github.com/repos/google/startup-os/statuses/6a04c2812986504dc13064c5138cc65e2ed5f187"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"val-fed"}}