3329: Show proper error message when attempting to publish review request with duplicate commit ID

tomi*****@gmai***** (Google Code) (Is this you? Claim this profile.)
What version are you running?
2.0 RC2 (dev) (http://reviews.reviewboard.org)

What's the URL of the page this enhancement relates to, if any?
http://reviews.reviewboard.org/r/<id>

Describe the enhancement and the motivation for it.
See the actual defect in issue 3328. Review board should show proper error message when the Ajax request is returned with HTTP error 500. Currently an alert box is shown with value "undefined" and JavaScript console shows the HTTP error 500.

What operating system are you using? What browser?


Please provide any additional information below.
This issue is related to https://code.google.com/p/reviewboard/issues/detail?id=3328.
#1 matthew********@gmai***** (Google Code) (Is this you? Claim this profile.)
I'll work on this.
david
#2 david
  • +PendingReview
david
#3 david
Fixed in release-2.0.x (eec377b). Thanks!
  • -PendingReview
    +Fixed
chipx86
#4 chipx86
This is certainly harder to hit now, but not fully fixed.

The following repro case results in two review requests with the same commit ID:

1. Run `rbt post`
2. Update the branch, run `rbt post` again, creating a new review request.
3. Update the original review request with `rbt post -r <ID>`.
4. Publish both review requests.

While it doesn't seem to break anymore (fortunately), it does result in two review requests with the same commit ID.

We need to check more thoroughly that publishing a draft wouldn't result in a duplicate commit ID, before any actual publishing takes place.
  • -Fixed
    +Confirmed
  • +Component-Reviews
chipx86
#5 chipx86
(Actually, I imagine it just doesn't crash because it's SQLite3, which I think is less strict?)
#6 thom.******@gmai***** (Google Code) (Is this you? Claim this profile.)
Seeing this in deployed Reviewboard 2.0.1 with a MySQL db. user doing 
PUT /api/review-requests/<ID>/draft/ and getting a 500 error. 

The exception is IntegrityError(1062, "Duplicate entry '.....' for key 'reviews_reviewrequest_b8c24015'")

... would a stack trace be helpful? 

The last bit of reviewboard code before all the django mysql stuff is:

  File "reviewboard/webapi/resources/review_request_draft.py", line 394, in update
    review_request.publish(user=request.user)
david
#7 david
I think that yours is a separate bug. Would you mind filing it, and including the stack trace?
david
#8 david
  • +BetterErrors