def publish_reply(user, reply, **kwargs): review_request = reply.review_request # skip review requests that were not pushed if not is_review_request_pushed(review_request): return bug_id = int(review_request.get_bug_list()[0]) b = Bugzilla(user.bzlogin, user.bzcookie) b.post_comment(bug_id, build_plaintext_review(reply, {"user": user}))
def on_reply_publishing(user, reply, **kwargs): review_request = reply.review_request # skip review requests that were not pushed if not is_review_request_pushed(review_request): return bug_id = int(review_request.get_bug_list()[0]) b = Bugzilla(get_bugzilla_api_key(user)) url = get_reply_url(reply) comment = build_plaintext_review(reply, url, {"user": user}) b.post_comment(bug_id, comment)
def on_review_publishing(user, review, **kwargs): """Comment in the bug and potentially r+ or clear a review flag. Note that a reviewer *must* have editbugs to set an attachment flag on someone else's attachment (i.e. the standard BMO review process). TODO: Report lack-of-editbugs properly; see bug 1119065. """ review_request = review.review_request logger.info('Publishing review for user: %s review id: %s ' 'review request id: %s' % (user, review.id, review_request.id)) # skip review requests that were not pushed if not is_pushed(review_request): logger.info('Did not publish review: %s: for user: %d: review not ' 'pushed.' % (user, review.id)) return site = Site.objects.get_current() siteconfig = SiteConfiguration.objects.get_current() comment = build_plaintext_review(review, get_obj_url(review, site, siteconfig), {"user": user}) b = Bugzilla(get_bugzilla_api_key(user)) # TODO: Update all attachments in one call. This is not possible right # now because we have to potentially mix changing and creating flags. if is_parent(review_request): # Mirror the comment to the bug, unless it's a ship-it, in which # case throw an error. Ship-its are allowed only on child commits. if review.ship_it: raise ParentShipItError [b.post_comment(int(bug_id), comment) for bug_id in review_request.get_bug_list()] else: diff_url = '%sdiff/#index_header' % get_obj_url(review_request) bug_id = int(review_request.get_bug_list()[0]) if review.ship_it: commented = b.r_plus_attachment(bug_id, review.user.email, diff_url, comment) else: commented = b.cancel_review_request(bug_id, review.user.email, diff_url, comment) if comment and not commented: b.post_comment(bug_id, comment)
def publish_review(user, review, **kwargs): review_request = review.review_request # skip review requests that were not pushed if not is_review_request_pushed(review_request): return bug_id = int(review_request.get_bug_list()[0]) site = Site.objects.get_current() siteconfig = SiteConfiguration.objects.get_current() b = Bugzilla(user.bzlogin, user.bzcookie) b.post_comment(bug_id, build_plaintext_review(review, {"user": user})) if review.ship_it and not review_request.depends_on.count(): b.r_plus_attachment(bug_id, review.user.username, review_request_url(review_request, site, siteconfig))
def publish_review(user, review, **kwargs): review_request = review.review_request # skip review requests that were not pushed if not is_review_request_pushed(review_request): return bug_id = int(review_request.get_bug_list()[0]) site = Site.objects.get_current() siteconfig = SiteConfiguration.objects.get_current() b = Bugzilla(user.bzlogin, user.bzcookie) b.post_comment(bug_id, build_plaintext_review(review, {"user": user})) if review.ship_it and not review_request.depends_on.count(): b.r_plus_attachment( bug_id, review.user.username, review_request_url(review_request, site, siteconfig))