Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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):
def __init__(self, channel):
# since it's used in name() we must have it before to call parent ctor
self.channel = channel
super(Unlanded, self).__init__()
self.bug_ids = []
if not self.init_versions():
return
self.channel_pat = Bugzilla.get_landing_patterns(channels=[channel])
def get_patch_data(self, bugs):
"""Get patch information in bugs
"""
nightly_pats = Bugzilla.get_landing_patterns(channels=["nightly"])
def comment_handler(bug, bugid, data):
r = Bugzilla.get_landing_comments(bug["comments"], [], nightly_pats)
landed = bool(r)
if not landed:
for comment in bug["comments"]:
comment = comment["text"].lower()
if "backed out" in comment or "backout" in comment:
landed = True
break
data[bugid]["landed"] = landed
def attachment_handler(attachments, bugid, data):
res = {}
for attachment in attachments:
import datetime
import re
import whatthepatch
from dateutil.relativedelta import relativedelta
from libmozdata import hgmozilla
from libmozdata import utils as lmdutils
from libmozdata.bugzilla import Bugzilla
from libmozdata.connection import Query
from libmozdata.release_calendar import get_calendar
from auto_nag import utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.people import People
NIGHTLY_PAT = Bugzilla.get_landing_patterns(channels=["nightly"])
BUG_PAT = re.compile("[\t ]*bug[s]?[\t ]*([0-9]+)", re.I)
BACKOUT_PAT = re.compile("^back(ed)?[ \t]*out", re.I)
class CodeFreezeWeek(BzCleaner):
def __init__(self):
super(CodeFreezeWeek, self).__init__()
if not self.init_versions():
return
self.people = People.get_instance()
self.nightly = self.versions["central"]
self.beta = self.versions["beta"]
self.release = self.versions["release"]
self.status_nightly = utils.get_flag(self.nightly, "status", "central")
self.status_beta = utils.get_flag(self.beta, "status", "beta")