3863: Web API should provide an id field for a review request's every depends_on entry

May 27, 2015
What version are you running?


What's the URL of the page this enhancement relates to, if any?


Describe the enhancement and the motivation for it.

Currently if I query review requests either via review_requests or review_requests/<review_request_id> Web API resource, depends_on data appears in the response like this:

"depends_on": [         {
   "href": "http://adsrv2/reviewboard/api/review-requests/51/",
   "method": "GET",
   "title": "blah-blah-blah"

If I want to query a review request's depends_on ids, I can:

a) Implement a hack, and use substring on the href field. This is not only unelegant, but also violates a principle stated in the first chapter of the Web API documentation (https://www.reviewboard.org/docs/manual/2.0/webapi/2.0/overview/#resource-urls).

b) Launch another GET request using the href field, and get the id from the response. Suppose my review requests has got two dozen depends_on references, I will have to do two dozen separate calls to get a couple of characters worth of result per response payload. Not really elegant, nor efficient.

There should be an id field within every depends_on element. Example:

"depends_on": [         {
   "id": "51",
   "href": "http://adsrv2/reviewboard/api/review-requests/51/",
   "method": "GET",
   "title": "blah-blah-blah"

What operating system are you using? What browser?

Windows 7

Please provide any additional information below.
#1 chipx86
A worthwhile thing to add.

What you can do for now is to add ?expand=depends_on to the URL, which will return a payload with each full review request payload embedded.
  • +Confirmed
  • +Component-API
#2 acsipak
Thanks for the tip, but that would still mean a big payload and a lot of processing on the server side for just a couple of bytes of relevant result. I'm going with unelegant solution a) for now, and shall wait for a fix.
#3 brennie
  • -Confirmed
#4 brennie
The fix for this issue has landed on release-2.5.x and master as commit 43d9bda. It will be included in ReviewBoard 2.5.
#5 brennie
  • -PendingReview