in bugbot/rules/no_assignee.py [0:0]
def get_revisions(self, bugs):
"""Get the revisions from the hg.m.o urls in the bug comments"""
nightly_pats = Bugzilla.get_landing_patterns(channels=["nightly"])
def comment_handler(bug, bugid, data):
commenters = data[bugid]["commenters"]
for comment in bug["comments"]:
commenter = comment["author"]
if commenter in commenters:
commenters[commenter] += 1
else:
commenters[commenter] = 1
r = Bugzilla.get_landing_comments(bug["comments"], [], nightly_pats)
data[bugid]["revisions"] = [i["revision"] for i in r]
def attachment_handler(attachments, bugid, data):
for attachment in attachments:
if self.is_patch(attachment):
data[bugid]["creators"].add(attachment["creator"])
bugids = list(bugs.keys())
revisions = {
bugid: {"revisions": [], "creators": set(), "commenters": {}}
for bugid in bugids
}
Bugzilla(
bugids=bugids,
commenthandler=comment_handler,
commentdata=revisions,
comment_include_fields=["text", "author"],
attachmenthandler=attachment_handler,
attachment_include_fields=[
"creator",
"is_obsolete",
"is_patch",
"content_type",
],
attachmentdata=revisions,
).get_data().wait()
return revisions