-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new tool (to_triage): get daily email with bugs where priority … (
#649) * Add a new tool (to_triage): get daily email with bugs where priority is unset * Update runner
- Loading branch information
1 parent
9bbef1f
commit 3e27dee
Showing
7 changed files
with
159 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from libmozdata import utils as lmdutils | ||
from auto_nag.bzcleaner import BzCleaner | ||
from auto_nag import utils | ||
from auto_nag.escalation import Escalation | ||
from auto_nag.nag_me import Nag | ||
from auto_nag.round_robin import RoundRobin | ||
|
||
|
||
class ToTriage(BzCleaner, Nag): | ||
def __init__(self): | ||
super(ToTriage, self).__init__() | ||
self.escalation = Escalation(self.people, data=self.get_config('escalation')) | ||
self.round_robin = RoundRobin( | ||
people=self.people, teams=self.get_config('teams', []) | ||
) | ||
self.components = self.round_robin.get_components() | ||
|
||
def description(self): | ||
return 'Bugs to triage' | ||
|
||
def nag_template(self): | ||
return self.template() | ||
|
||
def has_default_product(self): | ||
return False | ||
|
||
def has_product_component(self): | ||
return True | ||
|
||
def ignore_meta(self): | ||
return True | ||
|
||
def columns(self): | ||
return ['component', 'id', 'summary', 'type'] | ||
|
||
def columns_nag(self): | ||
return self.columns() | ||
|
||
def handle_bug(self, bug, data): | ||
bugid = str(bug['id']) | ||
data[bugid] = {'type': bug['type']} | ||
return bug | ||
|
||
def set_people_to_nag(self, bug, buginfo): | ||
priority = 'default' | ||
if not self.filter_bug(priority): | ||
return None | ||
|
||
owner, _ = self.round_robin.get(bug, self.date) | ||
real_owner = bug['triage_owner'] | ||
buginfo['type'] = bug['type'] | ||
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): | ||
self.date = lmdutils.get_date_ymd(date) | ||
prods, comps = utils.get_products_components(self.components) | ||
fields = ['triage_owner', 'type'] | ||
params = { | ||
'include_fields': fields, | ||
'product': list(prods), | ||
'component': list(comps), | ||
'resolution': '---', | ||
'f1': 'priority', | ||
'o1': 'equals', | ||
'v1': '--', | ||
'f2': 'flagtypes.name', | ||
'o2': 'notequals', | ||
'v2': 'needinfo?', | ||
} | ||
|
||
return params | ||
|
||
|
||
if __name__ == '__main__': | ||
ToTriage().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<p>The following {{ plural('bug has', data, pword='bugs have') }} no priority flag set and no pending needinfos (see the triage <a href="https://mozilla.github.io/bug-handling/triage-bugzilla#what-do-you-triage">documentation</a>): | ||
<table {{ table_attrs }}> | ||
<thead> | ||
<tr> | ||
<th>Component</th><th>Bug</th><th>Summary</th><th>Bug Type</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for i, (comp, bugid, summary, type) in enumerate(data) -%} | ||
<tr {% if i % 2 == 0 %}bgcolor="#E0E0E0"{% endif -%}> | ||
<td> | ||
{{ comp | e }} | ||
</td> | ||
<td> | ||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id={{ bugid }}">{{ bugid }}</a> | ||
</td> | ||
<td> | ||
{{ summary | e }} | ||
</td> | ||
<td> | ||
{{ type | e }} | ||
</td> | ||
</tr> | ||
{% endfor -%} | ||
</tbody> | ||
</table> | ||
</p> |