Add new API for working with default reviewers.
Review Request #3879 — Created Feb. 17, 2013 and submitted — Latest diff uploaded
Add new API for working with default reviewers. We never had API for default reviewers before, meaning that it was impossible for scripts to query or manipulate them. This introduces POST, PUT, DELETE and GET support for default reviewers. The functionality is pretty standard. Querying the lists, though, has some nice filtering to narrow down by repositories, users, and groups. To get the errors to propagate correctly, DefaultReviewerForm has been updated to tie any user/group/repository validation errors to the appropriate fields. 33 new unit tests were added.
All new unit tests pass. Testing the DELETE default-reviewers/<id>/ API ... ok Testing the DELETE default-reviewers/<id>/ API with Permission Denied error ... ok Testing the DELETE default-reviewers/<id>/ API with a local site ... ok Testing the DELETE default-reviewers/<id>/ API with a local site and Permission Denied error ... ok Testing the GET default-reviewers/<id>/ API ... ok Testing the GET default-reviewers/<id>/ API with Not Modified response ... ok Testing the GET default-reviewers/<id>/ API with a local site ... ok Testing the GET default-reviewers/<id>/ API with a local site and Permission Denied error ... ok Testing the GET default-reviewers/ API ... ok Testing the GET default-reviewers/?groups= API ... ok Testing the GET default-reviewers/?repositories= API ... ok Testing the GET default-reviewers/ API with a local site ... ok Testing the GET default-reviewers/ API with a local site and Permission Denied error ... ok Testing the GET default-reviewers/?users= API ... ok Testing the POST default-reviewers/ API ... ok Testing the POST default-reviewers/ API with field defaults ... ok Testing the POST default-reviewers/ API with group and invalid site ... ok Testing the POST default-reviewers/ API with invalid group ... ok Testing the POST default-reviewers/ API with invalid repository ... ok Testing the POST default-reviewers/ API with invalid username ... ok Testing the POST default-reviewers/ API with a local site and Permission Denied error ... ok Testing the POST default-reviewers/ API with repository and invalid site ... ok Testing the POST default-reviewers/ API with a local site ... ok Testing the POST default-reviewers/ API with user and invalid site ... ok Testing the PUT default-reviewers/<id>/ API ... ok Testing the PUT default-reviewers/<id>/ API with group and invalid site ... ok Testing the PUT default-reviewers/<id>/ API with invalid group ... ok Testing the PUT default-reviewers/<id>/ API with invalid repository ... ok Testing the PUT default-reviewers/<id>/ API with invalid username ... ok Testing the PUT default-reviewers/<id>/ API with a local site and Permission Denied error ... ok Testing the PUT default-reviewers/<id>/ API with repository and invalid site ... ok Testing the PUT default-reviewers/<id>/ API with a local site ... ok Testing the PUT default-reviewers/<id>/ API with user and invalid site ... ok ---------------------------------------------------------------------- Ran 33 tests in 7.308s OK