Exception publishing review replies

RESOLVED FIXED

Status

MozReview
General
RESOLVED FIXED
4 years ago
2 years ago

People

(Reporter: mcote, Unassigned)

Tracking

Development/Staging

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
smacleod got the following error trying to publish a review reply.  The cause is pretty obvious; it appears that I missed a caller of build_plaintext_review() when fixing bug 1033489.

Traceback (most recent call last):

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Django-1.6.7-py2.6.egg/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Django-1.6.7-py2.6.egg/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Django-1.6.7-py2.6.egg/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/resources.py", line 495, in __call__
    request, method, view, api_format=api_format, *args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/resources.py", line 566, in call_method_view
    return view(request, *args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/resources.py", line 763, in put
    return self.update(request, *args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/webapi/decorators.py", line 110, in _check
    return view_func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/decorators.py", line 138, in _checklogin
    return view_func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Djblets-0.8.10-py2.6.egg/djblets/webapi/decorators.py", line 287, in _validate
    return view_func(*args, **new_kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/webapi/resources/review_reply.py", line 252, in update
    return self._update_reply(request, reply, *args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/webapi/resources/review_reply.py", line 304, in _update_reply
    reply.publish(user=request.user)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/ReviewBoard-2.0.7-py2.6.egg/reviewboard/reviews/models/review.py", line 191, in publish
    reply_publishing.send(sender=self.__class__, user=user, reply=self)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/Django-1.6.7-py2.6.egg/django/dispatch/dispatcher.py", line 185, in send
    response = receiver(signal=self, sender=sender, **named)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/rbbz/extension.py", line 169, in _transform_errors
    return func(*args, **kwargs)

  File "/data/www/reviewboard-dev.allizom.org/virtualenv/lib/python2.6/site-packages/rbbz/extension.py", line 331, in on_reply_publishing
    b.post_comment(bug_id, build_plaintext_review(reply, {"user": user}))

TypeError: build_plaintext_review() takes exactly 3 arguments (2 given)
(Reporter)

Comment 1

4 years ago
Created attachment 8498445 [details]
Review for review ID: bz://1075292/mcote
(Reporter)

Comment 2

4 years ago
/r/197 - Bug 1075292 - Fix reply publishing.

Pull down this commit:

hg pull review -r 01dc70e76a663b55fc2c3e522e70a5b6dce8b17e
(Reporter)

Updated

4 years ago
Attachment #8498445 - Flags: review?(smacleod)
(Assignee)

Updated

4 years ago
Product: bugzilla.mozilla.org → Developer Services
Attachment #8498445 - Flags: review+
https://reviewboard-dev.allizom.org/r/196/#review150

::: pylib/rbbz/rbbz/extension.py
(Diff revision 1)
> -    b.post_comment(bug_id, build_plaintext_review(reply, {"user": user}))
> +    b.post_comment(bug_id,
> +                   build_plaintext_review(reply, review_or_request_url(reply),
> +                                          {"user": user}))

The way this turns out being styled looks pretty gross to me. How about something like:

    b.post_comment(
        bug_id,
        build_plaintext_review(
            reply,
            review_or_request_url(reply),
            {"user": user}))

or even:

    url = review_or_request_url(reply)
    comment = build_plaintext_review(reply, url, {"user": user}))
    b.post_comment(bug_id, comment)
Attachment #8498445 - Flags: review?(smacleod)
(Reporter)

Comment 4

4 years ago
Fixed as suggested.

http://hg.mozilla.org/hgcustom/version-control-tools/rev/99ad47304078
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Updated

2 years ago
Product: Developer Services → MozReview
You need to log in before you can comment on or make changes to this bug.