Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

survey_sec_bugs: Do not set needinfo towards unassigned bugs #1241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions auto_nag/scripts/survey_sec_bugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to define a skiplist (it'd be assignee_skiplist) in configs/tools.json:
https://github.com/mozilla/relman-auto-nag/blob/28392fb0b835d9806b764c131b54998aba56d861/auto_nag/scripts/configs/tools.json#L633

But here I guess you want to use:
https://github.com/mozilla/relman-auto-nag/blob/master/auto_nag/utils.py#L101
with negation = True, in passing the params you already created.
This way your params will contain your stuff and something like (not ( assigned_to=="[email protected]" OR assigned_to="..." ... ))
Normally the function get_empty_assignees helps to filter out all the kind of "empty" assignees.

assignee_skiplist = ",".join(assignee_skiplist)

params = {
# maybe we need more fields to do our changes (?)
"include_fields": ["assigned_to", "whiteboard"],
Expand Down Expand Up @@ -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
Expand All @@ -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)},
Expand Down