Skip to content
Merged
Changes from all commits
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
36 changes: 21 additions & 15 deletions bugbot/rules/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ def meets_threshold(bug_data):
# Classify those bugs
bugs = get_bug_ids_classification("component", bug_ids)

# For Firefox::General bugs, use the componentspecific model to decide
# whether to move them out of General.
ff_general_bug_ids = [
bug_id
for bug_id in bug_ids
if raw_bugs[bug_id]["product"] == "Firefox"
and raw_bugs[bug_id]["component"] == "General"
]
componentspecific_results = {}
if ff_general_bug_ids:
componentspecific_results = get_bug_ids_classification(
"componentspecific", ff_general_bug_ids
)

fenix_general_bug_ids = []
for bug_id, bug_data in bugs.items():
if not bug_data.get("available", True):
Expand Down Expand Up @@ -187,14 +201,12 @@ def meets_threshold(bug_data):
}:
continue

# Don't move bugs from Firefox::General to Core::Internationalization.
if (
bug["product"] == "Firefox"
and bug["component"] == "General"
and suggested_product == "Core"
and suggested_component == "Internationalization"
):
continue
# For Firefox::General bugs, only proceed if the componentspecific
# model is confident enough that the bug should be moved out.
if bug["product"] == "Firefox" and bug["component"] == "General":
cs = componentspecific_results.get(bug_id, {})
if cs["prob"][1] < self.general_confidence_threshold:
continue

result = {
"id": bug_id,
Expand All @@ -208,13 +220,7 @@ def meets_threshold(bug_data):
if self.frequency == "daily":
results[bug_id] = result

confidence_threshold_conf = (
"confidence_threshold"
if bug["component"] != "General"
else "general_confidence_threshold"
)

if prob[index] >= self.get_config(confidence_threshold_conf):
if prob[index] >= self.component_confidence_threshold:
self.autofix_component[bug_id] = {
"product": suggested_product,
"component": suggested_component,
Expand Down