in bugbot/rules/needinfo_regression_author.py [0:0]
def filter_bugs(self, bugs):
# Exclude bugs whose regressor author is nobody.
for bug in list(bugs.values()):
if utils.is_no_assignee(bug["regressor_author_email"]):
logger.warning(
"Bug {}, regressor of bug {}, doesn't have an author".format(
bug["regressor_id"], bug["id"]
)
)
del bugs[bug["id"]]
# Exclude bugs whose creator is the regressor author.
bugs = {
bug["id"]: bug
for bug in bugs.values()
if bug["creator"] != bug["regressor_author_email"]
}
# Exclude bugs where a commentor is the regressor author.
def comment_handler(bug, bug_id):
if any(
comment["creator"] == bugs[bug_id]["regressor_author_email"]
for comment in bug["comments"]
):
del bugs[str(bug_id)]
# Exclude bugs where the regressor author is inactive or blocked needinfo.
# TODO: We can drop this when https://github.com/mozilla/bugbot/issues/1465 is implemented.
users_info = UserActivity(include_fields=["groups", "requests"]).check_users(
set(bug["regressor_author_email"] for bug in bugs.values()),
keep_active=True,
fetch_employee_info=True,
)
for bug_id, bug in list(bugs.items()):
user_info = users_info[bug["regressor_author_email"]]
if (
user_info["status"] != UserStatus.ACTIVE
or user_info["requests"]["needinfo"]["blocked"]
):
del bugs[bug_id]
else:
bug["suggest_set_severity"] = bug["severity"] in (
"--",
"n/a",
) and user_info.get("is_employee")
Bugzilla(
bugids=self.get_list_bugs(bugs),
commenthandler=comment_handler,
comment_include_fields=["creator"],
).get_data().wait()
return bugs