Status: New
Owner:
Labels: Type-Defect Priority-Medium
New issue 3508 by thom.ger...@gmail.com: Post Reivew allows you to update a
review request draft to a commit ID that is already present in another
review.
http://code.google.com/p/reviewboard/issues/detail?id=3508
*** READ THIS BEFORE POSTING!
***
*** You must complete this form in its entirety, or your bug report will be
*** rejected.
***
*** If you have a security issue to report, please send it confidentially
to
*** secur...@reviewboard.org. Posting security-related issues to this bug
*** tracker causes us to have to do an emergency release.
***
*** For customer support, please post to reviewbo...@googlegroups.com
***
*** If you have a patch, please submit it to
http://reviews.reviewboard.org/
***
*** This bug tracker is public. Please check that any logs or other
information
*** that you include has been stripped of confidential information.
What version are you running?
Triggered the exception on https://reviews.reviewboard.org/ at sometime
around July 30, 2014 1:30 PM PT .
What's the URL of the page containing the problem?
https://reviews.reviewboard.org/api/review-requests/6169/draft/
What steps will reproduce the problem?
1. Create a review request (# 6168) for commit
09263fedc72b1dd34b7ce11d7e9238664d3316ed . It need not be published.
2. Create a review request (# 6169) for commit
9419d95630f1d455ceaf8932fdf793faee03543b .
3. Update the second review request with the same SHA as the first `rbt
post -r6169 09263fedc72b1dd34b7ce11d7e9238664d3316ed`
- This should get rejected because a review request exists already for
this ID but it is not currently.
4. Attempt to publish Request #6169 from the web ui or rbt post -p
- Trigger 500 error for Integrity Error.
What is the expected output? What do you see instead?
Step #3 should not be be possible. Step #4 should give a better error
message if you get to this state somehow.
What operating system are you using? What browser?
Chrome, Firefox, rbt post on linux.
Please provide any additional information below.
Stack trace of the Integrity Error from a Reviewboard 2.0.3 server:
Traceback (most recent call last):
File Django-1.6.5-py2.7.egg/django/core/handlers/base.py, line 112, in
get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File Django-1.6.5-py2.7.egg/django/views/decorators/cache.py, line 52,
in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File Django-1.6.5-py2.7.egg/django/views/decorators/vary.py, line 19,
in inner_func
response = func(*args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/resources.py, line 494, in
__call__
request, method, view, api_format=api_format, *args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/resources.py, line 565, in
call_method_view
return view(request, *args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/resources.py, line 753, in
put
return self.update(request, *args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/decorators.py, line 117, in
_call
return view_func(*args, **kwargs)
File ReviewBoard-2.0.3-py2.7.egg/reviewboard/webapi/decorators.py, line
110, in _check
return view_func(*args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/decorators.py, line 117, in
_call
return view_func(*args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/decorators.py, line 138, in
_checklogin
return view_func(*args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/decorators.py, line 117, in
_call
return view_func(*args, **kwargs)
File Djblets-0.8.6-py2.7.egg/djblets/webapi/decorators.py, line 287, in
_validate
return view_func(*args, **new_kwargs)
File ReviewBoard-2.0.3-py2.7.egg/reviewboard/webapi/resources/review_request_draft.py,
line 394, in update
review_request.publish(user=request.user)
File ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/review_request.py,
line 716, in publish
changes = draft.publish(self, send_notification=False)
File ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/review_request_draft.py,
line 318, in publish
review_request.save()
File ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/review_request.py,
line 581, in save
super(ReviewRequest, self).save(**kwargs)
File ReviewBoard-2.0.3-py2.7.egg/reviewboard/reviews/models/base_review_request_details.py,
line 258, in save
super(BaseReviewRequestDetails, self).save(**kwargs)
File Django-1.6.5-py2.7.egg/django/db/models/base.py, line 545, in save
force_update=force_update, update_fields=update_fields)
File Django-1.6.5-py2.7.egg/django/db/models/base.py, line 573, in
save_base
updated = self._save_table(raw, cls, force_insert, force_update, using,
update_fields)
File Django-1.6.5-py2.7.egg/django/db/models/base.py, line 635, in