4553: REST API fails when updating an existing default reviewers rule with >1 group/user/repository to 0 group/user/repository.

kkelly
brennie
brennie

What version are you running?

2.5.7

What's the URL of the page containing the problem?

PUT on http://reviewboard.example/api/default-reviewers/$ID/ with data:

{
    users: '',
    groups: '',
    repositories: '',
}

What steps will reproduce the problem?

  1. Create a default-reviewer rule with >1 user OR group OR repository
  2. PUT to default-reviewer resource web api to set field to have no entries

What is the expected output? What do you see instead?

I expect the PUT to update the default reviewer rule to have no users, groups, or repositories.

What operating system are you using? What browser?

Server on ubuntu 14.04. Web browser Chrome 59 + macOS

Please provide any additional information below.

The issue appears to be the .split(',') calls on these fields here: https://github.com/reviewboard/reviewboard/blob/master/reviewboard/webapi/resources/default_reviewer.py#L258

That will return [''], which will then be used for model lookup and fail.

chipx86
#1 chipx86
  • -New
    +Confirmed
  • +Release-2.5.x
  • +Component:API
brennie
#2 brennie
  • +brennie
brennie
#3 brennie

A fix for this issue is up for review at https://reviews.reviewboard.org/r/8952/.

  • -Confirmed
    +PendingReview
david
#4 david

Fixed in release-2.5.x (50e0fa4)

  • -PendingReview
    +Fixed