bugbug 0.0.623__tar.gz → 0.0.624__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. {bugbug-0.0.623/bugbug.egg-info → bugbug-0.0.624}/PKG-INFO +1 -1
  2. bugbug-0.0.624/VERSION +1 -0
  3. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/__init__.py +1 -0
  4. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/component.py +9 -2
  5. bugbug-0.0.624/bugbug/models/component_specific.py +136 -0
  6. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/repository.py +5 -2
  7. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/langchain_tools.py +20 -6
  8. {bugbug-0.0.623 → bugbug-0.0.624/bugbug.egg-info}/PKG-INFO +1 -1
  9. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug.egg-info/SOURCES.txt +1 -0
  10. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug.egg-info/requires.txt +6 -6
  11. bugbug-0.0.624/extra-nlp-requirements.txt +1 -0
  12. {bugbug-0.0.623 → bugbug-0.0.624}/requirements.txt +5 -5
  13. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/retrieve_ci_failures.py +1 -0
  14. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/trainer.py +1 -1
  15. bugbug-0.0.623/VERSION +0 -1
  16. bugbug-0.0.623/extra-nlp-requirements.txt +0 -1
  17. {bugbug-0.0.623 → bugbug-0.0.624}/LICENSE +0 -0
  18. {bugbug-0.0.623 → bugbug-0.0.624}/MANIFEST.in +0 -0
  19. {bugbug-0.0.623 → bugbug-0.0.624}/README.md +0 -0
  20. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/__init__.py +0 -0
  21. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/bug_features.py +0 -0
  22. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/bug_snapshot.py +0 -0
  23. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/bugzilla.py +0 -0
  24. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/__init__.py +0 -0
  25. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/function_search.py +0 -0
  26. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/mozilla.py +0 -0
  27. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/parser.py +0 -0
  28. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/searchfox_api.py +0 -0
  29. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/searchfox_data.py +0 -0
  30. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/code_search/searchfox_download.py +0 -0
  31. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/commit_features.py +0 -0
  32. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/db.py +0 -0
  33. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/feature_cleanup.py +0 -0
  34. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/github.py +0 -0
  35. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/issue_features.py +0 -0
  36. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/issue_snapshot.py +0 -0
  37. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/annotateignore.csv +0 -0
  38. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/bug_nobug.csv +0 -0
  39. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/defect_enhancement_task.csv +0 -0
  40. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/defect_enhancement_task_e.csv +0 -0
  41. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/defect_enhancement_task_h.csv +0 -0
  42. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/defect_enhancement_task_p.csv +0 -0
  43. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/defect_enhancement_task_s.csv +0 -0
  44. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/regression_bug_nobug.csv +0 -0
  45. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/regressionrange.csv +0 -0
  46. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/str.csv +0 -0
  47. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels/tracking.csv +0 -0
  48. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/labels.py +0 -0
  49. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/model.py +0 -0
  50. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/model_calibration.py +0 -0
  51. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/accessibility.py +0 -0
  52. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/annotate_ignore.py +0 -0
  53. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/assignee.py +0 -0
  54. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/backout.py +0 -0
  55. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/browsername.py +0 -0
  56. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/bugtype.py +0 -0
  57. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/defect.py +0 -0
  58. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/defect_enhancement_task.py +0 -0
  59. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/devdocneeded.py +0 -0
  60. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/fenixcomponent.py +0 -0
  61. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/fixtime.py +0 -0
  62. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/invalid_compatibility_report.py +0 -0
  63. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/needsdiagnosis.py +0 -0
  64. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/performancebug.py +0 -0
  65. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/qaneeded.py +0 -0
  66. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/rcatype.py +0 -0
  67. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/regression.py +0 -0
  68. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/regressionrange.py +0 -0
  69. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/regressor.py +0 -0
  70. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/spambug.py +0 -0
  71. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/stepstoreproduce.py +0 -0
  72. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/testfailure.py +0 -0
  73. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/testselect.py +0 -0
  74. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/tracking.py +0 -0
  75. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/uplift.py +0 -0
  76. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/models/worksforme.py +0 -0
  77. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/nlp.py +0 -0
  78. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/phabricator.py +0 -0
  79. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/rust_code_analysis_server.py +0 -0
  80. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/swarm.py +0 -0
  81. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/test_scheduling.py +0 -0
  82. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/test_scheduling_features.py +0 -0
  83. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/__init__.py +0 -0
  84. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/base.py +0 -0
  85. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/__init__.py +0 -0
  86. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/agent.py +0 -0
  87. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/config.py +0 -0
  88. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/prompts.py +0 -0
  89. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/scorer.py +0 -0
  90. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/try_server.py +0 -0
  91. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/build_repair/worktree.py +0 -0
  92. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/__init__.py +0 -0
  93. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/agent.py +0 -0
  94. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/data_types.py +0 -0
  95. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/database.py +0 -0
  96. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/prompts.py +0 -0
  97. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/protocols.py +0 -0
  98. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/scorer.py +0 -0
  99. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/code_review/utils.py +0 -0
  100. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/comment_resolution/__init__.py +0 -0
  101. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/comment_resolution/agent.py +0 -0
  102. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/__init__.py +0 -0
  103. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/connection.py +0 -0
  104. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/data_types.py +0 -0
  105. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/exceptions.py +0 -0
  106. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/llms.py +0 -0
  107. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/platforms/__init__.py +0 -0
  108. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/platforms/base.py +0 -0
  109. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/platforms/bugzilla.py +0 -0
  110. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/core/platforms/phabricator.py +0 -0
  111. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/patch_summarization/__init__.py +0 -0
  112. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/patch_summarization/agent.py +0 -0
  113. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/patch_summarization/prompts.py +0 -0
  114. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/suggestion_filtering/__init__.py +0 -0
  115. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/suggestion_filtering/agent.py +0 -0
  116. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/tools/suggestion_filtering/prompts.py +0 -0
  117. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/utils.py +0 -0
  118. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug/vectordb.py +0 -0
  119. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug.egg-info/dependency_links.txt +0 -0
  120. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug.egg-info/entry_points.txt +0 -0
  121. {bugbug-0.0.623 → bugbug-0.0.624}/bugbug.egg-info/top_level.txt +0 -0
  122. {bugbug-0.0.623 → bugbug-0.0.624}/extra-nn-requirements.txt +0 -0
  123. {bugbug-0.0.623 → bugbug-0.0.624}/pyproject.toml +0 -0
  124. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/__init__.py +0 -0
  125. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/analyze_training_metrics.py +0 -0
  126. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/backout_related_test_regressions.py +0 -0
  127. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/bug_classifier.py +0 -0
  128. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/bug_retriever.py +0 -0
  129. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/build_repair_eval.py +0 -0
  130. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/check.py +0 -0
  131. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/check_all_metrics.py +0 -0
  132. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/comment_level_labeler.py +0 -0
  133. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/comment_resolver_runner.py +0 -0
  134. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/commit_classifier.py +0 -0
  135. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/commit_retriever.py +0 -0
  136. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/compatibility_report_classifier.py +0 -0
  137. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/gcp_logs_retriever.py +0 -0
  138. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/generate_landings_risk_report.py +0 -0
  139. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/generate_sheet.py +0 -0
  140. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/get_type_labels.py +0 -0
  141. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/get_untriaged.py +0 -0
  142. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/github_issue_classifier.py +0 -0
  143. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/github_issue_retriever.py +0 -0
  144. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/inline_comments_data_collection.py +0 -0
  145. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/maintenance_effectiveness_indicator.py +0 -0
  146. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/microannotate_generator.py +0 -0
  147. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/past_bugs_by_unit.py +0 -0
  148. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/redundant_failures.py +0 -0
  149. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/regressor_finder.py +0 -0
  150. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/retrieve_training_metrics.py +0 -0
  151. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/review_comments_retriever.py +0 -0
  152. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/revision_retriever.py +0 -0
  153. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/shadow_scheduler_stats.py +0 -0
  154. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/test_scheduling_history_retriever.py +0 -0
  155. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/testing_policy_stats.py +0 -0
  156. {bugbug-0.0.623 → bugbug-0.0.624}/scripts/trainer_extract_args.py +0 -0
  157. {bugbug-0.0.623 → bugbug-0.0.624}/setup.cfg +0 -0
  158. {bugbug-0.0.623 → bugbug-0.0.624}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bugbug
3
- Version: 0.0.623
3
+ Version: 0.0.624
4
4
  Summary: ML tools for Mozilla projects
5
5
  Author: Marco Castelluccio
6
6
  Author-email: mcastelluccio@mozilla.com
bugbug-0.0.624/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.624
@@ -38,6 +38,7 @@ MODELS = {
38
38
  "uplift": "bugbug.models.uplift.UpliftModel",
39
39
  "worksforme": "bugbug.models.worksforme.WorksForMeModel",
40
40
  "fenixcomponent": "bugbug.models.fenixcomponent.FenixComponentModel",
41
+ "componentspecific": "bugbug.models.component_specific.ComponentSpecificModel",
41
42
  }
42
43
 
43
44
 
@@ -17,6 +17,7 @@ from sklearn.pipeline import Pipeline
17
17
  from bugbug import bug_features, bugzilla, feature_cleanup, utils
18
18
  from bugbug.bugzilla import get_product_component_count
19
19
  from bugbug.model import BugModel
20
+ from bugbug.model_calibration import IsotonicRegressionCalibrator
20
21
 
21
22
  logging.basicConfig(level=logging.INFO)
22
23
  logger = logging.getLogger(__name__)
@@ -67,7 +68,7 @@ class ComponentModel(BugModel):
67
68
  "Firefox for Android": "Firefox for Android::General",
68
69
  }
69
70
 
70
- def __init__(self, lemmatization=False):
71
+ def __init__(self, calibration=True, lemmatization=False):
71
72
  BugModel.__init__(self, lemmatization)
72
73
 
73
74
  self.cross_validation_enabled = False
@@ -103,6 +104,12 @@ class ComponentModel(BugModel):
103
104
  ]
104
105
  )
105
106
 
107
+ estimator = xgboost.XGBClassifier(n_jobs=utils.get_physical_cpu_count())
108
+ if calibration:
109
+ estimator = IsotonicRegressionCalibrator(estimator)
110
+ # This is a temporary workaround for the error : "Model type not yet supported by TreeExplainer"
111
+ self.calculate_importance = False
112
+
106
113
  self.clf = Pipeline(
107
114
  [
108
115
  (
@@ -121,7 +128,7 @@ class ComponentModel(BugModel):
121
128
  ),
122
129
  (
123
130
  "estimator",
124
- xgboost.XGBClassifier(n_jobs=utils.get_physical_cpu_count()),
131
+ estimator,
125
132
  ),
126
133
  ]
127
134
  )
@@ -0,0 +1,136 @@
1
+ # -*- coding: utf-8 -*-
2
+ # This Source Code Form is subject to the terms of the Mozilla Public
3
+ # License, v. 2.0. If a copy of the MPL was not distributed with this file,
4
+ # You can obtain one at http://mozilla.org/MPL/2.0/.
5
+
6
+ import logging
7
+ from datetime import datetime, timezone
8
+
9
+ import dateutil.parser
10
+ import xgboost
11
+ from dateutil.relativedelta import relativedelta
12
+ from sklearn.compose import ColumnTransformer
13
+ from sklearn.feature_extraction import DictVectorizer
14
+ from sklearn.pipeline import Pipeline
15
+
16
+ from bugbug import bug_features, bugzilla, feature_cleanup, utils
17
+ from bugbug.model import BugModel
18
+
19
+ logging.basicConfig(level=logging.INFO)
20
+ logger = logging.getLogger(__name__)
21
+
22
+
23
+ class ComponentSpecificModel(BugModel):
24
+ def __init__(self, lemmatization=False, product="Firefox", component="General"):
25
+ BugModel.__init__(self, lemmatization)
26
+
27
+ self.product = product
28
+ self.component = component
29
+
30
+ feature_extractors = [
31
+ bug_features.HasSTR(),
32
+ bug_features.Severity(),
33
+ bug_features.Keywords(),
34
+ bug_features.HasCrashSignature(),
35
+ bug_features.HasURL(),
36
+ bug_features.HasW3CURL(),
37
+ bug_features.HasGithubURL(),
38
+ bug_features.Whiteboard(),
39
+ bug_features.Patches(),
40
+ bug_features.Landings(),
41
+ ]
42
+
43
+ cleanup_functions = [
44
+ feature_cleanup.fileref(),
45
+ feature_cleanup.url(),
46
+ feature_cleanup.synonyms(),
47
+ ]
48
+
49
+ self.extraction_pipeline = Pipeline(
50
+ [
51
+ (
52
+ "bug_extractor",
53
+ bug_features.BugExtractor(
54
+ feature_extractors, cleanup_functions, rollback=True
55
+ ),
56
+ ),
57
+ ]
58
+ )
59
+
60
+ self.clf = Pipeline(
61
+ [
62
+ (
63
+ "union",
64
+ ColumnTransformer(
65
+ [
66
+ ("data", DictVectorizer(), "data"),
67
+ ("title", self.text_vectorizer(min_df=0.0001), "title"),
68
+ (
69
+ "comments",
70
+ self.text_vectorizer(min_df=0.0001),
71
+ "comments",
72
+ ),
73
+ ]
74
+ ),
75
+ ),
76
+ (
77
+ "estimator",
78
+ xgboost.XGBClassifier(n_jobs=utils.get_physical_cpu_count()),
79
+ ),
80
+ ]
81
+ )
82
+
83
+ def get_labels(self):
84
+ classes = {}
85
+
86
+ for bug_data in bugzilla.get_bugs():
87
+ if dateutil.parser.parse(bug_data["creation_time"]) < datetime.now(
88
+ timezone.utc
89
+ ) - relativedelta(years=3):
90
+ continue
91
+
92
+ # Only bugs that were moved out of General and into a specific component
93
+ # Or the opposite
94
+
95
+ for history in bug_data["history"]:
96
+ to_product_firefox = False
97
+ to_component_general = False
98
+
99
+ from_product_firefox = False
100
+ from_component_general = False
101
+
102
+ for change in history["changes"]:
103
+ if change["field_name"] == "product":
104
+ if change["added"] == self.product:
105
+ to_product_firefox = True
106
+ elif change["removed"] == self.product:
107
+ from_product_firefox = True
108
+
109
+ if change["field_name"] == "component":
110
+ if change["added"] == self.component:
111
+ to_component_general = True
112
+ elif change["removed"] == self.component:
113
+ from_component_general = True
114
+
115
+ if from_product_firefox and from_component_general:
116
+ classes[bug_data["id"]] = 1
117
+ elif to_product_firefox and to_component_general:
118
+ classes[bug_data["id"]] = 0
119
+
120
+ logger.info(
121
+ "%d bugs were moved out of %s::%s",
122
+ sum(label == 1 for label in classes.values()),
123
+ self.product,
124
+ self.component,
125
+ )
126
+ logger.info(
127
+ "%d bugs were moved in %s::%s",
128
+ sum(label == 0 for label in classes.values()),
129
+ self.product,
130
+ self.component,
131
+ )
132
+
133
+ return classes, [0, 1]
134
+
135
+ def get_feature_names(self):
136
+ return self.clf.named_steps["union"].get_feature_names_out()
@@ -1523,10 +1523,13 @@ def pull(repo_dir: str, branch: str, revision: str, update: bool = False) -> Non
1523
1523
  """Pull a revision from a branch of a remote repository into a local repository."""
1524
1524
 
1525
1525
  @tenacity.retry(
1526
- stop=tenacity.stop_after_attempt(2),
1526
+ stop=tenacity.stop_after_attempt(3),
1527
+ wait=tenacity.wait_exponential(multiplier=1, min=4, max=60),
1527
1528
  reraise=True,
1528
1529
  after=tenacity.after_log(logger, logging.DEBUG),
1529
- retry=tenacity.retry_if_exception_type(subprocess.TimeoutExpired),
1530
+ retry=tenacity.retry_if_exception_type(
1531
+ (subprocess.TimeoutExpired, RuntimeError)
1532
+ ),
1530
1533
  )
1531
1534
  def trigger_pull() -> None:
1532
1535
  cmd = _build_hg_cmd(
@@ -6,13 +6,17 @@
6
6
  """LangGraph tools for code review agent."""
7
7
 
8
8
  from dataclasses import dataclass
9
+ from logging import getLogger
9
10
 
10
11
  from langchain.tools import tool
11
12
  from langgraph.runtime import get_runtime
13
+ from requests import HTTPError
12
14
 
13
15
  from bugbug.code_search.function_search import FunctionSearch
14
16
  from bugbug.tools.core.platforms.base import Patch
15
17
 
18
+ logger = getLogger(__name__)
19
+
16
20
 
17
21
  @dataclass
18
22
  class CodeReviewContext:
@@ -68,12 +72,22 @@ def create_find_function_definition_tool(function_search: FunctionSearch):
68
72
  Returns:
69
73
  The function definition.
70
74
  """
71
- functions = function_search.get_function_by_name(
72
- # TODO: We may want to use the patch base commit hash here instead of "tip".
73
- "tip",
74
- file_path,
75
- function_name,
76
- )
75
+ try:
76
+ functions = function_search.get_function_by_name(
77
+ # TODO: We may want to use the patch base commit hash here instead of "tip".
78
+ "tip",
79
+ file_path,
80
+ function_name,
81
+ )
82
+ except HTTPError as e:
83
+ logger.error(
84
+ "HTTP error occurred while searching for the definition of function '%s' which is used in file '%s' at line %d: %s",
85
+ function_name,
86
+ file_path,
87
+ line_number,
88
+ e,
89
+ )
90
+ return "Error occurred while searching for the function definition."
77
91
 
78
92
  if not functions:
79
93
  return "Function definition not found."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bugbug
3
- Version: 0.0.623
3
+ Version: 0.0.624
4
4
  Summary: ML tools for Mozilla projects
5
5
  Author: Marco Castelluccio
6
6
  Author-email: mcastelluccio@mozilla.com
@@ -61,6 +61,7 @@ bugbug/models/backout.py
61
61
  bugbug/models/browsername.py
62
62
  bugbug/models/bugtype.py
63
63
  bugbug/models/component.py
64
+ bugbug/models/component_specific.py
64
65
  bugbug/models/defect.py
65
66
  bugbug/models/defect_enhancement_task.py
66
67
  bugbug/models/devdocneeded.py
@@ -1,7 +1,7 @@
1
1
  amqp==5.3.1
2
- async-lru==2.2.0
2
+ async-lru==2.3.0
3
3
  beautifulsoup4==4.14.3
4
- boto3==1.42.73
4
+ boto3==1.42.78
5
5
  claude-agent-sdk>=0.1.30
6
6
  httpx==0.28.1
7
7
  imbalanced-learn==0.14.1
@@ -10,11 +10,11 @@ langchain-classic==1.0.3
10
10
  langchain-community==0.4.1
11
11
  langchain-google-genai==4.2.1
12
12
  langchain-mistralai==1.1.2
13
- langchain-openai==1.1.11
13
+ langchain-openai==1.1.12
14
14
  langchain==1.2.13
15
15
  langgraph==1.1.3
16
16
  libmozdata==0.2.12
17
- llama-cpp-python==0.3.17
17
+ llama-cpp-python==0.3.19
18
18
  lmdb==1.8.1
19
19
  lxml-html-clean==0.4.4
20
20
  markdown2==2.5.5
@@ -33,7 +33,7 @@ python-hglib==2.6.2
33
33
  qdrant-client==1.15.1
34
34
  ratelimit==2.2.1
35
35
  requests-html==0.10.0
36
- requests==2.32.5
36
+ requests==2.33.0
37
37
  rs_parsepatch==0.4.6
38
38
  scikit-learn==1.7.2
39
39
  scipy==1.17.1
@@ -49,6 +49,6 @@ xgboost==3.2.0
49
49
  zstandard==0.25.0
50
50
 
51
51
  [nlp]
52
- spacy==3.8.11
52
+ spacy==3.8.13
53
53
 
54
54
  [nn]
@@ -0,0 +1 @@
1
+ spacy==3.8.13
@@ -1,7 +1,7 @@
1
1
  amqp==5.3.1
2
- async-lru==2.2.0
2
+ async-lru==2.3.0
3
3
  beautifulsoup4==4.14.3
4
- boto3==1.42.73
4
+ boto3==1.42.78
5
5
  claude-agent-sdk>=0.1.30
6
6
  httpx==0.28.1
7
7
  imbalanced-learn==0.14.1
@@ -11,10 +11,10 @@ langchain-classic==1.0.3
11
11
  langchain-community==0.4.1
12
12
  langchain-google-genai==4.2.1
13
13
  langchain-mistralai==1.1.2
14
- langchain-openai==1.1.11
14
+ langchain-openai==1.1.12
15
15
  langgraph==1.1.3
16
16
  libmozdata==0.2.12
17
- llama-cpp-python==0.3.17
17
+ llama-cpp-python==0.3.19
18
18
  lmdb==1.8.1
19
19
  lxml-html-clean==0.4.4
20
20
  markdown2==2.5.5
@@ -32,7 +32,7 @@ python-dateutil==2.9.0.post0
32
32
  python-hglib==2.6.2
33
33
  qdrant-client==1.15.1
34
34
  ratelimit==2.2.1
35
- requests==2.32.5
35
+ requests==2.33.0
36
36
  requests-html==0.10.0
37
37
  rs_parsepatch==0.4.6
38
38
  scikit-learn==1.7.2
@@ -79,6 +79,7 @@ def get_fixed_by_commit_pushes():
79
79
  "failures": push["failures"],
80
80
  "commits": [],
81
81
  }
82
+ logger.info("Got %d failures.", len(fixed_by_commit_pushes))
82
83
 
83
84
  fixed_by_commit_elements = []
84
85
 
@@ -130,7 +130,7 @@ def parse_args(args):
130
130
  f"--{parameter.name}",
131
131
  default=parameter.default,
132
132
  dest=parameter.name,
133
- type=int,
133
+ type=parameter_type,
134
134
  )
135
135
 
136
136
  return main_parser.parse_args(args)
bugbug-0.0.623/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.623
@@ -1 +0,0 @@
1
- spacy==3.8.11
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes