rbbz: strip commit metadata from Bugzilla descriptions (
bug 1243486); r=dminor
We don't want to litter the Bugzilla descriptions with metadata that
isn't relevant to Bugzilla. Strip it.
MozReview-Commit-ID: 4rjBfMdpHUF
--- a/pylib/mozreview/mozreview/bugzilla/attachments.py
+++ b/pylib/mozreview/mozreview/bugzilla/attachments.py
@@ -1,10 +1,14 @@
from __future__ import unicode_literals
+from mozautomation.commitparser import (
+ strip_commit_metadata,
+)
+
from mozreview.models import (
BugzillaUserMap,
get_or_create_bugzilla_users,
)
from mozreview.rb_utils import (
get_obj_url,
)
@@ -70,17 +74,19 @@ def post_bugzilla_attachment(bugzilla, b
# Only post a comment if the diffset has actually changed
comment = ''
if review_request_draft.get_latest_diffset():
diffset_count = review_request.diffset_history.diffsets.count()
if diffset_count < 1:
# 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')
+ '\n')[2].strip()
+
+ extended_commit_msg = strip_commit_metadata(extended_commit_msg)
if extended_commit_msg:
extended_commit_msg += '\n\n'
comment = '%sReview commit: %s\nSee other reviews: %s' % (
extended_commit_msg,
diff_url,
rr_url