Skip to content

Commit 27b545d

Browse files
authored
Reduce email noise when unassigning inactive users (#2412)
1 parent 67eaf1d commit 27b545d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

bugbot/rules/assignee_no_login.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
from bugbot import logger, people, utils
1010
from bugbot.bzcleaner import BzCleaner
1111
from bugbot.constants import HIGH_PRIORITY, HIGH_SEVERITY
12+
from bugbot.nag_me import Nag
1213
from bugbot.user_activity import UserActivity
1314

1415

15-
class AssigneeNoLogin(BzCleaner):
16+
class AssigneeNoLogin(BzCleaner, Nag):
1617
def __init__(self):
1718
super(AssigneeNoLogin, self).__init__()
1819
self.unassign_weeks = utils.get_config(self.name(), "unassign_weeks", 2)
@@ -21,6 +22,7 @@ def __init__(self):
2122
self.default_assignees = utils.get_default_assignees()
2223
self.people = people.People.get_instance()
2324
self.unassign_count = collections.defaultdict(int)
25+
self.no_bugmail = True
2426

2527
self.extra_ni = {}
2628

@@ -88,6 +90,8 @@ def handle_inactive_assignees(self, bugs):
8890
self.add_action(bug)
8991
res[bugid] = bug
9092

93+
self.add([bug["assigned_to"], bug["triage_owner"]], bug)
94+
9195
return res
9296

9397
def add_action(self, bug):
@@ -168,6 +172,9 @@ def get_bz_params(self, date):
168172

169173
return params
170174

175+
def nag_template(self):
176+
return self.name() + ".html"
177+
171178

172179
if __name__ == "__main__":
173180
AssigneeNoLogin().run()

templates/assignee_no_login.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p>The following {{ plural('bug has', data, pword='bugs have') }} an assignee who is inactive on Bugzilla:</p>
1+
<p>The following {{ plural('bug has', data, pword='bugs have') }} been unassigned due to assignee inactivity:</p>
22
<table {{ table_attrs }}>
33
<thead>
44
<tr>

0 commit comments

Comments
 (0)