Skip to content
Permalink
Browse files
no_priority: blacklist instead of whitelist (#613)
* no_priority: blacklist instead of whitelist

* Remove debug stuff
  • Loading branch information
calixteman authored and sylvestre committed Apr 29, 2019
1 parent 22a6882 commit d2a523d9f73a8f1024598265c1154e78bca5653a
@@ -390,7 +390,7 @@ def set_needinfo(self):
res = {}

doc = 'For more information, please visit [auto_nag documentation](https://wiki.mozilla.org/Release_Management/autonag#{}).'.format(
self.get_tool_path()
self.get_tool_path().replace('/', '.2F')
)

for ni_mail, info in self.auto_needinfo.items():
@@ -102,22 +102,20 @@ def is_under(self, mail):
mail, self.black_list
)

def add_triage_owner(self, owner, components, real_owner=None):
def add_triage_owner(self, owner, real_owner=None):
if owner not in self.triage_owners:
to = real_owner if real_owner is not None else owner
self.triage_owners[owner] = self.get_query_url_for_triage_owner(
to, components
)
self.triage_owners[owner] = self.get_query_url_for_triage_owner(to)

def get_query_url_for_triage_owner(self, owner, components):
def get_query_url_for_triage_owner(self, owner):
if self.all_owners is None:
self.all_owners = utils.get_triage_owners()
params = copy.deepcopy(self.query_params)
if 'include_fields' in params:
del params['include_fields']

comps = self.all_owners[owner]
comps = set(comps) & set(components)
comps = set(comps)

params['component'] = sorted(comps)
url = utils.get_bz_search_url(params)
@@ -8,7 +8,7 @@
from libmozdata.bugzilla import BugzillaUser
from random import randint

from auto_nag import utils
from auto_nag import logger, utils
from auto_nag.people import People
from auto_nag.round_robin_calendar import Calendar

@@ -70,8 +70,14 @@ def handler(user):
def get(self, bug, date):
pc = bug['product'] + '::' + bug['component']
if pc not in self.data:
mail = bug['triage_owner']
nick = bug['triage_owner_detail']['nick']
mail = bug.get('triage_owner')
nick = bug.get('triage_owner_detail', {}).get('nick')
if utils.is_no_assignee(mail):
mail, nick = None, None

if mail is None:
logger.error('No triage owner for {}'.format(pc))

return mail, nick

cal = self.data[pc]
@@ -51,10 +51,13 @@
"External Software Affecting Firefox",
"Firefox",
"Firefox for Android",
"Firefox for iOS",
"Firefox Build System",
"Testing",
"Toolkit",
"WebExtensions"
"WebExtensions",
"NSS",
"NSPR"
],
"log": "/tmp/auto_nag_errors.log",
"receiver_list":
@@ -339,6 +342,63 @@
"DOM: Web Storage",
"DOM: Workers"
],
"components_blacklist":
[
"Core::Widget: Gtk",
"Firefox::Untriaged",
"Firefox Build System::General",
"Core::JavaScript Engine",
"Core::Document Navigation",
"Firefox for Android::General",
"Core::DOM: Core & HTML",
"Core::XPCOM",
"DevTools::Accessibility Tools",
"Core::Performance",
"Toolkit::Crash Reporting",
"Firefox Build System::Bootstrap Configuration",
"Toolkit::Video/Audio Controls",
"Core::Privacy: Anti-Tracking",
"Core::Layout",
"Firefox::Extension Compatibility",
"Core::CSS Parsing and Computation",
"Core::DOM: Device Interfaces",
"Core::Layout: Form Controls",
"Core::Javascript: WebAssembly",
"Core::Layout: Scrolling and Overflow",
"Firefox Build System::Lint and Formatting",
"Core::Printing: Output",
"Core::SVG",
"Firefox Build System::Task Configuration",
"Core::Print Preview",
"Firefox Build System::Try",
"Core::DOM: CSS Object Model",
"Core::Layout: Grid",
"Firefox Build System::Toolchains",
"Core::DOM: Bindings (WebIDL)",
"Core::JavaScript Engine: JIT",
"Core::Layout: Block and Inline",
"Core::Layout: Generated Content, Lists, and Counters",
"Core::Layout: Images, Video, and HTML Frames",
"Core::Layout: Text and Fonts",
"Core::String",
"Firefox Build System::Generated Documentation",
"Core::CSS Transitions and Animations",
"Core::Layout: Columns",
"Core::Layout: Flexbox",
"Core::Layout: Positioned",
"Core::Layout: Ruby",
"Core::Layout: Tables",
"Core::MathML",
"Core::MFBT",
"Firefox Build System::General: Unsupported Platforms",
"Core::Printing: Setup",
"WebExtensions::Developer Outreach",
"NSS::Tools",
"Firefox::Shell Integration",
"Core::X-remote",
"NSS::Build",
"Firefox for Android::Web Apps"
],
"supervisor_blacklist":
[
"dcamp@mozilla.com"
@@ -24,6 +24,7 @@ def __init__(self, typ):
blacklist=utils.get_config('workflow', 'supervisor_blacklist', []),
)
self.round_robin = RoundRobin(people=self.people)
self.components_blacklist = utils.get_config('workflow', 'components_blacklist')

def description(self):
return 'Bugs without a priority set'
@@ -51,40 +52,41 @@ def ignore_meta(self):
def columns(self):
return ['component', 'id', 'summary']

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

def get_mail_to_auto_ni(self, bug):
if self.typ == 'second':
return None

mail, nick = self.round_robin.get(bug, self.date)
return {'mail': mail, 'nickname': nick}
if mail and nick:
return {'mail': mail, 'nickname': nick}

return None

def set_people_to_nag(self, bug, buginfo):
priority = 'default'
if not self.filter_bug(priority):
return None

# check if the product::component is in the list
if not utils.check_product_component(self.components, bug):
return None

# don't nag in the first step (just a ni is enough)
if self.typ == 'first':
return bug

owner, _ = self.round_robin.get(bug, self.date)
real_owner = bug['triage_owner']
self.add_triage_owner(
owner, utils.get_config('workflow', 'components'), real_owner=real_owner
)
self.add_triage_owner(owner, real_owner=real_owner)
if not self.add(owner, buginfo, priority=priority):
self.add_no_manager(buginfo['id'])
return bug

def get_bz_params(self, date):
fields = ['triage_owner', 'flags']
self.components = utils.get_config('workflow', 'components')
params = {
'component': utils.get_components(self.components),
'bug_type': 'defect',
'include_fields': fields,
'resolution': '---',
@@ -1,4 +1,4 @@
<p>The following {{ plural('bug has', data, pword='bugs have') }} no priority flag set for the last {{ extra['nweeks'] }} {{ plural('week', extra['nweeks']) }}:
<p>The following {{ plural('bug has', data, pword='bugs have') }} no priority flag set for the last {{ extra['nweeks'] }} {{ plural('week', extra['nweeks']) }} (see the triage <a href="https://mozilla.github.io/bug-handling/triage-bugzilla#what-do-you-triage">documentation</a>):
<table {{ table_attrs }}>
<thead>
<tr>
@@ -1,2 +1,4 @@
The priority flag is not set for this bug.
:{{ nickname }}, could you have a look please?

{{ documentation }}

0 comments on commit d2a523d

Please sign in to comment.