mirror of https://github.com/zulip/zulip.git
4c0890e8b0
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. |
||
---|---|---|
.. | ||
assigned_pull_request.json | ||
closed_pull_request.json | ||
commit_comment.json | ||
create.json | ||
delete.json | ||
deployment.json | ||
deployment_status.json | ||
edited_pull_request.json | ||
fork.json | ||
issue.json | ||
issue_comment.json | ||
issue_comment_deleted.json | ||
labeled_pull_request.json | ||
member.json | ||
membership.json | ||
merged_pull_request.json | ||
opened_pull_request.json | ||
opened_pull_request_with_preassigned_assignee.json | ||
page_build.json | ||
ping.json | ||
ping_organization.json | ||
public.json | ||
pull_request_review.json | ||
pull_request_review_comment.json | ||
pull_request_review_requested.json | ||
pull_request_review_requested_multiple_reviewers.json | ||
pull_request_review_requested_singular_key.json | ||
push_1_commit.json | ||
push_1_commit_without_username.json | ||
push_50_commits.json | ||
push_delete_branch.json | ||
push_event.json | ||
push_local_branch_without_commits.json | ||
push_multiple_committers.json | ||
push_multiple_committers_with_others.json | ||
push_tag.json | ||
release.json | ||
repository.json | ||
request_review_pull_request.json | ||
request_review_removed_pull_request.json | ||
status.json | ||
status_with_target_url.json | ||
synchronized_pull_request.json | ||
team_add.json | ||
unassigned_pull_request.json | ||
unlabeled_pull_request.json | ||
watch_repository.json | ||
wiki_pages.json |