-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8393964
commit 19b6e53
Showing
11 changed files
with
325 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -270,27 +270,6 @@ | |
], | ||
"supervisor_skiplist": ["[email protected]"] | ||
}, | ||
"no_severity": { | ||
"max-years": 1, | ||
"first-step": 2, | ||
"second-step": 4, | ||
"escalation-first": { | ||
"default": { | ||
"[0;+∞[": { | ||
"supervisor": "self", | ||
"days": ["Mon", "Tue", "Wed", "Thu", "Fri"] | ||
} | ||
} | ||
}, | ||
"escalation-second": { | ||
"default": { | ||
"[0;+∞[": { | ||
"supervisor": "n+1", | ||
"days": ["Mon", "Thu"] | ||
} | ||
} | ||
} | ||
}, | ||
"p3_p4_p5": { | ||
"months_lookup": 6 | ||
}, | ||
|
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 |
---|---|---|
|
@@ -79,7 +79,7 @@ def get_bz_params(self, date): | |
"include_fields": fields, | ||
"product": list(prods), | ||
"component": list(comps), | ||
"keywords": "intermittent-failure", | ||
"keywords": ["intermittent-failure", "triaged"], | ||
"keywords_type": "nowords", | ||
"email2": "[email protected]", | ||
"emailreporter2": "1", | ||
|
@@ -91,9 +91,6 @@ def get_bz_params(self, date): | |
"f2": "flagtypes.name", | ||
"o2": "notsubstring", | ||
"v2": "needinfo?", | ||
"f3": "bug_severity", | ||
"o3": "anyexact", | ||
"v3": "--, n/a", | ||
} | ||
|
||
return params | ||
|
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 |
---|---|---|
|
@@ -2,54 +2,88 @@ | |
# 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 datetime import datetime | ||
|
||
from libmozdata import utils as lmdutils | ||
|
||
from auto_nag import utils | ||
from auto_nag.bzcleaner import BzCleaner | ||
from auto_nag.component_triagers import ComponentName | ||
from auto_nag.escalation import Escalation | ||
from auto_nag.nag_me import Nag | ||
from auto_nag.round_robin import RoundRobin | ||
|
||
ESCALATION_CONFIG = { | ||
"first": { | ||
"default": { | ||
"[0;+∞[": { | ||
"supervisor": "self", | ||
"days": ["Mon", "Tue", "Wed", "Thu", "Fri"], | ||
}, | ||
}, | ||
}, | ||
"second": { | ||
"default": { | ||
"[0;+∞[": { | ||
"supervisor": "n+1", | ||
"days": ["Mon", "Thu"], | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
|
||
class NotTriaged(BzCleaner, Nag): | ||
"""Bugs that are not triaged""" | ||
|
||
class NoSeverity(BzCleaner, Nag): | ||
def __init__(self, typ, inactivity_days: int = 3): | ||
def __init__( | ||
self, | ||
typ, | ||
inactivity_days: int = 3, | ||
oldest_bug_days: int = 360, | ||
first_step_weeks: int = 2, | ||
second_step_weeks: int = 4, | ||
): | ||
"""Constructor | ||
Args: | ||
typ: the mode that the tool should run with (first or second). Nag | ||
emails will be sent only if `typ` is second. | ||
inactivity_days: number of days that a bug should be inactive before | ||
being considered. | ||
oldest_bug_days: the max number of days since the creation of a bug | ||
to be considered. | ||
first_step_weeks: number of weeks to consider the bug for the the | ||
first step. | ||
second_step_weeks number of weeks to consider the bug for the the | ||
second step. | ||
""" | ||
super(NoSeverity, self).__init__() | ||
assert typ in {"first", "second"} | ||
super().__init__() | ||
self.date: datetime | ||
self.typ = typ | ||
self.lookup_first = utils.get_config(self.name(), "first-step", 2) | ||
self.lookup_second = utils.get_config(self.name(), "second-step", 4) | ||
self.oldest_bug_days = oldest_bug_days | ||
self.lookup_first = first_step_weeks | ||
self.lookup_second = second_step_weeks | ||
self.escalation = Escalation( | ||
self.people, | ||
data=utils.get_config(self.name(), "escalation-{}".format(typ)), | ||
data=ESCALATION_CONFIG[typ], | ||
skiplist=utils.get_config("workflow", "supervisor_skiplist", []), | ||
) | ||
self.round_robin = RoundRobin.get_instance() | ||
self.components_skiplist = utils.get_config("workflow", "components_skiplist") | ||
self.components_skiplist = { | ||
ComponentName.from_str(pc) | ||
for pc in utils.get_config("workflow", "components_skiplist") | ||
} | ||
self.activity_date = lmdutils.get_date("today", inactivity_days) | ||
|
||
def description(self): | ||
return "Bugs without a severity or statuses set" | ||
return "Bugs that are not triaged" | ||
|
||
def nag_template(self): | ||
return self.template() | ||
|
||
def nag_preamble(self): | ||
return """<p> | ||
<ul> | ||
<li><a href="https://firefox-source-docs.mozilla.org/bug-mgmt/policies/triage-bugzilla.html#why-triage">Why triage?</a></li> | ||
<li><a href="https://firefox-source-docs.mozilla.org/bug-mgmt/policies/triage-bugzilla.html#what-do-you-triage">What do you triage?</a></li> | ||
<li><a href="https://firefox-source-docs.mozilla.org/bug-mgmt/guides/priority.html">Priority definitions</a></li> | ||
<li><a href="https://firefox-source-docs.mozilla.org/bug-mgmt/guides/severity.html">Severty definitions</a></li> | ||
</ul> | ||
</p>""" | ||
return True | ||
|
||
def get_extra_for_template(self): | ||
return { | ||
|
@@ -73,8 +107,7 @@ def columns(self): | |
|
||
def handle_bug(self, bug, data): | ||
if ( | ||
# check if the product::component is in the list | ||
utils.check_product_component(self.components_skiplist, bug) | ||
ComponentName.from_bug(bug) in self.components_skiplist | ||
or utils.get_last_no_bot_comment_date(bug) > self.activity_date | ||
): | ||
return None | ||
|
@@ -115,21 +148,21 @@ def get_bz_params(self, date): | |
] | ||
params = { | ||
"include_fields": fields, | ||
"keywords": "intermittent-failure", | ||
"keywords": ["intermittent-failure", "triaged"], | ||
"keywords_type": "nowords", | ||
"email2": "[email protected]", | ||
"emailreporter2": "1", | ||
"emailtype2": "notequals", | ||
"resolution": "---", | ||
"f1": "creation_ts", | ||
"o1": "greaterthan", | ||
"v1": f"-{self.oldest_bug_days}d", | ||
"f21": "bug_type", | ||
"o21": "equals", | ||
"v21": "defect", | ||
"f22": "flagtypes.name", | ||
"o22": "notsubstring", | ||
"o22": "notequals", | ||
"v22": "needinfo?", | ||
"f23": "bug_severity", | ||
"o23": "anyexact", | ||
"v23": "--, n/a", | ||
} | ||
self.date = lmdutils.get_date_ymd(date) | ||
first = f"-{self.lookup_first * 7}d" | ||
|
@@ -144,9 +177,6 @@ def get_bz_params(self, date): | |
# ((second < creation < first) && pc never changed) | ||
params.update( | ||
{ | ||
"f2": "flagtypes.name", | ||
"o2": "notequals", | ||
"v2": "needinfo?", | ||
"j3": "OR", | ||
"f3": "OP", | ||
"j4": "AND", | ||
|
@@ -240,5 +270,5 @@ def get_bz_params(self, date): | |
|
||
|
||
if __name__ == "__main__": | ||
NoSeverity("first").run() | ||
NoSeverity("second").run() | ||
NotTriaged("first").run() | ||
NotTriaged("second").run() |
Oops, something went wrong.