mirror of https://github.com/zulip/zulip.git
webhooks/github: Handle empty 'requested_reviewers' key.
We recently received a bug report that implied that for certain payloads, the `requested_reviewers` key was empty whereas a singular `requested_reviewer` key containing one reviewer's information was present in its stead. Naturally, this raised some not so pretty IndexError exceptions. After some investigation and generating a few similar payloads, I discovered that in every case both the `requested_reviewers` and the `requested_reviewer` keys were correctly populated, so I had to manually edit the payload to reproduce the error on my end. My guess is that this anomaly goes back to when GitHub's reviewer request feature was new and didn't support requesting multiple reviewers, and that the singular `requested_reviewer` key could possibly just be there for backwards compatibility or might just be mere oversight. Either way, the solution here is to look for the plural `requested_reviewers` key, and if that is empty, fall back to the singular `requested_reviewer` key.
This commit is contained in:
parent
5ea7feee7e
commit
4c0890e8b0
|
@ -0,0 +1,463 @@
|
|||
{
|
||||
"action": "review_requested",
|
||||
"number": 6,
|
||||
"pull_request": {
|
||||
"_links": {
|
||||
"comments": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/issues/6/comments"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/6/commits"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://github.com/eeshangarg/Scheduler/pull/6"
|
||||
},
|
||||
"issue": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/issues/6"
|
||||
},
|
||||
"review_comment": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/comments{/number}"
|
||||
},
|
||||
"review_comments": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/6/comments"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/6"
|
||||
},
|
||||
"statuses": {
|
||||
"href": "https://api.github.com/repos/eeshangarg/Scheduler/statuses/58b742b099302648691924c59be0cc884de42fd4"
|
||||
}
|
||||
},
|
||||
"additions": 2,
|
||||
"assignee": null,
|
||||
"assignees": [],
|
||||
"author_association": "OWNER",
|
||||
"base": {
|
||||
"label": "eeshangarg:master",
|
||||
"ref": "master",
|
||||
"repo": {
|
||||
"archive_url": "https://api.github.com/repos/eeshangarg/Scheduler/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/eeshangarg/Scheduler/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/eeshangarg/Scheduler/branches{/branch}",
|
||||
"clone_url": "https://github.com/eeshangarg/Scheduler.git",
|
||||
"collaborators_url": "https://api.github.com/repos/eeshangarg/Scheduler/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/eeshangarg/Scheduler/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/eeshangarg/Scheduler/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/eeshangarg/Scheduler/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/eeshangarg/Scheduler/contributors",
|
||||
"created_at": "2017-11-24T03:43:58Z",
|
||||
"default_branch": "master",
|
||||
"deployments_url": "https://api.github.com/repos/eeshangarg/Scheduler/deployments",
|
||||
"description": "CS3716 Project",
|
||||
"downloads_url": "https://api.github.com/repos/eeshangarg/Scheduler/downloads",
|
||||
"events_url": "https://api.github.com/repos/eeshangarg/Scheduler/events",
|
||||
"fork": false,
|
||||
"forks": 0,
|
||||
"forks_count": 0,
|
||||
"forks_url": "https://api.github.com/repos/eeshangarg/Scheduler/forks",
|
||||
"full_name": "eeshangarg/Scheduler",
|
||||
"git_commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/tags{/sha}",
|
||||
"git_url": "git://github.com/eeshangarg/Scheduler.git",
|
||||
"has_downloads": true,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": null,
|
||||
"hooks_url": "https://api.github.com/repos/eeshangarg/Scheduler/hooks",
|
||||
"html_url": "https://github.com/eeshangarg/Scheduler",
|
||||
"id": 111873102,
|
||||
"issue_comment_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/eeshangarg/Scheduler/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/eeshangarg/Scheduler/labels{/name}",
|
||||
"language": "Java",
|
||||
"languages_url": "https://api.github.com/repos/eeshangarg/Scheduler/languages",
|
||||
"license": null,
|
||||
"merges_url": "https://api.github.com/repos/eeshangarg/Scheduler/merges",
|
||||
"milestones_url": "https://api.github.com/repos/eeshangarg/Scheduler/milestones{/number}",
|
||||
"mirror_url": null,
|
||||
"name": "Scheduler",
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkxMTE4NzMxMDI=",
|
||||
"notifications_url": "https://api.github.com/repos/eeshangarg/Scheduler/notifications{?since,all,participating}",
|
||||
"open_issues": 5,
|
||||
"open_issues_count": 5,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
},
|
||||
"private": false,
|
||||
"pulls_url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls{/number}",
|
||||
"pushed_at": "2018-10-23T16:48:00Z",
|
||||
"releases_url": "https://api.github.com/repos/eeshangarg/Scheduler/releases{/id}",
|
||||
"size": 9,
|
||||
"ssh_url": "git@github.com:eeshangarg/Scheduler.git",
|
||||
"stargazers_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/eeshangarg/Scheduler/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/eeshangarg/Scheduler/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/eeshangarg/Scheduler/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/eeshangarg/Scheduler/subscription",
|
||||
"svn_url": "https://github.com/eeshangarg/Scheduler",
|
||||
"tags_url": "https://api.github.com/repos/eeshangarg/Scheduler/tags",
|
||||
"teams_url": "https://api.github.com/repos/eeshangarg/Scheduler/teams",
|
||||
"trees_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/trees{/sha}",
|
||||
"updated_at": "2017-11-24T03:45:29Z",
|
||||
"url": "https://api.github.com/repos/eeshangarg/Scheduler",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sha": "4f8a093f7046fcc58b0826d21586d1b537b0112b",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
}
|
||||
},
|
||||
"body": "",
|
||||
"changed_files": 1,
|
||||
"closed_at": null,
|
||||
"comments": 0,
|
||||
"comments_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/6/comments",
|
||||
"commits": 1,
|
||||
"commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/6/commits",
|
||||
"created_at": "2018-10-23T16:47:59Z",
|
||||
"deletions": 0,
|
||||
"diff_url": "https://github.com/eeshangarg/Scheduler/pull/6.diff",
|
||||
"head": {
|
||||
"label": "eeshangarg:random-branch",
|
||||
"ref": "random-branch",
|
||||
"repo": {
|
||||
"archive_url": "https://api.github.com/repos/eeshangarg/Scheduler/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/eeshangarg/Scheduler/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/eeshangarg/Scheduler/branches{/branch}",
|
||||
"clone_url": "https://github.com/eeshangarg/Scheduler.git",
|
||||
"collaborators_url": "https://api.github.com/repos/eeshangarg/Scheduler/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/eeshangarg/Scheduler/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/eeshangarg/Scheduler/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/eeshangarg/Scheduler/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/eeshangarg/Scheduler/contributors",
|
||||
"created_at": "2017-11-24T03:43:58Z",
|
||||
"default_branch": "master",
|
||||
"deployments_url": "https://api.github.com/repos/eeshangarg/Scheduler/deployments",
|
||||
"description": "CS3716 Project",
|
||||
"downloads_url": "https://api.github.com/repos/eeshangarg/Scheduler/downloads",
|
||||
"events_url": "https://api.github.com/repos/eeshangarg/Scheduler/events",
|
||||
"fork": false,
|
||||
"forks": 0,
|
||||
"forks_count": 0,
|
||||
"forks_url": "https://api.github.com/repos/eeshangarg/Scheduler/forks",
|
||||
"full_name": "eeshangarg/Scheduler",
|
||||
"git_commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/tags{/sha}",
|
||||
"git_url": "git://github.com/eeshangarg/Scheduler.git",
|
||||
"has_downloads": true,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": null,
|
||||
"hooks_url": "https://api.github.com/repos/eeshangarg/Scheduler/hooks",
|
||||
"html_url": "https://github.com/eeshangarg/Scheduler",
|
||||
"id": 111873102,
|
||||
"issue_comment_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/eeshangarg/Scheduler/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/eeshangarg/Scheduler/labels{/name}",
|
||||
"language": "Java",
|
||||
"languages_url": "https://api.github.com/repos/eeshangarg/Scheduler/languages",
|
||||
"license": null,
|
||||
"merges_url": "https://api.github.com/repos/eeshangarg/Scheduler/merges",
|
||||
"milestones_url": "https://api.github.com/repos/eeshangarg/Scheduler/milestones{/number}",
|
||||
"mirror_url": null,
|
||||
"name": "Scheduler",
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkxMTE4NzMxMDI=",
|
||||
"notifications_url": "https://api.github.com/repos/eeshangarg/Scheduler/notifications{?since,all,participating}",
|
||||
"open_issues": 5,
|
||||
"open_issues_count": 5,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
},
|
||||
"private": false,
|
||||
"pulls_url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls{/number}",
|
||||
"pushed_at": "2018-10-23T16:48:00Z",
|
||||
"releases_url": "https://api.github.com/repos/eeshangarg/Scheduler/releases{/id}",
|
||||
"size": 9,
|
||||
"ssh_url": "git@github.com:eeshangarg/Scheduler.git",
|
||||
"stargazers_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/eeshangarg/Scheduler/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/eeshangarg/Scheduler/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/eeshangarg/Scheduler/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/eeshangarg/Scheduler/subscription",
|
||||
"svn_url": "https://github.com/eeshangarg/Scheduler",
|
||||
"tags_url": "https://api.github.com/repos/eeshangarg/Scheduler/tags",
|
||||
"teams_url": "https://api.github.com/repos/eeshangarg/Scheduler/teams",
|
||||
"trees_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/trees{/sha}",
|
||||
"updated_at": "2017-11-24T03:45:29Z",
|
||||
"url": "https://api.github.com/repos/eeshangarg/Scheduler",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sha": "58b742b099302648691924c59be0cc884de42fd4",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
}
|
||||
},
|
||||
"html_url": "https://github.com/eeshangarg/Scheduler/pull/6",
|
||||
"id": 225112037,
|
||||
"issue_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/6",
|
||||
"labels": [],
|
||||
"locked": false,
|
||||
"maintainer_can_modify": false,
|
||||
"merge_commit_sha": "3b3d99cc7f1dd56eb930e847f6c76008a7de6c8b",
|
||||
"mergeable": true,
|
||||
"mergeable_state": "clean",
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merged_by": null,
|
||||
"milestone": null,
|
||||
"node_id": "MDExOlB1bGxSZXF1ZXN0MjI1MTEyMDM3",
|
||||
"number": 6,
|
||||
"patch_url": "https://github.com/eeshangarg/Scheduler/pull/6.patch",
|
||||
"rebaseable": true,
|
||||
"requested_reviewers": [
|
||||
],
|
||||
"requested_teams": [],
|
||||
"review_comment_url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/comments{/number}",
|
||||
"review_comments": 0,
|
||||
"review_comments_url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/6/comments",
|
||||
"state": "open",
|
||||
"statuses_url": "https://api.github.com/repos/eeshangarg/Scheduler/statuses/58b742b099302648691924c59be0cc884de42fd4",
|
||||
"title": "Mention how awesome this project is in README",
|
||||
"updated_at": "2018-10-23T17:29:43Z",
|
||||
"url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls/6",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"archive_url": "https://api.github.com/repos/eeshangarg/Scheduler/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/eeshangarg/Scheduler/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/eeshangarg/Scheduler/branches{/branch}",
|
||||
"clone_url": "https://github.com/eeshangarg/Scheduler.git",
|
||||
"collaborators_url": "https://api.github.com/repos/eeshangarg/Scheduler/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/eeshangarg/Scheduler/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/eeshangarg/Scheduler/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/eeshangarg/Scheduler/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/eeshangarg/Scheduler/contributors",
|
||||
"created_at": "2017-11-24T03:43:58Z",
|
||||
"default_branch": "master",
|
||||
"deployments_url": "https://api.github.com/repos/eeshangarg/Scheduler/deployments",
|
||||
"description": "CS3716 Project",
|
||||
"downloads_url": "https://api.github.com/repos/eeshangarg/Scheduler/downloads",
|
||||
"events_url": "https://api.github.com/repos/eeshangarg/Scheduler/events",
|
||||
"fork": false,
|
||||
"forks": 0,
|
||||
"forks_count": 0,
|
||||
"forks_url": "https://api.github.com/repos/eeshangarg/Scheduler/forks",
|
||||
"full_name": "eeshangarg/Scheduler",
|
||||
"git_commits_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/tags{/sha}",
|
||||
"git_url": "git://github.com/eeshangarg/Scheduler.git",
|
||||
"has_downloads": true,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": null,
|
||||
"hooks_url": "https://api.github.com/repos/eeshangarg/Scheduler/hooks",
|
||||
"html_url": "https://github.com/eeshangarg/Scheduler",
|
||||
"id": 111873102,
|
||||
"issue_comment_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/eeshangarg/Scheduler/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/eeshangarg/Scheduler/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/eeshangarg/Scheduler/labels{/name}",
|
||||
"language": "Java",
|
||||
"languages_url": "https://api.github.com/repos/eeshangarg/Scheduler/languages",
|
||||
"license": null,
|
||||
"merges_url": "https://api.github.com/repos/eeshangarg/Scheduler/merges",
|
||||
"milestones_url": "https://api.github.com/repos/eeshangarg/Scheduler/milestones{/number}",
|
||||
"mirror_url": null,
|
||||
"name": "Scheduler",
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkxMTE4NzMxMDI=",
|
||||
"notifications_url": "https://api.github.com/repos/eeshangarg/Scheduler/notifications{?since,all,participating}",
|
||||
"open_issues": 5,
|
||||
"open_issues_count": 5,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
},
|
||||
"private": false,
|
||||
"pulls_url": "https://api.github.com/repos/eeshangarg/Scheduler/pulls{/number}",
|
||||
"pushed_at": "2018-10-23T16:48:00Z",
|
||||
"releases_url": "https://api.github.com/repos/eeshangarg/Scheduler/releases{/id}",
|
||||
"size": 9,
|
||||
"ssh_url": "git@github.com:eeshangarg/Scheduler.git",
|
||||
"stargazers_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/eeshangarg/Scheduler/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/eeshangarg/Scheduler/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/eeshangarg/Scheduler/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/eeshangarg/Scheduler/subscription",
|
||||
"svn_url": "https://github.com/eeshangarg/Scheduler",
|
||||
"tags_url": "https://api.github.com/repos/eeshangarg/Scheduler/tags",
|
||||
"teams_url": "https://api.github.com/repos/eeshangarg/Scheduler/teams",
|
||||
"trees_url": "https://api.github.com/repos/eeshangarg/Scheduler/git/trees{/sha}",
|
||||
"updated_at": "2017-11-24T03:45:29Z",
|
||||
"url": "https://api.github.com/repos/eeshangarg/Scheduler",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"requested_reviewer": {
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/890911?v=4",
|
||||
"events_url": "https://api.github.com/users/rishig/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/rishig/followers",
|
||||
"following_url": "https://api.github.com/users/rishig/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/rishig/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/rishig",
|
||||
"id": 890911,
|
||||
"login": "rishig",
|
||||
"node_id": "MDQ6VXNlcjg5MDkxMQ==",
|
||||
"organizations_url": "https://api.github.com/users/rishig/orgs",
|
||||
"received_events_url": "https://api.github.com/users/rishig/received_events",
|
||||
"repos_url": "https://api.github.com/users/rishig/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/rishig/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/rishig/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/rishig"
|
||||
},
|
||||
"sender": {
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7251823?v=4",
|
||||
"events_url": "https://api.github.com/users/eeshangarg/events{/privacy}",
|
||||
"followers_url": "https://api.github.com/users/eeshangarg/followers",
|
||||
"following_url": "https://api.github.com/users/eeshangarg/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/eeshangarg/gists{/gist_id}",
|
||||
"gravatar_id": "",
|
||||
"html_url": "https://github.com/eeshangarg",
|
||||
"id": 7251823,
|
||||
"login": "eeshangarg",
|
||||
"node_id": "MDQ6VXNlcjcyNTE4MjM=",
|
||||
"organizations_url": "https://api.github.com/users/eeshangarg/orgs",
|
||||
"received_events_url": "https://api.github.com/users/eeshangarg/received_events",
|
||||
"repos_url": "https://api.github.com/users/eeshangarg/repos",
|
||||
"site_admin": false,
|
||||
"starred_url": "https://api.github.com/users/eeshangarg/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/eeshangarg/subscriptions",
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/eeshangarg"
|
||||
}
|
||||
}
|
|
@ -284,6 +284,13 @@ class GithubWebhookTest(WebhookTestCase):
|
|||
expected_message,
|
||||
HTTP_X_GITHUB_EVENT='pull_request')
|
||||
|
||||
def test_pull_request_review_requested_singular_key_msg(self) -> None:
|
||||
expected_message = u"**eeshangarg** requested [rishig](https://github.com/rishig) for a review on [PR #6](https://github.com/eeshangarg/Scheduler/pull/6)."
|
||||
self.send_and_test_stream_message('pull_request_review_requested_singular_key',
|
||||
'Scheduler / PR #6 Mention how awesome this project is in ...',
|
||||
expected_message,
|
||||
HTTP_X_GITHUB_EVENT='pull_request')
|
||||
|
||||
def test_pull_request_review_requested_multiple_reviwers_msg(self) -> None:
|
||||
expected_message = u"**eeshangarg** requested [showell](https://github.com/showell), and [timabbott](https://github.com/timabbott) for a review on [PR #1](https://github.com/eeshangarg/Scheduler/pull/1)."
|
||||
self.send_and_test_stream_message('pull_request_review_requested_multiple_reviewers',
|
||||
|
|
|
@ -310,7 +310,8 @@ def get_pull_request_review_comment_body(payload: Dict[str, Any],
|
|||
|
||||
def get_pull_request_review_requested_body(payload: Dict[str, Any],
|
||||
include_title: Optional[bool]=False) -> str:
|
||||
requested_reviewers = payload['pull_request']['requested_reviewers']
|
||||
requested_reviewers = (payload['pull_request']['requested_reviewers'] or
|
||||
[payload['requested_reviewer']])
|
||||
sender = get_sender_name(payload)
|
||||
pr_number = payload['pull_request']['number']
|
||||
pr_url = payload['pull_request']['html_url']
|
||||
|
|
Loading…
Reference in New Issue