zulip/zerver/webhooks/github/fixtures
Eeshan Garg 4c0890e8b0 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.
2018-10-23 14:41:24 -07:00
..
assigned_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
closed_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
commit_comment.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
create.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
delete.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
deployment.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
deployment_status.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
edited_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
fork.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
issue.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
issue_comment.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
issue_comment_deleted.json webhooks/github: Test and improve messages for issue comment deletion. 2018-10-04 12:16:06 -07:00
labeled_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
member.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
membership.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
merged_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
opened_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
opened_pull_request_with_preassigned_assignee.json webhooks/github: Test pull requests with preassigned assignees. 2018-10-04 12:16:06 -07:00
page_build.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
ping.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
ping_organization.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
public.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
pull_request_review.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
pull_request_review_comment.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
pull_request_review_requested.json webhooks/github: Add support for PR review requests. 2018-07-01 12:40:45 -07:00
pull_request_review_requested_multiple_reviewers.json webhooks/github: Add support for PR review requests. 2018-07-01 12:40:45 -07:00
pull_request_review_requested_singular_key.json webhooks/github: Handle empty 'requested_reviewers' key. 2018-10-23 14:41:24 -07:00
push_1_commit.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_1_commit_without_username.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_50_commits.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_delete_branch.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_event.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_local_branch_without_commits.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_multiple_committers.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_multiple_committers_with_others.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
push_tag.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
release.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
repository.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
request_review_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
request_review_removed_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
status.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
status_with_target_url.json webhooks/github: Test commit status payloads with target_url. 2018-10-04 12:16:06 -07:00
synchronized_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
team_add.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
unassigned_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
unlabeled_pull_request.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
watch_repository.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00
wiki_pages.json webhooks: Move github_webhook/ to github/. 2018-04-19 11:00:55 -07:00