Skip to content

Commit

Permalink
Replace blacklist by skiplist (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman authored and sylvestre committed May 13, 2019
1 parent ca25204 commit 9bbef1f
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions auto_nag/bzcleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ def get_db_extra(self):
for bugid in v['bugids']
}

def get_auto_ni_blacklist(self):
def get_auto_ni_skiplist(self):
return set()

def add_auto_ni(self, bugid, data):
if not data:
return

ni_mail = data['mail']
if ni_mail in self.get_auto_ni_blacklist():
if ni_mail in self.get_auto_ni_skiplist():
return
if ni_mail in self.auto_needinfo:
max_ni = self.get_max_ni()
Expand Down
14 changes: 7 additions & 7 deletions auto_nag/escalation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, who, people):
self.who = who
self.people = people

def get(self, person, blacklist, **kwargs):
def get(self, person, skiplist, **kwargs):
m = NPLUS_PAT.match(self.who)
if m:
sup = self.people.get_nth_manager_mail(person, int(m.group(1)))
Expand All @@ -69,7 +69,7 @@ def get(self, person, blacklist, **kwargs):
)
sup = self.people.get_moz_mail(kwargs[self.who])

if not sup or sup in blacklist:
if not sup or sup in skiplist:
sup = self.people.get_nth_manager_mail(person, 1)

if not sup:
Expand All @@ -93,9 +93,9 @@ def __init__(self, rang, supervisor, days):
self.supervisor = supervisor
self.days = days

def get_supervisor(self, days, person, blacklist, **kwargs):
def get_supervisor(self, days, person, skiplist, **kwargs):
if self.rang.is_in(days):
return self.supervisor.get(person, blacklist, **kwargs)
return self.supervisor.get(person, skiplist, **kwargs)
return None

def filter(self, days, weekday):
Expand All @@ -116,10 +116,10 @@ def __repr__(self):


class Escalation(object):
def __init__(self, people, data=None, blacklist=[]):
def __init__(self, people, data=None, skiplist=[]):
super(Escalation, self).__init__()
self.people = people
self.blacklist = blacklist
self.skiplist = skiplist
self.data = {
'high': Escalation._get_steps('high', people, data),
'normal': Escalation._get_steps('normal', people, data),
Expand All @@ -129,7 +129,7 @@ def __init__(self, people, data=None, blacklist=[]):
def get_supervisor(self, priority, days, person, **kwargs):
steps = self.data[priority]
for step in steps:
s = step.get_supervisor(days, person, self.blacklist, **kwargs)
s = step.get_supervisor(days, person, self.skiplist, **kwargs)
if s is not None:
return s

Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/code_freeze_week.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def get_bz_params(self, date):
self.date = lmdutils.get_date_ymd(date)
self.tomorrow = self.date + relativedelta(days=1)
bugs = utils.get_bugs_from_pushlog(self.date, self.tomorrow)
assignee_blacklist = self.get_config('assignee_blacklist', default=[])
assignee_blacklist = ','.join(assignee_blacklist)
assignee_skiplist = self.get_config('assignee_skiplist', default=[])
assignee_skiplist = ','.join(assignee_skiplist)
fields = [
'assigned_to',
'assigned_to_detail',
Expand All @@ -273,7 +273,7 @@ def get_bz_params(self, date):
'bug_id': ','.join(bugs),
'f1': 'assigned_to',
'o1': 'nowords',
'v1': assignee_blacklist,
'v1': assignee_skiplist,
}

return params
Expand Down
20 changes: 10 additions & 10 deletions auto_nag/scripts/configs/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
},
"one_two_word_summary":
{
"regex_blacklist":
"regex_skiplist":
[
"^[rR]emove",
"^[cC]reate",
Expand All @@ -126,13 +126,13 @@
"mcastelluccio@mozilla.com"
],
"days_lookup": 3,
"resolution_blacklist":
"resolution_skiplist":
[
"DUPLICATE",
"INCOMPLETE",
"INVALID"
],
"reporter_blacklist":
"reporter_skiplist":
[
"intermittent-bug-filer@mozilla.bugs",
"wptsync@mozilla.bugs"
Expand Down Expand Up @@ -196,7 +196,7 @@
},
"leave_open_no_activity":
{
"blacklist":
"skiplist":
[
"sdeckelmann@mozilla.com"
],
Expand All @@ -205,7 +205,7 @@
},
"meta_no_deps_no_activity":
{
"blacklist":
"skiplist":
[
"sdeckelmann@mozilla.com"
],
Expand Down Expand Up @@ -296,7 +296,7 @@
},
"workflow":
{
"components_blacklist":
"components_skiplist":
[
"Core::Widget: Gtk",
"Firefox::Untriaged",
Expand Down Expand Up @@ -353,7 +353,7 @@
"NSS::Build",
"Firefox for Android::Web Apps"
],
"supervisor_blacklist":
"supervisor_skiplist":
[
"dcamp@mozilla.com"
]
Expand Down Expand Up @@ -486,7 +486,7 @@
"tgrabowski@mozilla.com",
"yor@mozilla.com"
],
"assignee_blacklist":
"assignee_skiplist":
[
"wptsync@mozilla.bugs"
]
Expand All @@ -502,7 +502,7 @@
"mcastelluccio@mozilla.com"
],
"days_lookup": 3,
"reporter_blacklist":
"reporter_skiplist":
[
"intermittent-bug-filer@mozilla.bugs",
"wptsync@mozilla.bugs"
Expand Down Expand Up @@ -551,7 +551,7 @@
"regression_without_regressed_by":
{
"days_lookup": 30,
"reporter_blacklist":
"reporter_skiplist":
[
"intermittent-bug-filer@mozilla.bugs"
],
Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/defectenhancementtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def _sort_columns(p):
def get_bz_params(self, date):
start_date, _ = self.get_dates(date)

reporter_blacklist = self.get_config('reporter_blacklist', default=[])
reporter_blacklist = ','.join(reporter_blacklist)
reporter_skiplist = self.get_config('reporter_skiplist', default=[])
reporter_skiplist = ','.join(reporter_skiplist)

return {
# Ignore closed bugs.
Expand All @@ -45,7 +45,7 @@ def get_bz_params(self, date):
# Check only recently opened bugs.
'f1': 'creation_ts', 'o1': 'greaterthan', 'v1': start_date,

'f2': 'reporter', 'o2': 'nowords', 'v2': reporter_blacklist,
'f2': 'reporter', 'o2': 'nowords', 'v2': reporter_skiplist,
}

# Remove bugs for which the type was already changed.
Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/leave_open_no_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self):
self.people = People()
self.nmonths = utils.get_config(self.name(), 'months_lookup')
self.max_ni = utils.get_config(self.name(), 'max_ni')
self.blacklist = set(utils.get_config(self.name(), 'blacklist', []))
self.skiplist = set(utils.get_config(self.name(), 'skiplist', []))

def description(self):
return 'Bugs with leave-open keyword and no activity for the last {} months'.format(
Expand All @@ -26,8 +26,8 @@ def get_extra_for_needinfo_template(self):
def get_extra_for_template(self):
return {'nmonths': self.nmonths}

def get_auto_ni_blacklist(self):
return self.blacklist
def get_auto_ni_skiplist(self):
return self.skiplist

def get_max_ni(self):
return self.max_ni
Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/meta_no_deps_no_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self):
self.people = People()
self.nmonths = utils.get_config(self.name(), 'months_lookup')
self.max_ni = utils.get_config(self.name(), 'max_ni')
self.blacklist = set(utils.get_config(self.name(), 'blacklist', []))
self.skiplist = set(utils.get_config(self.name(), 'skiplist', []))

def description(self):
return 'Bugs with meta keyword, not depending on bugs and no activity for the last {} months'.format(
Expand All @@ -26,8 +26,8 @@ def get_extra_for_needinfo_template(self):
def get_extra_for_template(self):
return {'nmonths': self.nmonths}

def get_auto_ni_blacklist(self):
return self.blacklist
def get_auto_ni_skiplist(self):
return self.skiplist

def get_max_ni(self):
return self.max_ni
Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/one_two_word_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def description(self):

def get_bz_params(self, date):
days_lookup = self.get_config('days_lookup', default=7)
blacklist = self.get_config('regex_blacklist', [])
skiplist = self.get_config('regex_skiplist', [])

params = {
'bug_type': 'defect',
Expand All @@ -27,8 +27,8 @@ def get_bz_params(self, date):
'v2': '^([a-zA-Z0-9_]+ [a-zA-Z0-9_]+|[a-zA-Z0-9_]+)$',
}

if blacklist:
for i, regex in enumerate(blacklist):
if skiplist:
for i, regex in enumerate(skiplist):
j = str(i + 3)
params['f' + j] = 'short_desc'
params['o' + j] = 'notregexp'
Expand Down
12 changes: 6 additions & 6 deletions auto_nag/scripts/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ def sort_columns(self):
def get_bz_params(self, date):
start_date, end_date = self.get_dates(date)

resolution_blacklist = self.get_config('resolution_blacklist', default=[])
resolution_blacklist = ' '.join(resolution_blacklist)
resolution_skiplist = self.get_config('resolution_skiplist', default=[])
resolution_skiplist = ' '.join(resolution_skiplist)

reporter_blacklist = self.get_config('reporter_blacklist', default=[])
reporter_blacklist = ','.join(reporter_blacklist)
reporter_skiplist = self.get_config('reporter_skiplist', default=[])
reporter_skiplist = ','.join(reporter_skiplist)

params = {
'bug_type': 'defect',
'f1': 'keywords', 'o1': 'nowords', 'v1': 'regression,feature,meta',
'f2': 'longdesc', 'o2': 'anywordssubstr', 'v2': 'regress caus',
'f3': 'resolution', 'o3': 'nowords', 'v3': resolution_blacklist,
'f3': 'resolution', 'o3': 'nowords', 'v3': resolution_skiplist,
'f4': 'longdesc', 'o4': 'changedafter', 'v4': start_date,
'f5': 'longdesc', 'o5': 'changedbefore', 'v5': end_date,
'f6': 'reporter', 'o6': 'nowords', 'v6': reporter_blacklist,
'f6': 'reporter', 'o6': 'nowords', 'v6': reporter_skiplist,
}

return params
Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/regression_without_regressed_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ def user_handler(user, data):
def get_bz_params(self, date):
start_date, end_date = self.get_dates(date)
fields = ['blocks', 'depends_on', 'assigned_to', 'creator', 'creation_time']
reporter_blacklist = self.get_config('reporter_blacklist', default=[])
reporter_blacklist = ','.join(reporter_blacklist)
reporter_skiplist = self.get_config('reporter_skiplist', default=[])
reporter_skiplist = ','.join(reporter_skiplist)
params = {
'include_fields': fields,
'bug_status': '__open__',
Expand Down Expand Up @@ -189,7 +189,7 @@ def get_bz_params(self, date):
'v12': 'regressionwindow-wanted',
'f13': 'reporter',
'o13': 'nowords',
'v13': reporter_blacklist,
'v13': reporter_skiplist,
'n14': 1,
'f14': 'longdesc',
'o14': 'casesubstring',
Expand Down
6 changes: 3 additions & 3 deletions auto_nag/scripts/workflow/no_priority.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __init__(self, typ):
self.escalation = Escalation(
self.people,
data=utils.get_config(self.name(), 'escalation-{}'.format(typ)),
blacklist=utils.get_config('workflow', 'supervisor_blacklist', []),
skiplist=utils.get_config('workflow', 'supervisor_skiplist', []),
)
self.round_robin = RoundRobin(people=self.people)
self.components_blacklist = utils.get_config('workflow', 'components_blacklist')
self.components_skiplist = utils.get_config('workflow', 'components_skiplist')

def description(self):
return 'Bugs without a priority set'
Expand Down Expand Up @@ -54,7 +54,7 @@ def columns(self):

def handle_bug(self, bug, data):
# check if the product::component is in the list
if utils.check_product_component(self.components_blacklist, bug):
if utils.check_product_component(self.components_skiplist, bug):
return None
return bug

Expand Down
2 changes: 1 addition & 1 deletion auto_nag/scripts/workflow/p1_no_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):
self.escalation = Escalation(
self.people,
data=utils.get_config(self.name(), 'escalation'),
blacklist=utils.get_config('workflow', 'supervisor_blacklist', []),
skiplist=utils.get_config('workflow', 'supervisor_skiplist', []),
)

def description(self):
Expand Down
2 changes: 1 addition & 1 deletion auto_nag/scripts/workflow/p1_no_assignee.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self):
self.escalation = Escalation(
self.people,
data=utils.get_config(self.name(), 'escalation'),
blacklist=utils.get_config('workflow', 'supervisor_blacklist', []),
skiplist=utils.get_config('workflow', 'supervisor_skiplist', []),
)

def description(self):
Expand Down
2 changes: 1 addition & 1 deletion auto_nag/scripts/workflow/p2_no_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self):
self.escalation = Escalation(
self.people,
data=utils.get_config(self.name(), 'escalation'),
blacklist=utils.get_config('workflow', 'supervisor_blacklist', []),
skiplist=utils.get_config('workflow', 'supervisor_skiplist', []),
)

def description(self):
Expand Down

0 comments on commit 9bbef1f

Please sign in to comment.