From 84741bfda27206b1e2d4c7f78ff52965bc6bc68b Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Wed, 4 Apr 2018 15:59:31 -0400 Subject: [PATCH 1/3] Add installation ID field to `IssuesEvent` --- spec/DecodeEventsSpec.hs | 1 + src/GitHub/Data/Webhooks/Events.hs | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/spec/DecodeEventsSpec.hs b/spec/DecodeEventsSpec.hs index 153c95f..2b5a6b8 100644 --- a/spec/DecodeEventsSpec.hs +++ b/spec/DecodeEventsSpec.hs @@ -1541,6 +1541,7 @@ issuesEventFixture = IssuesEvent , whUserType = OwnerUser , whUserIsAdminOfSite = False } + , evIssuesEventInstallationId = Nothing } labelEventFixture :: LabelEvent diff --git a/src/GitHub/Data/Webhooks/Events.hs b/src/GitHub/Data/Webhooks/Events.hs index 8eed147..646a464 100644 --- a/src/GitHub/Data/Webhooks/Events.hs +++ b/src/GitHub/Data/Webhooks/Events.hs @@ -2,6 +2,7 @@ module GitHub.Data.Webhooks.Events ( EventHasSender(..) , EventHasRepo(..) + , EventHasInstallationId(..) -- , CommitCommentEvent(..) , CommitCommentEventAction(..) @@ -114,6 +115,10 @@ class EventHasRepo eventKind where -- | Provides the repository context of a Webhook event. repoForEvent :: eventKind -> HookRepository +class EventHasInstallationId eventKind where + -- | Provides ID of GitHub app instance associated with the event + appIdForEvent :: eventKind -> Maybe Int + data CommitCommentEventAction -- | Decodes from "created" @@ -411,15 +416,18 @@ instance FromJSON IssuesEventAction where -- unlabeled, opened, edited, milestoned, demilestoned, closed, or reopened. -- See . data IssuesEvent = IssuesEvent - { evIssuesEventAction :: !IssuesEventAction - , evIssuesEventIssue :: !HookIssue - , evIssuesEventRepo :: !HookRepository - , evIssuesEventSender :: !HookUser + { evIssuesEventAction :: !IssuesEventAction + , evIssuesEventIssue :: !HookIssue + , evIssuesEventRepo :: !HookRepository + , evIssuesEventSender :: !HookUser + -- | Installation ID is present if webhook was registered by a Github app + , evIssuesEventInstallationId :: !(Maybe Int) } deriving (Eq, Show, Typeable, Data, Generic) instance EventHasSender IssuesEvent where senderOfEvent = evIssuesEventSender instance EventHasRepo IssuesEvent where repoForEvent = evIssuesEventRepo +instance EventHasInstallationId IssuesEvent where appIdForEvent = evIssuesEventInstallationId instance NFData IssuesEvent where rnf = genericRnf @@ -859,6 +867,8 @@ data PullRequestEvent = PullRequestEvent instance EventHasSender PullRequestEvent where senderOfEvent = evPullReqSender instance EventHasRepo PullRequestEvent where repoForEvent = evPullReqRepo +instance EventHasInstallationId PullRequestEvent where + appIdForEvent = Just . evPullReqInstallationId instance NFData PullRequestEvent where rnf = genericRnf @@ -1259,6 +1269,7 @@ instance FromJSON IssuesEvent where <*> o .: "issue" <*> o .: "repository" <*> o .: "sender" + <*> (o .:? "installation" >>= maybe (return Nothing) (\i -> Just <$> i .: "id")) instance FromJSON LabelEvent where parseJSON = withObject "LabelEvent" $ \o -> LabelEvent From b86eb6f79e2f715be4763be0a169cee29c92662f Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Fri, 6 Apr 2018 16:24:38 -0400 Subject: [PATCH 2/3] Rename `appIdForEvent` to `installationIdForEvent` --- src/GitHub/Data/Webhooks/Events.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/GitHub/Data/Webhooks/Events.hs b/src/GitHub/Data/Webhooks/Events.hs index 646a464..403a954 100644 --- a/src/GitHub/Data/Webhooks/Events.hs +++ b/src/GitHub/Data/Webhooks/Events.hs @@ -117,7 +117,7 @@ class EventHasRepo eventKind where class EventHasInstallationId eventKind where -- | Provides ID of GitHub app instance associated with the event - appIdForEvent :: eventKind -> Maybe Int + installationIdForEvent :: eventKind -> Maybe Int data CommitCommentEventAction @@ -427,7 +427,8 @@ data IssuesEvent = IssuesEvent instance EventHasSender IssuesEvent where senderOfEvent = evIssuesEventSender instance EventHasRepo IssuesEvent where repoForEvent = evIssuesEventRepo -instance EventHasInstallationId IssuesEvent where appIdForEvent = evIssuesEventInstallationId +instance EventHasInstallationId IssuesEvent where + installationIdForEvent = evIssuesEventInstallationId instance NFData IssuesEvent where rnf = genericRnf @@ -868,7 +869,7 @@ data PullRequestEvent = PullRequestEvent instance EventHasSender PullRequestEvent where senderOfEvent = evPullReqSender instance EventHasRepo PullRequestEvent where repoForEvent = evPullReqRepo instance EventHasInstallationId PullRequestEvent where - appIdForEvent = Just . evPullReqInstallationId + installationIdForEvent = Just . evPullReqInstallationId instance NFData PullRequestEvent where rnf = genericRnf From 749b5aef9a34c116b36cb9d42c66f66f706c632b Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 12 Apr 2018 11:40:18 -0400 Subject: [PATCH 3/3] Read "head" and "base" properties from pull request event payload --- spec/DecodeEventsSpec.hs | 670 ++++++++++++++++++++++++++++ src/GitHub/Data/Webhooks/Payload.hs | 30 +- 2 files changed, 698 insertions(+), 2 deletions(-) diff --git a/spec/DecodeEventsSpec.hs b/spec/DecodeEventsSpec.hs index 2b5a6b8..08de4bc 100644 --- a/spec/DecodeEventsSpec.hs +++ b/spec/DecodeEventsSpec.hs @@ -2921,6 +2921,230 @@ pullRequestEventFixture = PullRequestEvent , whPullReqRevCommentUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments{/number}" , whPullReqCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" , whPullReqStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + , whPullReqBase = + HookTree + { whTreeLabel = "baxterthehacker:master" + , whTreeRef = "master" + , whTreeSha = "9049f1265b7d61be4a8904a9a27120d2064dab3b" + , whTreeUser = + HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whTreeRepo = + HookRepository + { whRepoId = 35129377 + , whRepoName = "public-repo" + , whRepoFullName = "baxterthehacker/public-repo" + , whRepoOwner = + Right HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whRepoIsPrivate = False + , whRepoHtmlUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoDescription = "" + , whRepoIsAFork = False + , whRepoUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo" + , whRepoForksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/forks" + , whRepoKeysUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}" + , whRepoCollaboratorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}" + , whRepoTeamsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/teams" + , whRepoHooksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/hooks" + , whRepoIssueEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}" + , whRepoEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/events" + , whRepoAssigneesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}" + , whRepoBranchesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}" + , whRepoTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/tags" + , whRepoBlobsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}" + , whRepoGitTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}" + , whRepoGitRefsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}" + , whRepoTreesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}" + , whRepoStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}" + , whRepoLanguagesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/languages" + , whRepoStargazersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/stargazers" + , whRepoContributorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contributors" + , whRepoSubscribersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscribers" + , whRepoSubscriptionUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscription" + , whRepoCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}" + , whRepoGitCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}" + , whRepoCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}" + , whRepoIssueCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}" + , whRepoContentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}" + , whRepoCompareUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}" + , whRepoMergesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/merges" + , whRepoArchiveUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}" + , whRepoDownloadsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/downloads" + , whRepoIssuesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}" + , whRepoPullsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}" + , whRepoMilestonesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}" + , whRepoNotificationsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}" + , whRepoLabelsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}" + , whRepoReleasesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}" + , whRepoCreatedAt = read "2015-05-05 23:40:12" + , whRepoUpdatedAt = read "2015-05-05 23:40:12" + , whRepoPushedAt = read "2015-05-05 23:40:26" + , whRepoGitUrl = URL "git://github.com/baxterthehacker/public-repo.git" + , whRepoSshUrl = URL "git@github.com:baxterthehacker/public-repo.git" + , whRepoCloneUrl = URL "https://github.com/baxterthehacker/public-repo.git" + , whRepoSvnUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoHomepage = Nothing + , whRepoSize = 0 + , whRepoStargazersCount = 0 + , whRepoWatchersCount = 0 + , whRepoLanguage = Nothing + , whRepoHasIssues = True + , whRepoHasDownloads = True + , whRepoHasWiki = True + , whRepoHasPages = True + , whRepoForkCount = 0 + , whRepoMirrorUrl = Nothing + , whRepoOpenIssuesCount = 1 + , whRepoDefaultBranchName = "master" + } + } + , whPullReqHead = + HookTree + { whTreeLabel = "baxterthehacker:changes" + , whTreeRef = "changes" + , whTreeSha = "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + , whTreeUser = + HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whTreeRepo = + HookRepository + { whRepoId = 35129377 + , whRepoName = "public-repo" + , whRepoFullName = "baxterthehacker/public-repo" + , whRepoOwner = + Right HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whRepoIsPrivate = False + , whRepoHtmlUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoDescription = "" + , whRepoIsAFork = False + , whRepoUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo" + , whRepoForksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/forks" + , whRepoKeysUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}" + , whRepoCollaboratorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}" + , whRepoTeamsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/teams" + , whRepoHooksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/hooks" + , whRepoIssueEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}" + , whRepoEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/events" + , whRepoAssigneesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}" + , whRepoBranchesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}" + , whRepoTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/tags" + , whRepoBlobsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}" + , whRepoGitTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}" + , whRepoGitRefsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}" + , whRepoTreesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}" + , whRepoStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}" + , whRepoLanguagesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/languages" + , whRepoStargazersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/stargazers" + , whRepoContributorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contributors" + , whRepoSubscribersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscribers" + , whRepoSubscriptionUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscription" + , whRepoCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}" + , whRepoGitCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}" + , whRepoCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}" + , whRepoIssueCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}" + , whRepoContentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}" + , whRepoCompareUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}" + , whRepoMergesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/merges" + , whRepoArchiveUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}" + , whRepoDownloadsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/downloads" + , whRepoIssuesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}" + , whRepoPullsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}" + , whRepoMilestonesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}" + , whRepoNotificationsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}" + , whRepoLabelsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}" + , whRepoReleasesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}" + , whRepoCreatedAt = read "2015-05-05 23:40:12" + , whRepoUpdatedAt = read "2015-05-05 23:40:12" + , whRepoPushedAt = read "2015-05-05 23:40:26" + , whRepoGitUrl = URL "git://github.com/baxterthehacker/public-repo.git" + , whRepoSshUrl = URL "git@github.com:baxterthehacker/public-repo.git" + , whRepoCloneUrl = URL "https://github.com/baxterthehacker/public-repo.git" + , whRepoSvnUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoHomepage = Nothing + , whRepoSize = 0 + , whRepoStargazersCount = 0 + , whRepoWatchersCount = 0 + , whRepoLanguage = Nothing + , whRepoHasIssues = True + , whRepoHasDownloads = True + , whRepoHasWiki = True + , whRepoHasPages = True + , whRepoForkCount = 0 + , whRepoMirrorUrl = Nothing + , whRepoOpenIssuesCount = 1 + , whRepoDefaultBranchName = "master" + } + } , whPullReqCommentCount = Just 0 , whPullReqRevCommentCount = Just 0 , whPullReqCommitCount = Just 1 @@ -3122,6 +3346,230 @@ pullRequestReviewCommentEventFixture = PullRequestReviewCommentEvent , whPullReqCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/1/comments" , whPullReqStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + , whPullReqBase = + HookTree + { whTreeLabel = "baxterthehacker:master" + , whTreeRef = "master" + , whTreeSha = "9049f1265b7d61be4a8904a9a27120d2064dab3b" + , whTreeUser = + HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whTreeRepo = + HookRepository + { whRepoId = 35129377 + , whRepoName = "public-repo" + , whRepoFullName = "baxterthehacker/public-repo" + , whRepoOwner = + Right HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whRepoIsPrivate = False + , whRepoHtmlUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoDescription = "" + , whRepoIsAFork = False + , whRepoUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo" + , whRepoForksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/forks" + , whRepoKeysUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}" + , whRepoCollaboratorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}" + , whRepoTeamsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/teams" + , whRepoHooksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/hooks" + , whRepoIssueEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}" + , whRepoEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/events" + , whRepoAssigneesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}" + , whRepoBranchesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}" + , whRepoTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/tags" + , whRepoBlobsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}" + , whRepoGitTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}" + , whRepoGitRefsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}" + , whRepoTreesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}" + , whRepoStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}" + , whRepoLanguagesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/languages" + , whRepoStargazersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/stargazers" + , whRepoContributorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contributors" + , whRepoSubscribersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscribers" + , whRepoSubscriptionUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscription" + , whRepoCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}" + , whRepoGitCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}" + , whRepoCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}" + , whRepoIssueCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}" + , whRepoContentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}" + , whRepoCompareUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}" + , whRepoMergesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/merges" + , whRepoArchiveUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}" + , whRepoDownloadsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/downloads" + , whRepoIssuesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}" + , whRepoPullsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}" + , whRepoMilestonesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}" + , whRepoNotificationsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}" + , whRepoLabelsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}" + , whRepoReleasesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}" + , whRepoCreatedAt = read "2015-05-05 23:40:12" + , whRepoUpdatedAt = read "2015-05-05 23:40:12" + , whRepoPushedAt = read "2015-05-05 23:40:27" + , whRepoGitUrl = URL "git://github.com/baxterthehacker/public-repo.git" + , whRepoSshUrl = URL "git@github.com:baxterthehacker/public-repo.git" + , whRepoCloneUrl = URL "https://github.com/baxterthehacker/public-repo.git" + , whRepoSvnUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoHomepage = Nothing + , whRepoSize = 0 + , whRepoStargazersCount = 0 + , whRepoWatchersCount = 0 + , whRepoLanguage = Nothing + , whRepoHasIssues = True + , whRepoHasDownloads = True + , whRepoHasWiki = True + , whRepoHasPages = True + , whRepoForkCount = 0 + , whRepoMirrorUrl = Nothing + , whRepoOpenIssuesCount = 1 + , whRepoDefaultBranchName = "master" + } + } + , whPullReqHead = + HookTree + { whTreeLabel = "baxterthehacker:changes" + , whTreeRef = "changes" + , whTreeSha = "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c" + , whTreeUser = + HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whTreeRepo = + HookRepository + { whRepoId = 35129377 + , whRepoName = "public-repo" + , whRepoFullName = "baxterthehacker/public-repo" + , whRepoOwner = + Right HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whRepoIsPrivate = False + , whRepoHtmlUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoDescription = "" + , whRepoIsAFork = False + , whRepoUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo" + , whRepoForksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/forks" + , whRepoKeysUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}" + , whRepoCollaboratorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}" + , whRepoTeamsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/teams" + , whRepoHooksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/hooks" + , whRepoIssueEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}" + , whRepoEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/events" + , whRepoAssigneesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}" + , whRepoBranchesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}" + , whRepoTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/tags" + , whRepoBlobsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}" + , whRepoGitTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}" + , whRepoGitRefsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}" + , whRepoTreesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}" + , whRepoStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}" + , whRepoLanguagesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/languages" + , whRepoStargazersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/stargazers" + , whRepoContributorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contributors" + , whRepoSubscribersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscribers" + , whRepoSubscriptionUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscription" + , whRepoCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}" + , whRepoGitCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}" + , whRepoCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}" + , whRepoIssueCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}" + , whRepoContentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}" + , whRepoCompareUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}" + , whRepoMergesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/merges" + , whRepoArchiveUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}" + , whRepoDownloadsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/downloads" + , whRepoIssuesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}" + , whRepoPullsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}" + , whRepoMilestonesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}" + , whRepoNotificationsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}" + , whRepoLabelsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}" + , whRepoReleasesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}" + , whRepoCreatedAt = read "2015-05-05 23:40:12" + , whRepoUpdatedAt = read "2015-05-05 23:40:12" + , whRepoPushedAt = read "2015-05-05 23:40:27" + , whRepoGitUrl = URL "git://github.com/baxterthehacker/public-repo.git" + , whRepoSshUrl = URL "git@github.com:baxterthehacker/public-repo.git" + , whRepoCloneUrl = URL "https://github.com/baxterthehacker/public-repo.git" + , whRepoSvnUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoHomepage = Nothing + , whRepoSize = 0 + , whRepoStargazersCount = 0 + , whRepoWatchersCount = 0 + , whRepoLanguage = Nothing + , whRepoHasIssues = True + , whRepoHasDownloads = True + , whRepoHasWiki = True + , whRepoHasPages = True + , whRepoForkCount = 0 + , whRepoMirrorUrl = Nothing + , whRepoOpenIssuesCount = 1 + , whRepoDefaultBranchName = "master" + } + } , whPullReqCommentCount = Nothing , whPullReqRevCommentCount = Nothing , whPullReqCommitCount = Nothing @@ -3315,6 +3763,228 @@ pullRequestReviewEventFixture = PullRequestReviewEvent , whPullReqCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/8/comments" , whPullReqStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/b7a1f9c27caa4e03c14a88feb56e2d4f7500aa63" + , whPullReqBase = + HookTree + { whTreeLabel = "baxterthehacker:master" + , whTreeRef = "master" + , whTreeSha = "9049f1265b7d61be4a8904a9a27120d2064dab3b" + , whTreeUser = + HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whTreeRepo = + HookRepository + { whRepoId = 35129377 + , whRepoName = "public-repo" + , whRepoFullName = "baxterthehacker/public-repo" + , whRepoOwner = + Right HookUser + { whUserLogin = "baxterthehacker" + , whUserId = 6752317 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/baxterthehacker" + , whUserHtmlUrl = URL "https://github.com/baxterthehacker" + , whUserFollowersUrl = URL "https://api.github.com/users/baxterthehacker/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/baxterthehacker/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/baxterthehacker/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/baxterthehacker/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/baxterthehacker/orgs" + , whUserReposUrl = URL "https://api.github.com/users/baxterthehacker/repos" + , whUserEventsUrl = URL "https://api.github.com/users/baxterthehacker/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/baxterthehacker/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = False + } + , whRepoIsPrivate = False + , whRepoHtmlUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoDescription = "" + , whRepoIsAFork = False + , whRepoUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo" + , whRepoForksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/forks" + , whRepoKeysUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}" + , whRepoCollaboratorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}" + , whRepoTeamsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/teams" + , whRepoHooksUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/hooks" + , whRepoIssueEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}" + , whRepoEventsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/events" + , whRepoAssigneesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}" + , whRepoBranchesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}" + , whRepoTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/tags" + , whRepoBlobsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}" + , whRepoGitTagsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}" + , whRepoGitRefsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}" + , whRepoTreesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}" + , whRepoStatusesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}" + , whRepoLanguagesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/languages" + , whRepoStargazersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/stargazers" + , whRepoContributorsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contributors" + , whRepoSubscribersUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscribers" + , whRepoSubscriptionUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/subscription" + , whRepoCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}" + , whRepoGitCommitsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}" + , whRepoCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}" + , whRepoIssueCommentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}" + , whRepoContentsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}" + , whRepoCompareUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}" + , whRepoMergesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/merges" + , whRepoArchiveUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}" + , whRepoDownloadsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/downloads" + , whRepoIssuesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}" + , whRepoPullsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}" + , whRepoMilestonesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}" + , whRepoNotificationsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}" + , whRepoLabelsUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}" + , whRepoReleasesUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}" + , whRepoCreatedAt = read "2015-05-05 23:40:12" + , whRepoUpdatedAt = read "2016-08-15 17:19:01" + , whRepoPushedAt = read "2016-10-03 23:37:43" + , whRepoGitUrl = URL "git://github.com/baxterthehacker/public-repo.git" + , whRepoSshUrl = URL "git@github.com:baxterthehacker/public-repo.git" + , whRepoCloneUrl = URL "https://github.com/baxterthehacker/public-repo.git" + , whRepoSvnUrl = URL "https://github.com/baxterthehacker/public-repo" + , whRepoHomepage = Nothing + , whRepoSize = 233 + , whRepoStargazersCount = 2 + , whRepoWatchersCount = 2 + , whRepoLanguage = Nothing + , whRepoHasIssues = True + , whRepoHasDownloads = True + , whRepoHasWiki = True + , whRepoHasPages = True + , whRepoForkCount = 2 + , whRepoMirrorUrl = Nothing + , whRepoOpenIssuesCount = 5 + , whRepoDefaultBranchName = "master" + } + } + , whPullReqHead = + HookTree + { whTreeLabel = "skalnik:patch-2" + , whTreeRef = "patch-2" + , whTreeSha = "b7a1f9c27caa4e03c14a88feb56e2d4f7500aa63" + , whTreeUser = + HookUser + { whUserLogin = "skalnik" + , whUserId = 2546 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/2546?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/skalnik" + , whUserHtmlUrl = URL "https://github.com/skalnik" + , whUserFollowersUrl = URL "https://api.github.com/users/skalnik/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/skalnik/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/skalnik/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/skalnik/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/skalnik/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/skalnik/orgs" + , whUserReposUrl = URL "https://api.github.com/users/skalnik/repos" + , whUserEventsUrl = URL "https://api.github.com/users/skalnik/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/skalnik/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = True + } + , whTreeRepo = + HookRepository + { whRepoId = 69919152 + , whRepoName = "public-repo" + , whRepoFullName = "skalnik/public-repo" + , whRepoOwner = Right HookUser {whUserLogin = "skalnik" + , whUserId = 2546 + , whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/2546?v=3" + , whUserGravatarId = URL "" + , whUserUrl = URL "https://api.github.com/users/skalnik" + , whUserHtmlUrl = URL "https://github.com/skalnik" + , whUserFollowersUrl = URL "https://api.github.com/users/skalnik/followers" + , whUserFollowingUrl = URL "https://api.github.com/users/skalnik/following{/other_user}" + , whUserGistsUrl = URL "https://api.github.com/users/skalnik/gists{/gist_id}" + , whUserStarredUrl = URL "https://api.github.com/users/skalnik/starred{/owner}{/repo}" + , whUserSubscriptionsUrl = URL "https://api.github.com/users/skalnik/subscriptions" + , whUserOrganizationsUrl = URL "https://api.github.com/users/skalnik/orgs" + , whUserReposUrl = URL "https://api.github.com/users/skalnik/repos" + , whUserEventsUrl = URL "https://api.github.com/users/skalnik/events{/privacy}" + , whUserReceivedEventsUrl = URL "https://api.github.com/users/skalnik/received_events" + , whUserType = OwnerUser + , whUserIsAdminOfSite = True + } + , whRepoIsPrivate = False + , whRepoHtmlUrl = URL "https://github.com/skalnik/public-repo" + , whRepoDescription = "" + , whRepoIsAFork = True + , whRepoUrl = URL "https://api.github.com/repos/skalnik/public-repo" + , whRepoForksUrl = URL "https://api.github.com/repos/skalnik/public-repo/forks" + , whRepoKeysUrl = URL "https://api.github.com/repos/skalnik/public-repo/keys{/key_id}" + , whRepoCollaboratorsUrl = URL "https://api.github.com/repos/skalnik/public-repo/collaborators{/collaborator}" + , whRepoTeamsUrl = URL "https://api.github.com/repos/skalnik/public-repo/teams" + , whRepoHooksUrl = URL "https://api.github.com/repos/skalnik/public-repo/hooks" + , whRepoIssueEventsUrl = URL "https://api.github.com/repos/skalnik/public-repo/issues/events{/number}" + , whRepoEventsUrl = URL "https://api.github.com/repos/skalnik/public-repo/events" + , whRepoAssigneesUrl = URL "https://api.github.com/repos/skalnik/public-repo/assignees{/user}" + , whRepoBranchesUrl = URL "https://api.github.com/repos/skalnik/public-repo/branches{/branch}" + , whRepoTagsUrl = URL "https://api.github.com/repos/skalnik/public-repo/tags" + , whRepoBlobsUrl = URL "https://api.github.com/repos/skalnik/public-repo/git/blobs{/sha}" + , whRepoGitTagsUrl = URL "https://api.github.com/repos/skalnik/public-repo/git/tags{/sha}" + , whRepoGitRefsUrl = URL "https://api.github.com/repos/skalnik/public-repo/git/refs{/sha}" + , whRepoTreesUrl = URL "https://api.github.com/repos/skalnik/public-repo/git/trees{/sha}" + , whRepoStatusesUrl = URL "https://api.github.com/repos/skalnik/public-repo/statuses/{sha}" + , whRepoLanguagesUrl = URL "https://api.github.com/repos/skalnik/public-repo/languages" + , whRepoStargazersUrl = URL "https://api.github.com/repos/skalnik/public-repo/stargazers" + , whRepoContributorsUrl = URL "https://api.github.com/repos/skalnik/public-repo/contributors" + , whRepoSubscribersUrl = URL "https://api.github.com/repos/skalnik/public-repo/subscribers" + , whRepoSubscriptionUrl = URL "https://api.github.com/repos/skalnik/public-repo/subscription" + , whRepoCommitsUrl = URL "https://api.github.com/repos/skalnik/public-repo/commits{/sha}" + , whRepoGitCommitsUrl = URL "https://api.github.com/repos/skalnik/public-repo/git/commits{/sha}" + , whRepoCommentsUrl = URL "https://api.github.com/repos/skalnik/public-repo/comments{/number}" + , whRepoIssueCommentsUrl = URL "https://api.github.com/repos/skalnik/public-repo/issues/comments{/number}" + , whRepoContentsUrl = URL "https://api.github.com/repos/skalnik/public-repo/contents/{+path}" + , whRepoCompareUrl = URL "https://api.github.com/repos/skalnik/public-repo/compare/{base}...{head}" + , whRepoMergesUrl = URL "https://api.github.com/repos/skalnik/public-repo/merges" + , whRepoArchiveUrl = URL "https://api.github.com/repos/skalnik/public-repo/{archive_format}{/ref}" + , whRepoDownloadsUrl = URL "https://api.github.com/repos/skalnik/public-repo/downloads" + , whRepoIssuesUrl = URL "https://api.github.com/repos/skalnik/public-repo/issues{/number}" + , whRepoPullsUrl = URL "https://api.github.com/repos/skalnik/public-repo/pulls{/number}" + , whRepoMilestonesUrl = URL "https://api.github.com/repos/skalnik/public-repo/milestones{/number}" + , whRepoNotificationsUrl = URL "https://api.github.com/repos/skalnik/public-repo/notifications{?since,all,participating}" + , whRepoLabelsUrl = URL "https://api.github.com/repos/skalnik/public-repo/labels{/name}" + , whRepoReleasesUrl = URL "https://api.github.com/repos/skalnik/public-repo/releases{/id}" + , whRepoCreatedAt = read "2016-10-03 23:23:31" + , whRepoUpdatedAt = read "2016-08-15 17:19:01" + , whRepoPushedAt = read "2016-10-03 23:36:52" + , whRepoGitUrl = URL "git://github.com/skalnik/public-repo.git" + , whRepoSshUrl = URL "git@github.com:skalnik/public-repo.git" + , whRepoCloneUrl = URL "https://github.com/skalnik/public-repo.git" + , whRepoSvnUrl = URL "https://github.com/skalnik/public-repo" + , whRepoHomepage = Nothing + , whRepoSize = 233 + , whRepoStargazersCount = 0 + , whRepoWatchersCount = 0 + , whRepoLanguage = Nothing + , whRepoHasIssues = False + , whRepoHasDownloads = True + , whRepoHasWiki = True + , whRepoHasPages = False + , whRepoForkCount = 0 + , whRepoMirrorUrl = Nothing + , whRepoOpenIssuesCount = 0 + , whRepoDefaultBranchName = "master" + } + } , whPullReqCommentCount = Nothing , whPullReqRevCommentCount = Nothing , whPullReqCommitCount = Nothing diff --git a/src/GitHub/Data/Webhooks/Payload.hs b/src/GitHub/Data/Webhooks/Payload.hs index 179c8a0..83f80df 100644 --- a/src/GitHub/Data/Webhooks/Payload.hs +++ b/src/GitHub/Data/Webhooks/Payload.hs @@ -25,6 +25,7 @@ module GitHub.Data.Webhooks.Payload , HookRelease(..) , HookPullRequest(..) , HookPullRequestReview(..) + , HookTree(..) , HookInstallation(..) , HookDeployment(..) , HookDeploymentStatus(..) @@ -426,8 +427,6 @@ data HookRelease = HookRelease instance NFData HookRelease where rnf = genericRnf --- FIXME: Property "head" missing (not sure) --- FIXME: Property "base" missing (not sure) data HookPullRequest = HookPullRequest { whPullReqUrl :: !URL , whPullReqId :: !Int @@ -453,6 +452,8 @@ data HookPullRequest = HookPullRequest , whPullReqRevCommentUrl :: !URL , whPullReqCommentsUrl :: !URL , whPullReqStatusesUrl :: !URL + , whPullReqBase :: !HookTree + , whPullReqHead :: !HookTree -- , whPullReqIsMerged :: !Bool -- , whPullReqIsMergeable :: !Bool -- , whPullReqMergeableState :: !Text @@ -483,6 +484,21 @@ data HookPullRequestReview = HookPullRequestReview instance NFData HookPullRequestReview where rnf = genericRnf +-- | Information about a specific ref and commit in a specific repository. +-- A pull request has a base tree (the reference branch for a merge) and a head +-- (the changes to be merged). +data HookTree = HookTree + { whTreeLabel :: !Text + , whTreeRef :: !Text + , whTreeSha :: !Text + , whTreeUser :: !HookUser + , whTreeRepo :: !HookRepository + } + deriving (Eq, Show, Typeable, Data, Generic) + +instance NFData HookTree where rnf = genericRnf + + data HookInstallation = HookInstallation { whInstallationId :: !Int , whInstallationAccount :: !HookUser @@ -907,6 +923,8 @@ instance FromJSON HookPullRequest where <*> o .: "review_comment_url" <*> o .: "comments_url" <*> o .: "statuses_url" + <*> o .: "base" + <*> o .: "head" -- <*> o .: "merged" -- <*> o .: "mergeable" -- <*> o .: "mergeable_state" @@ -928,6 +946,14 @@ instance FromJSON HookPullRequestReview where <*> o .: "html_url" <*> o .: "pull_request_url" +instance FromJSON HookTree where + parseJSON = withObject "HookTree" $ \o -> HookTree + <$> o .: "label" + <*> o .: "ref" + <*> o .: "sha" + <*> o .: "user" + <*> o .: "repo" + instance FromJSON HookInstallation where parseJSON = withObject "HookInstallation" $ \o -> HookInstallation <$> o .: "id"