rbbz: Include full commit message when posting attachments (bug 1232894); r?mdoglio draft
authorMark Cote <mcote@mozilla.com>
Wed, 30 Dec 2015 20:03:35 -0500
changeset 6500 fbe6b6b09323703265572f0522bd9d7db205a3eb
parent 6499 834cf197846c11e655bd06b7144e2897ae0f6afa
push id478
push usermcote@mozilla.com
push dateThu, 31 Dec 2015 01:03:41 +0000
reviewersmdoglio
bugs1232894
rbbz: Include full commit message when posting attachments (bug 1232894); r?mdoglio The old code used to use changedesc, but that doesn't seem to be set nowadays, or at least not consistently. Use the 'description' field now, stripping off the first line, since it's in the attachment summary.
pylib/rbbz/rbbz/extension.py
--- a/pylib/rbbz/rbbz/extension.py
+++ b/pylib/rbbz/rbbz/extension.py
@@ -261,18 +261,29 @@ def post_bugzilla_attachment(bugzilla, b
         if review.ship_it:
             reviewers[last_user.email] = True
 
     rr_url = get_obj_url(review_request)
     diff_url = '%sdiff/#index_header' % rr_url
     diffset_count = review_request.diffset_history.diffsets.count()
 
     if diffset_count < 1:
-        comment = 'Review commit: %s\nSee other reviews: %s' % (diff_url,
-                                                                rr_url)
+        # We don't need the first line, since it is also the attachment
+        # summary, which is displayed in the comment.
+        extended_commit_msg = review_request_draft.description.partition(
+            '\n')[2].lstrip('\n')
+
+        if extended_commit_msg:
+            extended_commit_msg += '\n\n'
+
+        comment = '%sReview commit: %s\nSee other reviews: %s' % (
+            extended_commit_msg,
+            diff_url,
+            rr_url
+        )
     else:
         comment = ('Review request updated; see interdiff: '
                    '%sdiff/%d-%d/\n' % (rr_url,
                                         diffset_count,
                                         diffset_count + 1))
 
     bugzilla.post_rb_url(bug_id,
                          review_request.id,