Skip to content

Commit b292321

Browse files
authored
Improve the logic to move bugs out of Firefox::General (#2854)
1 parent 265b1b3 commit b292321

1 file changed

Lines changed: 21 additions & 15 deletions

File tree

bugbot/rules/component.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ def meets_threshold(bug_data):
106106
# Classify those bugs
107107
bugs = get_bug_ids_classification("component", bug_ids)
108108

109+
# For Firefox::General bugs, use the componentspecific model to decide
110+
# whether to move them out of General.
111+
ff_general_bug_ids = [
112+
bug_id
113+
for bug_id in bug_ids
114+
if raw_bugs[bug_id]["product"] == "Firefox"
115+
and raw_bugs[bug_id]["component"] == "General"
116+
]
117+
componentspecific_results = {}
118+
if ff_general_bug_ids:
119+
componentspecific_results = get_bug_ids_classification(
120+
"componentspecific", ff_general_bug_ids
121+
)
122+
109123
fenix_general_bug_ids = []
110124
for bug_id, bug_data in bugs.items():
111125
if not bug_data.get("available", True):
@@ -187,14 +201,12 @@ def meets_threshold(bug_data):
187201
}:
188202
continue
189203

190-
# Don't move bugs from Firefox::General to Core::Internationalization.
191-
if (
192-
bug["product"] == "Firefox"
193-
and bug["component"] == "General"
194-
and suggested_product == "Core"
195-
and suggested_component == "Internationalization"
196-
):
197-
continue
204+
# For Firefox::General bugs, only proceed if the componentspecific
205+
# model is confident enough that the bug should be moved out.
206+
if bug["product"] == "Firefox" and bug["component"] == "General":
207+
cs = componentspecific_results.get(bug_id, {})
208+
if cs["prob"][1] < self.general_confidence_threshold:
209+
continue
198210

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

211-
confidence_threshold_conf = (
212-
"confidence_threshold"
213-
if bug["component"] != "General"
214-
else "general_confidence_threshold"
215-
)
216-
217-
if prob[index] >= self.get_config(confidence_threshold_conf):
223+
if prob[index] >= self.component_confidence_threshold:
218224
self.autofix_component[bug_id] = {
219225
"product": suggested_product,
220226
"component": suggested_component,

0 commit comments

Comments
 (0)