From feb516cd51d569635b3ddd4e26345d18eaf0e850 Mon Sep 17 00:00:00 2001 From: Frederik Braun Date: Thu, 2 Dec 2021 11:44:45 +0100 Subject: [PATCH] survey_sec_bugs: Do not set needinfo towards unassigned bugs --- auto_nag/scripts/survey_sec_bugs.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/auto_nag/scripts/survey_sec_bugs.py b/auto_nag/scripts/survey_sec_bugs.py index 9b51b41a4..960203a8b 100644 --- a/auto_nag/scripts/survey_sec_bugs.py +++ b/auto_nag/scripts/survey_sec_bugs.py @@ -14,6 +14,9 @@ def description(self): return "Submit survey to assignee of a security bug" def get_bz_params(self, date): + assignee_skiplist = self.get_config("assignee_skiplist", default=[]) + assignee_skiplist = ",".join(assignee_skiplist) + params = { # maybe we need more fields to do our changes (?) "include_fields": ["assigned_to", "whiteboard"], @@ -41,6 +44,11 @@ def get_bz_params(self, date): "f3": "attachments.count", "o3": "greaterthan", "v3": "0", + # does not contain any of the to-be-skipped assignees + "f4": "assigned_to", + "o4": "nowords", + "v4": assignee_skiplist, + } return params @@ -49,6 +57,10 @@ def handle_bug(self, bug, data): assignee = bug["assigned_to"] bugid = str(bug["id"]) + # Do not act on bugs with no assignee. + if utils.is_no_assignee(assignee): + return bug + new_whiteboard = bug["whiteboard"] + "[sec-survey]" self.changes_per_bug[bugid] = { "comment": {"body": self.comment_tpl_for_bugid(bugid)},