3207: Creating a new review request for commited change fails for first commit

anseli*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 28, 2014
What version are you running?
2.0 beta 3

What's the URL of the page containing the problem?
/r/new/

What steps will reproduce the problem?
1. Create a new review request under "New Review Request for Committed Change".
2. Select the very first commit in a linked GitHub repository.

What is the expected output? What do you see instead?
A new review request should be created. Instead, a SCMError is raised, the webpage hangs, and an empty draft review request is created in the background.

What operating system are you using? What browser?
Ubuntu 12.04 LTS
Chrome 31.0

Please provide any additional information below.
david
#1 david
Can you include the error that's raised?
  • +NeedInfo
#2 anseli*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Of course - here it is:

[24/Jan/2014 02:37:14] "GET /api/repositories/1/branches/?api_format=json HTTP/1.1" 200 119
[24/Jan/2014 02:37:14] "GET /api/repositories/1/commits/?start=6ffd5ae34f2b790afec4b082f2b64255bdfa4fb2&api_format=json HTTP/1.1" 200 182
2014-01-24 02:37:26,568 - ERROR - None - anselina - /api/review-requests/ - Got unexpected SCMError when creating repository: Not Found
Traceback (most recent call last):
  File "/home/anselina/src/reviewboard/reviewboard/webapi/resources/review_request.py", line 519, in create
    user, repository, commit_id, local_site)
  File "/home/anselina/src/reviewboard/reviewboard/reviews/managers.py", line 132, in create
    review_request.update_from_commit_id(commit_id)
  File "/home/anselina/src/reviewboard/reviewboard/reviews/models/base_review_request_details.py", line 182, in update_from_commit_id
    self.update_from_committed_change(commit_id)
  File "/home/anselina/src/reviewboard/reviewboard/reviews/models/base_review_request_details.py", line 230, in update_from_committed_change
    commit = self.repository.get_change(commit_id)
  File "/home/anselina/src/reviewboard/reviewboard/scmtools/models.py", line 296, in get_change
    return hosting_service.get_change(self, revision)
  File "/home/anselina/src/reviewboard/reviewboard/hostingsvcs/github.py", line 409, in get_change
    raise SCMError(six.text_type(e))
SCMError: Not Found
[24/Jan/2014 02:37:26] "POST /api/review-requests/ HTTP/1.1" 500 118
#3 anseli*******@gmai***** (Google Code) (Is this you? Claim this profile.)
I'll also fix this! The problem is that the first commit has no parents, so it fails when it tries to fetch the "compare two commits" API (in reviewboard/hostingsvcs/github.py's get_change) since "parent_revision" is empty.
david
#4 david
  • -NeedInfo
    +PendingReview
david
#5 david
  • +Component-HostingServices
david
#6 david
Fixed in master (7baff93)
  • -PendingReview
    +Fixed