From ad0ed349d702c5c8d70cb0687deb1ef05c75aa9b Mon Sep 17 00:00:00 2001 From: Andrew Heuermann Date: Mon, 16 Jan 2017 19:53:09 -0600 Subject: [PATCH] Trigger build when the target branch is changed for a PR --- .../github/PushAndPullRequestPayload.java | 16 +- .../github/PushAndPullRequestPayloadTest.java | 15 + .../resources/pull_request_edited_body.json | 434 +++++++++++++++++ .../pull_request_edited_branch_change.json | 438 ++++++++++++++++++ 4 files changed, 901 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/pull_request_edited_body.json create mode 100644 src/test/resources/pull_request_edited_branch_change.json diff --git a/src/main/java/com/groupon/jenkins/github/PushAndPullRequestPayload.java b/src/main/java/com/groupon/jenkins/github/PushAndPullRequestPayload.java index 880dca40..e4481b34 100644 --- a/src/main/java/com/groupon/jenkins/github/PushAndPullRequestPayload.java +++ b/src/main/java/com/groupon/jenkins/github/PushAndPullRequestPayload.java @@ -94,10 +94,10 @@ private boolean shouldBuildPullRequest() { shouldBuildPullRequestBasedOnAction(); } - //only build for webhook actions of "opened", "reopened", or "synchronize" + //only build for webhook actions of "opened", "reopened", "synchronize", or "edited" (and branch changed) //https://developer.github.com/v3/activity/events/types/#events-api-payload-17 private boolean shouldBuildPullRequestBasedOnAction() { - return isOpenedAction() || isReOpenedAction() || isSynchronizeAction(); + return isOpenedAction() || isReOpenedAction() || isSynchronizeAction() || isBranchChange(); } private boolean isPullRequestClosed() { @@ -116,6 +116,18 @@ private boolean isSynchronizeAction() { return isPullRequest() && "synchronize".equals(this.payloadJson.getString("action")); } + private boolean isBranchChange() { + if (!isEditedAction()) { + return false; + } + JSONObject changes = this.payloadJson.getJSONObject("changes"); + return !changes.isNullObject() && changes.containsKey("base"); + } + + private boolean isEditedAction() { + return isPullRequest() && "edited".equals(this.payloadJson.getString("action")); + } + public String getPullRequestSourceBranch() { if (!isPullRequest()) { return null; diff --git a/src/test/java/com/groupon/jenkins/github/PushAndPullRequestPayloadTest.java b/src/test/java/com/groupon/jenkins/github/PushAndPullRequestPayloadTest.java index c8e16a71..3d4f62ae 100644 --- a/src/test/java/com/groupon/jenkins/github/PushAndPullRequestPayloadTest.java +++ b/src/test/java/com/groupon/jenkins/github/PushAndPullRequestPayloadTest.java @@ -100,6 +100,21 @@ public void pullRequestSynchronizeShouldTriggerABuild() throws IOException { assertTrue(payload.needsBuild(getProject())); } + @Test + public void pullRequestChangedBranchShouldTriggerABuild() throws IOException { + final String payloadReq = readFile("pull_request_edited_branch_change.json"); + final PushAndPullRequestPayload payload = new PushAndPullRequestPayload(payloadReq); + assertTrue(payload.needsBuild(getProject())); + } + + + @Test + public void pullRequestEditedBodyShouldNotTriggerABuild() throws IOException { + final String payloadReq = readFile("pull_request_edited_body.json"); + final PushAndPullRequestPayload payload = new PushAndPullRequestPayload(payloadReq); + assertFalse(payload.needsBuild(getProject())); + } + private DynamicProject getProject() { return Mockito.mock(DynamicProject.class); } diff --git a/src/test/resources/pull_request_edited_body.json b/src/test/resources/pull_request_edited_body.json new file mode 100644 index 00000000..be446a30 --- /dev/null +++ b/src/test/resources/pull_request_edited_body.json @@ -0,0 +1,434 @@ +{ + "action": "edited", + "number": 262, + "pull_request": { + "url": "https://api.github.com/repos/acme/mycoolproject/pulls/262", + "id": 100037208, + "html_url": "https://github.com/acme/mycoolproject/pull/262", + "diff_url": "https://github.com/acme/mycoolproject/pull/262.diff", + "patch_url": "https://github.com/acme/mycoolproject/pull/262.patch", + "issue_url": "https://api.github.com/repos/acme/mycoolproject/issues/262", + "number": 262, + "state": "open", + "locked": false, + "title": "mycoolproject PR", + "user": { + "login": "abc", + "id": 1296154, + "avatar_url": "https://avatars.githubusercontent.com/u/123456?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/abc", + "html_url": "https://github.com/abc", + "followers_url": "https://api.github.com/users/abc/followers", + "following_url": "https://api.github.com/users/abc/following{/other_user}", + "gists_url": "https://api.github.com/users/abc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/abc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/abc/subscriptions", + "organizations_url": "https://api.github.com/users/abc/orgs", + "repos_url": "https://api.github.com/users/abc/repos", + "events_url": "https://api.github.com/users/abc/events{/privacy}", + "received_events_url": "https://api.github.com/users/abc/received_events", + "type": "User", + "site_admin": false + }, + "body": "My cool PR", + "created_at": "2017-01-03T23:07:30Z", + "updated_at": "2017-01-17T01:39:22Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "898aaab11af353121920d1fabcd72a2debcf4207f", + "milestone": null, + "commits_url": "https://api.github.com/repos/acme/mycoolproject/pulls/262/commits", + "review_comments_url": "https://api.github.com/repos/acme/mycoolproject/pulls/262/comments", + "review_comment_url": "https://api.github.com/repos/acme/mycoolproject/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/issues/262/comments", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/aac02f62bb1560e6fe4fc34eb7ff3d37b539d4bb", + "head": { + "label": "acme:mycoolproject397", + "ref": "mycoolproject397", + "sha": "aac02f62bb1560e6fe4fc34eb7ff3d37b539d4bb", + "user": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 12345, + "name": "mycoolproject", + "full_name": "acme/mycoolproject", + "owner": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/acme/mycoolproject", + "description": "Description", + "fork": false, + "url": "https://api.github.com/repos/acme/mycoolproject", + "forks_url": "https://api.github.com/repos/acme/mycoolproject/forks", + "keys_url": "https://api.github.com/repos/acme/mycoolproject/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/acme/mycoolproject/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/acme/mycoolproject/teams", + "hooks_url": "https://api.github.com/repos/acme/mycoolproject/hooks", + "issue_events_url": "https://api.github.com/repos/acme/mycoolproject/issues/events{/number}", + "events_url": "https://api.github.com/repos/acme/mycoolproject/events", + "assignees_url": "https://api.github.com/repos/acme/mycoolproject/assignees{/user}", + "branches_url": "https://api.github.com/repos/acme/mycoolproject/branches{/branch}", + "tags_url": "https://api.github.com/repos/acme/mycoolproject/tags", + "blobs_url": "https://api.github.com/repos/acme/mycoolproject/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/acme/mycoolproject/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/acme/mycoolproject/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/acme/mycoolproject/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/{sha}", + "languages_url": "https://api.github.com/repos/acme/mycoolproject/languages", + "stargazers_url": "https://api.github.com/repos/acme/mycoolproject/stargazers", + "contributors_url": "https://api.github.com/repos/acme/mycoolproject/contributors", + "subscribers_url": "https://api.github.com/repos/acme/mycoolproject/subscribers", + "subscription_url": "https://api.github.com/repos/acme/mycoolproject/subscription", + "commits_url": "https://api.github.com/repos/acme/mycoolproject/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/acme/mycoolproject/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/acme/mycoolproject/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/acme/mycoolproject/contents/{+path}", + "compare_url": "https://api.github.com/repos/acme/mycoolproject/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/acme/mycoolproject/merges", + "archive_url": "https://api.github.com/repos/acme/mycoolproject/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/acme/mycoolproject/downloads", + "issues_url": "https://api.github.com/repos/acme/mycoolproject/issues{/number}", + "pulls_url": "https://api.github.com/repos/acme/mycoolproject/pulls{/number}", + "milestones_url": "https://api.github.com/repos/acme/mycoolproject/milestones{/number}", + "notifications_url": "https://api.github.com/repos/acme/mycoolproject/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/acme/mycoolproject/labels{/name}", + "releases_url": "https://api.github.com/repos/acme/mycoolproject/releases{/id}", + "deployments_url": "https://api.github.com/repos/acme/mycoolproject/deployments", + "created_at": "2015-07-15T06:38:02Z", + "updated_at": "2016-01-13T22:18:10Z", + "pushed_at": "2017-01-16T23:11:52Z", + "git_url": "git://github.com/acme/mycoolproject.git", + "ssh_url": "git@github.com:acme/mycoolproject.git", + "clone_url": "https://github.com/acme/mycoolproject.git", + "svn_url": "https://github.com/acme/mycoolproject", + "homepage": null, + "size": 3801, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Scala", + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 5, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "acme:master", + "ref": "master", + "sha": "2babc00f3a44de7c856fcbdc5839cb0fd7a58f95", + "user": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 123456, + "name": "mycoolproject", + "full_name": "acme/mycoolproject", + "owner": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/acme/mycoolproject", + "description": "Description", + "fork": false, + "url": "https://api.github.com/repos/acme/mycoolproject", + "forks_url": "https://api.github.com/repos/acme/mycoolproject/forks", + "keys_url": "https://api.github.com/repos/acme/mycoolproject/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/acme/mycoolproject/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/acme/mycoolproject/teams", + "hooks_url": "https://api.github.com/repos/acme/mycoolproject/hooks", + "issue_events_url": "https://api.github.com/repos/acme/mycoolproject/issues/events{/number}", + "events_url": "https://api.github.com/repos/acme/mycoolproject/events", + "assignees_url": "https://api.github.com/repos/acme/mycoolproject/assignees{/user}", + "branches_url": "https://api.github.com/repos/acme/mycoolproject/branches{/branch}", + "tags_url": "https://api.github.com/repos/acme/mycoolproject/tags", + "blobs_url": "https://api.github.com/repos/acme/mycoolproject/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/acme/mycoolproject/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/acme/mycoolproject/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/acme/mycoolproject/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/{sha}", + "languages_url": "https://api.github.com/repos/acme/mycoolproject/languages", + "stargazers_url": "https://api.github.com/repos/acme/mycoolproject/stargazers", + "contributors_url": "https://api.github.com/repos/acme/mycoolproject/contributors", + "subscribers_url": "https://api.github.com/repos/acme/mycoolproject/subscribers", + "subscription_url": "https://api.github.com/repos/acme/mycoolproject/subscription", + "commits_url": "https://api.github.com/repos/acme/mycoolproject/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/acme/mycoolproject/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/acme/mycoolproject/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/acme/mycoolproject/contents/{+path}", + "compare_url": "https://api.github.com/repos/acme/mycoolproject/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/acme/mycoolproject/merges", + "archive_url": "https://api.github.com/repos/acme/mycoolproject/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/acme/mycoolproject/downloads", + "issues_url": "https://api.github.com/repos/acme/mycoolproject/issues{/number}", + "pulls_url": "https://api.github.com/repos/acme/mycoolproject/pulls{/number}", + "milestones_url": "https://api.github.com/repos/acme/mycoolproject/milestones{/number}", + "notifications_url": "https://api.github.com/repos/acme/mycoolproject/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/acme/mycoolproject/labels{/name}", + "releases_url": "https://api.github.com/repos/acme/mycoolproject/releases{/id}", + "deployments_url": "https://api.github.com/repos/acme/mycoolproject/deployments", + "created_at": "2015-07-15T06:38:02Z", + "updated_at": "2016-01-13T22:18:10Z", + "pushed_at": "2017-01-16T23:11:52Z", + "git_url": "git://github.com/acme/mycoolproject.git", + "ssh_url": "git@github.com:acme/mycoolproject.git", + "clone_url": "https://github.com/acme/mycoolproject.git", + "svn_url": "https://github.com/acme/mycoolproject", + "homepage": null, + "size": 3801, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Scala", + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 5, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/262" + }, + "html": { + "href": "https://github.com/acme/mycoolproject/pull/262" + }, + "issue": { + "href": "https://api.github.com/repos/acme/mycoolproject/issues/262" + }, + "comments": { + "href": "https://api.github.com/repos/acme/mycoolproject/issues/262/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/262/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/262/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/acme/mycoolproject/statuses/aac02f62bb1560e6fe4fc34eb7ff3d37b539d4ab" + } + }, + "merged": false, + "mergeable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 1, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 33, + "additions": 1720, + "deletions": 711, + "changed_files": 61 + }, + "changes": { + "body": { + "from": "Blah", + "to": "Blah Blah" + } + }, + "repository": { + "id": 123456, + "name": "mycoolproject", + "full_name": "acme/mycoolproject", + "owner": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/acme/mycoolproject", + "description": "Description", + "fork": false, + "url": "https://api.github.com/repos/acme/mycoolproject", + "forks_url": "https://api.github.com/repos/acme/mycoolproject/forks", + "keys_url": "https://api.github.com/repos/acme/mycoolproject/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/acme/mycoolproject/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/acme/mycoolproject/teams", + "hooks_url": "https://api.github.com/repos/acme/mycoolproject/hooks", + "issue_events_url": "https://api.github.com/repos/acme/mycoolproject/issues/events{/number}", + "events_url": "https://api.github.com/repos/acme/mycoolproject/events", + "assignees_url": "https://api.github.com/repos/acme/mycoolproject/assignees{/user}", + "branches_url": "https://api.github.com/repos/acme/mycoolproject/branches{/branch}", + "tags_url": "https://api.github.com/repos/acme/mycoolproject/tags", + "blobs_url": "https://api.github.com/repos/acme/mycoolproject/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/acme/mycoolproject/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/acme/mycoolproject/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/acme/mycoolproject/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/{sha}", + "languages_url": "https://api.github.com/repos/acme/mycoolproject/languages", + "stargazers_url": "https://api.github.com/repos/acme/mycoolproject/stargazers", + "contributors_url": "https://api.github.com/repos/acme/mycoolproject/contributors", + "subscribers_url": "https://api.github.com/repos/acme/mycoolproject/subscribers", + "subscription_url": "https://api.github.com/repos/acme/mycoolproject/subscription", + "commits_url": "https://api.github.com/repos/acme/mycoolproject/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/acme/mycoolproject/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/acme/mycoolproject/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/acme/mycoolproject/contents/{+path}", + "compare_url": "https://api.github.com/repos/acme/mycoolproject/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/acme/mycoolproject/merges", + "archive_url": "https://api.github.com/repos/acme/mycoolproject/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/acme/mycoolproject/downloads", + "issues_url": "https://api.github.com/repos/acme/mycoolproject/issues{/number}", + "pulls_url": "https://api.github.com/repos/acme/mycoolproject/pulls{/number}", + "milestones_url": "https://api.github.com/repos/acme/mycoolproject/milestones{/number}", + "notifications_url": "https://api.github.com/repos/acme/mycoolproject/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/acme/mycoolproject/labels{/name}", + "releases_url": "https://api.github.com/repos/acme/mycoolproject/releases{/id}", + "deployments_url": "https://api.github.com/repos/acme/mycoolproject/deployments", + "created_at": "2015-07-15T06:38:02Z", + "updated_at": "2016-01-13T22:18:10Z", + "pushed_at": "2017-01-16T23:11:52Z", + "git_url": "git://github.com/acme/mycoolproject.git", + "ssh_url": "git@github.com:acme/mycoolproject.git", + "clone_url": "https://github.com/acme/mycoolproject.git", + "svn_url": "https://github.com/acme/mycoolproject", + "homepage": null, + "size": 3801, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Scala", + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 5, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master" + }, + "organization": { + "login": "acme", + "id": 12345, + "url": "https://api.github.com/orgs/acme", + "repos_url": "https://api.github.com/orgs/acme/repos", + "events_url": "https://api.github.com/orgs/acme/events", + "hooks_url": "https://api.github.com/orgs/acme/hooks", + "issues_url": "https://api.github.com/orgs/acme/issues", + "members_url": "https://api.github.com/orgs/acme/members{/member}", + "public_members_url": "https://api.github.com/orgs/acme/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "description": "" + }, + "sender": { + "login": "abc", + "id": 1234567, + "avatar_url": "https://avatars.githubusercontent.com/u/1234567?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/abc", + "html_url": "https://github.com/abc", + "followers_url": "https://api.github.com/users/abc/followers", + "following_url": "https://api.github.com/users/abc/following{/other_user}", + "gists_url": "https://api.github.com/users/abc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/abc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/abc/subscriptions", + "organizations_url": "https://api.github.com/users/abc/orgs", + "repos_url": "https://api.github.com/users/abc/repos", + "events_url": "https://api.github.com/users/abc/events{/privacy}", + "received_events_url": "https://api.github.com/users/abc/received_events", + "type": "User", + "site_admin": false + } +} diff --git a/src/test/resources/pull_request_edited_branch_change.json b/src/test/resources/pull_request_edited_branch_change.json new file mode 100644 index 00000000..67855448 --- /dev/null +++ b/src/test/resources/pull_request_edited_branch_change.json @@ -0,0 +1,438 @@ +{ + "action": "edited", + "number": 262, + "pull_request": { + "url": "https://api.github.com/repos/acme/mycoolproject/pulls/262", + "id": 100037208, + "html_url": "https://github.com/acme/mycoolproject/pull/262", + "diff_url": "https://github.com/acme/mycoolproject/pull/262.diff", + "patch_url": "https://github.com/acme/mycoolproject/pull/262.patch", + "issue_url": "https://api.github.com/repos/acme/mycoolproject/issues/262", + "number": 262, + "state": "open", + "locked": false, + "title": "mycoolproject PR", + "user": { + "login": "abc", + "id": 1296154, + "avatar_url": "https://avatars.githubusercontent.com/u/123456?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/abc", + "html_url": "https://github.com/abc", + "followers_url": "https://api.github.com/users/abc/followers", + "following_url": "https://api.github.com/users/abc/following{/other_user}", + "gists_url": "https://api.github.com/users/abc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/abc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/abc/subscriptions", + "organizations_url": "https://api.github.com/users/abc/orgs", + "repos_url": "https://api.github.com/users/abc/repos", + "events_url": "https://api.github.com/users/abc/events{/privacy}", + "received_events_url": "https://api.github.com/users/abc/received_events", + "type": "User", + "site_admin": false + }, + "body": "My cool PR", + "created_at": "2017-01-03T23:07:30Z", + "updated_at": "2017-01-17T01:39:22Z", + "closed_at": null, + "merged_at": null, + "merge_commit_sha": "898aaab11af353121920d1fabcd72a2debcf4207f", + "milestone": null, + "commits_url": "https://api.github.com/repos/acme/mycoolproject/pulls/262/commits", + "review_comments_url": "https://api.github.com/repos/acme/mycoolproject/pulls/262/comments", + "review_comment_url": "https://api.github.com/repos/acme/mycoolproject/pulls/comments{/number}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/issues/262/comments", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/aac02f62bb1560e6fe4fc34eb7ff3d37b539d4bb", + "head": { + "label": "acme:mycoolproject397", + "ref": "mycoolproject397", + "sha": "aac02f62bb1560e6fe4fc34eb7ff3d37b539d4bb", + "user": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 12345, + "name": "mycoolproject", + "full_name": "acme/mycoolproject", + "owner": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/acme/mycoolproject", + "description": "Description", + "fork": false, + "url": "https://api.github.com/repos/acme/mycoolproject", + "forks_url": "https://api.github.com/repos/acme/mycoolproject/forks", + "keys_url": "https://api.github.com/repos/acme/mycoolproject/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/acme/mycoolproject/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/acme/mycoolproject/teams", + "hooks_url": "https://api.github.com/repos/acme/mycoolproject/hooks", + "issue_events_url": "https://api.github.com/repos/acme/mycoolproject/issues/events{/number}", + "events_url": "https://api.github.com/repos/acme/mycoolproject/events", + "assignees_url": "https://api.github.com/repos/acme/mycoolproject/assignees{/user}", + "branches_url": "https://api.github.com/repos/acme/mycoolproject/branches{/branch}", + "tags_url": "https://api.github.com/repos/acme/mycoolproject/tags", + "blobs_url": "https://api.github.com/repos/acme/mycoolproject/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/acme/mycoolproject/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/acme/mycoolproject/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/acme/mycoolproject/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/{sha}", + "languages_url": "https://api.github.com/repos/acme/mycoolproject/languages", + "stargazers_url": "https://api.github.com/repos/acme/mycoolproject/stargazers", + "contributors_url": "https://api.github.com/repos/acme/mycoolproject/contributors", + "subscribers_url": "https://api.github.com/repos/acme/mycoolproject/subscribers", + "subscription_url": "https://api.github.com/repos/acme/mycoolproject/subscription", + "commits_url": "https://api.github.com/repos/acme/mycoolproject/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/acme/mycoolproject/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/acme/mycoolproject/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/acme/mycoolproject/contents/{+path}", + "compare_url": "https://api.github.com/repos/acme/mycoolproject/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/acme/mycoolproject/merges", + "archive_url": "https://api.github.com/repos/acme/mycoolproject/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/acme/mycoolproject/downloads", + "issues_url": "https://api.github.com/repos/acme/mycoolproject/issues{/number}", + "pulls_url": "https://api.github.com/repos/acme/mycoolproject/pulls{/number}", + "milestones_url": "https://api.github.com/repos/acme/mycoolproject/milestones{/number}", + "notifications_url": "https://api.github.com/repos/acme/mycoolproject/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/acme/mycoolproject/labels{/name}", + "releases_url": "https://api.github.com/repos/acme/mycoolproject/releases{/id}", + "deployments_url": "https://api.github.com/repos/acme/mycoolproject/deployments", + "created_at": "2015-07-15T06:38:02Z", + "updated_at": "2016-01-13T22:18:10Z", + "pushed_at": "2017-01-16T23:11:52Z", + "git_url": "git://github.com/acme/mycoolproject.git", + "ssh_url": "git@github.com:acme/mycoolproject.git", + "clone_url": "https://github.com/acme/mycoolproject.git", + "svn_url": "https://github.com/acme/mycoolproject", + "homepage": null, + "size": 3801, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Scala", + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 5, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master" + } + }, + "base": { + "label": "acme:master", + "ref": "master", + "sha": "2babc00f3a44de7c856fcbdc5839cb0fd7a58f95", + "user": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "repo": { + "id": 123456, + "name": "mycoolproject", + "full_name": "acme/mycoolproject", + "owner": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/acme/mycoolproject", + "description": "Description", + "fork": false, + "url": "https://api.github.com/repos/acme/mycoolproject", + "forks_url": "https://api.github.com/repos/acme/mycoolproject/forks", + "keys_url": "https://api.github.com/repos/acme/mycoolproject/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/acme/mycoolproject/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/acme/mycoolproject/teams", + "hooks_url": "https://api.github.com/repos/acme/mycoolproject/hooks", + "issue_events_url": "https://api.github.com/repos/acme/mycoolproject/issues/events{/number}", + "events_url": "https://api.github.com/repos/acme/mycoolproject/events", + "assignees_url": "https://api.github.com/repos/acme/mycoolproject/assignees{/user}", + "branches_url": "https://api.github.com/repos/acme/mycoolproject/branches{/branch}", + "tags_url": "https://api.github.com/repos/acme/mycoolproject/tags", + "blobs_url": "https://api.github.com/repos/acme/mycoolproject/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/acme/mycoolproject/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/acme/mycoolproject/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/acme/mycoolproject/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/{sha}", + "languages_url": "https://api.github.com/repos/acme/mycoolproject/languages", + "stargazers_url": "https://api.github.com/repos/acme/mycoolproject/stargazers", + "contributors_url": "https://api.github.com/repos/acme/mycoolproject/contributors", + "subscribers_url": "https://api.github.com/repos/acme/mycoolproject/subscribers", + "subscription_url": "https://api.github.com/repos/acme/mycoolproject/subscription", + "commits_url": "https://api.github.com/repos/acme/mycoolproject/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/acme/mycoolproject/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/acme/mycoolproject/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/acme/mycoolproject/contents/{+path}", + "compare_url": "https://api.github.com/repos/acme/mycoolproject/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/acme/mycoolproject/merges", + "archive_url": "https://api.github.com/repos/acme/mycoolproject/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/acme/mycoolproject/downloads", + "issues_url": "https://api.github.com/repos/acme/mycoolproject/issues{/number}", + "pulls_url": "https://api.github.com/repos/acme/mycoolproject/pulls{/number}", + "milestones_url": "https://api.github.com/repos/acme/mycoolproject/milestones{/number}", + "notifications_url": "https://api.github.com/repos/acme/mycoolproject/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/acme/mycoolproject/labels{/name}", + "releases_url": "https://api.github.com/repos/acme/mycoolproject/releases{/id}", + "deployments_url": "https://api.github.com/repos/acme/mycoolproject/deployments", + "created_at": "2015-07-15T06:38:02Z", + "updated_at": "2016-01-13T22:18:10Z", + "pushed_at": "2017-01-16T23:11:52Z", + "git_url": "git://github.com/acme/mycoolproject.git", + "ssh_url": "git@github.com:acme/mycoolproject.git", + "clone_url": "https://github.com/acme/mycoolproject.git", + "svn_url": "https://github.com/acme/mycoolproject", + "homepage": null, + "size": 3801, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Scala", + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 5, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master" + } + }, + "_links": { + "self": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/262" + }, + "html": { + "href": "https://github.com/acme/mycoolproject/pull/262" + }, + "issue": { + "href": "https://api.github.com/repos/acme/mycoolproject/issues/262" + }, + "comments": { + "href": "https://api.github.com/repos/acme/mycoolproject/issues/262/comments" + }, + "review_comments": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/262/comments" + }, + "review_comment": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/comments{/number}" + }, + "commits": { + "href": "https://api.github.com/repos/acme/mycoolproject/pulls/262/commits" + }, + "statuses": { + "href": "https://api.github.com/repos/acme/mycoolproject/statuses/aac02f62bb1560e6fe4fc34eb7ff3d37b539d4ab" + } + }, + "merged": false, + "mergeable": null, + "mergeable_state": "unknown", + "merged_by": null, + "comments": 1, + "review_comments": 0, + "maintainer_can_modify": false, + "commits": 33, + "additions": 1720, + "deletions": 711, + "changed_files": 61 + }, + "changes": { + "base": { + "ref": { + "from": "master" + }, + "sha": { + "from": "3babc00f3a44de7c856fcbdc5839cb0fd7a58f92" + } + } + }, + "repository": { + "id": 123456, + "name": "mycoolproject", + "full_name": "acme/mycoolproject", + "owner": { + "login": "acme", + "id": 12345, + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/acme", + "html_url": "https://github.com/acme", + "followers_url": "https://api.github.com/users/acme/followers", + "following_url": "https://api.github.com/users/acme/following{/other_user}", + "gists_url": "https://api.github.com/users/acme/gists{/gist_id}", + "starred_url": "https://api.github.com/users/acme/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/acme/subscriptions", + "organizations_url": "https://api.github.com/users/acme/orgs", + "repos_url": "https://api.github.com/users/acme/repos", + "events_url": "https://api.github.com/users/acme/events{/privacy}", + "received_events_url": "https://api.github.com/users/acme/received_events", + "type": "Organization", + "site_admin": false + }, + "private": true, + "html_url": "https://github.com/acme/mycoolproject", + "description": "Description", + "fork": false, + "url": "https://api.github.com/repos/acme/mycoolproject", + "forks_url": "https://api.github.com/repos/acme/mycoolproject/forks", + "keys_url": "https://api.github.com/repos/acme/mycoolproject/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/acme/mycoolproject/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/acme/mycoolproject/teams", + "hooks_url": "https://api.github.com/repos/acme/mycoolproject/hooks", + "issue_events_url": "https://api.github.com/repos/acme/mycoolproject/issues/events{/number}", + "events_url": "https://api.github.com/repos/acme/mycoolproject/events", + "assignees_url": "https://api.github.com/repos/acme/mycoolproject/assignees{/user}", + "branches_url": "https://api.github.com/repos/acme/mycoolproject/branches{/branch}", + "tags_url": "https://api.github.com/repos/acme/mycoolproject/tags", + "blobs_url": "https://api.github.com/repos/acme/mycoolproject/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/acme/mycoolproject/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/acme/mycoolproject/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/acme/mycoolproject/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/acme/mycoolproject/statuses/{sha}", + "languages_url": "https://api.github.com/repos/acme/mycoolproject/languages", + "stargazers_url": "https://api.github.com/repos/acme/mycoolproject/stargazers", + "contributors_url": "https://api.github.com/repos/acme/mycoolproject/contributors", + "subscribers_url": "https://api.github.com/repos/acme/mycoolproject/subscribers", + "subscription_url": "https://api.github.com/repos/acme/mycoolproject/subscription", + "commits_url": "https://api.github.com/repos/acme/mycoolproject/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/acme/mycoolproject/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/acme/mycoolproject/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/acme/mycoolproject/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/acme/mycoolproject/contents/{+path}", + "compare_url": "https://api.github.com/repos/acme/mycoolproject/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/acme/mycoolproject/merges", + "archive_url": "https://api.github.com/repos/acme/mycoolproject/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/acme/mycoolproject/downloads", + "issues_url": "https://api.github.com/repos/acme/mycoolproject/issues{/number}", + "pulls_url": "https://api.github.com/repos/acme/mycoolproject/pulls{/number}", + "milestones_url": "https://api.github.com/repos/acme/mycoolproject/milestones{/number}", + "notifications_url": "https://api.github.com/repos/acme/mycoolproject/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/acme/mycoolproject/labels{/name}", + "releases_url": "https://api.github.com/repos/acme/mycoolproject/releases{/id}", + "deployments_url": "https://api.github.com/repos/acme/mycoolproject/deployments", + "created_at": "2015-07-15T06:38:02Z", + "updated_at": "2016-01-13T22:18:10Z", + "pushed_at": "2017-01-16T23:11:52Z", + "git_url": "git://github.com/acme/mycoolproject.git", + "ssh_url": "git@github.com:acme/mycoolproject.git", + "clone_url": "https://github.com/acme/mycoolproject.git", + "svn_url": "https://github.com/acme/mycoolproject", + "homepage": null, + "size": 3801, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Scala", + "has_issues": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "open_issues_count": 5, + "forks": 0, + "open_issues": 5, + "watchers": 0, + "default_branch": "master" + }, + "organization": { + "login": "acme", + "id": 12345, + "url": "https://api.github.com/orgs/acme", + "repos_url": "https://api.github.com/orgs/acme/repos", + "events_url": "https://api.github.com/orgs/acme/events", + "hooks_url": "https://api.github.com/orgs/acme/hooks", + "issues_url": "https://api.github.com/orgs/acme/issues", + "members_url": "https://api.github.com/orgs/acme/members{/member}", + "public_members_url": "https://api.github.com/orgs/acme/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/12345?v=3", + "description": "" + }, + "sender": { + "login": "abc", + "id": 1234567, + "avatar_url": "https://avatars.githubusercontent.com/u/1234567?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/abc", + "html_url": "https://github.com/abc", + "followers_url": "https://api.github.com/users/abc/followers", + "following_url": "https://api.github.com/users/abc/following{/other_user}", + "gists_url": "https://api.github.com/users/abc/gists{/gist_id}", + "starred_url": "https://api.github.com/users/abc/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/abc/subscriptions", + "organizations_url": "https://api.github.com/users/abc/orgs", + "repos_url": "https://api.github.com/users/abc/repos", + "events_url": "https://api.github.com/users/abc/events{/privacy}", + "received_events_url": "https://api.github.com/users/abc/received_events", + "type": "User", + "site_admin": false + } +}