Bug 1624859 - [taskgraph] Remove 'bugbug' internal class in experimental optimization strategies, r=tomprince
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 22 Apr 2020 15:50:13 +0000
changeset 525416 9f55382156dd8ec0298d3b5c6942229891a9d1fa
parent 525415 f155b9755f251fd7c09d1ad26401aaf950b4758e
child 525417 ff704e8cb0ea14330dc27c863e3619bd39e4e1fe
push id113703
push userahalberstadt@mozilla.com
push dateWed, 22 Apr 2020 16:27:58 +0000
treeherderautoland@d82de935b08b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1624859
milestone77.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1624859 - [taskgraph] Remove 'bugbug' internal class in experimental optimization strategies, r=tomprince It was making things more complicated. Differential Revision: https://phabricator.services.mozilla.com/D71821
taskcluster/ci/source-test/shadow-scheduler.yml
taskcluster/taskgraph/optimize/__init__.py
tools/tryselect/selectors/auto.py
tools/tryselect/test/test_auto.t
--- a/taskcluster/ci/source-test/shadow-scheduler.yml
+++ b/taskcluster/ci/source-test/shadow-scheduler.yml
@@ -29,80 +29,80 @@ relevant_tests:
     index:
         product: source
         job-name: shadow-scheduler-relevant_tests
     worker:
         env:
             TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.relevant_tests
 
 bugbug_all:
-    description: Runs the bugbug.all optimization strategy instead of the default.
+    description: Runs the bugbug_all optimization strategy instead of the default.
     treeherder:
         symbol: SS(bugbug_all)
     index:
         product: source
         job-name: shadow-scheduler-bugbug_all
     worker:
         env:
-            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug.all
+            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug_all
 
 bugbug_debug:
-    description: Runs the bugbug.debug optimization strategy instead of the default.
+    description: Runs the bugbug_debug optimization strategy instead of the default.
     treeherder:
         symbol: SS(bugbug_debug)
     index:
         product: source
         job-name: shadow-scheduler-bugbug_debug
     worker:
         env:
-            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug.debug
+            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug_debug
 
 bugbug_all_low:
-    description: Runs the bugbug.all optimization strategy (with a low confidence threshold) instead of the default.
+    description: Runs the bugbug_all optimization strategy (with a low confidence threshold) instead of the default.
     treeherder:
         symbol: SS(bugbug_all_low)
     index:
         product: source
         job-name: shadow-scheduler-bugbug_all_low
     worker:
         env:
-            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug.all_low
+            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug_all_low
 
 bugbug_all_high:
-    description: Runs the bugbug.all optimization strategy (with a high confidence threshold) instead of the default.
+    description: Runs the bugbug_all optimization strategy (with a high confidence threshold) instead of the default.
     treeherder:
         symbol: SS(bugbug_all_high)
     index:
         product: source
         job-name: shadow-scheduler-bugbug_all_high
     worker:
         env:
-            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug.all_high
+            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug_all_high
 
 bugbug_reduced:
-    description: Runs the bugbug.reduced optimization strategy instead of the default.
+    description: Runs the bugbug_reduced optimization strategy instead of the default.
     treeherder:
         symbol: SS(bugbug_reduced)
     index:
         product: source
         job-name: shadow-scheduler-bugbug_reduced
     worker:
         env:
-            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug.reduced
+            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug_reduced
 
 bugbug_reduced_high:
-    description: Runs the bugbug.reduced optimization strategy (with a low confidence threshold) instead of the default.
+    description: Runs the bugbug_reduced optimization strategy (with a low confidence threshold) instead of the default.
     treeherder:
         symbol: SS(bugbug_reduced_high)
     index:
         product: source
         job-name: shadow-scheduler-bugbug_reduced_high
     worker:
         env:
-            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug.reduced_high
+            TASKGRAPH_OPTIMIZE_STRATEGIES: taskgraph.optimize:experimental.bugbug_reduced_high
 
 seta:
     description: Runs the SETA optimization strategy instead of the default.
     treeherder:
         symbol: SS(seta)
     index:
         product: source
         job-name: shadow-scheduler-seta
--- a/taskcluster/taskgraph/optimize/__init__.py
+++ b/taskcluster/taskgraph/optimize/__init__.py
@@ -379,53 +379,49 @@ class experimental(object):
     """Experimental strategies either under development or used as benchmarks.
 
     These run as "shadow-schedulers" on each autoland push (tier 3) and/or can be used
     with `./mach try auto`.  E.g:
 
         ./mach try auto --strategy relevant_tests
     """
 
+    bugbug_all = {
+        'test': Any('skip-unless-schedules', 'bugbug-all'),
+    }
+    """Doesn't limit platforms, medium confidence threshold."""
+
+    bugbug_all_low = {
+        'test': Any('skip-unless-schedules', 'bugbug-all-low'),
+    }
+    """Doesn't limit platforms, low confidence threshold."""
+
+    bugbug_all_high = {
+        'test': Any('skip-unless-schedules', 'bugbug-all-high'),
+    }
+    """Doesn't limit platforms, high confidence threshold."""
+
+    bugbug_debug = {
+        'test': Any('skip-unless-schedules', 'bugbug-debug'),
+    }
+    """Restricts tests to debug platforms."""
+
+    bugbug_reduced = {
+        'test': Any('skip-unless-schedules', 'bugbug-reduced'),
+    }
+    """Use the reduced set of tasks (and no groups) chosen by bugbug."""
+
+    bugbug_reduced_high = {
+        'test': Any('skip-unless-schedules', 'bugbug-reduced-high'),
+    }
+    """Use the reduced set of tasks (and no groups) chosen by bugbug, high
+    confidence threshold."""
+
     relevant_tests = {
         'test': Any('skip-unless-schedules', 'skip-unless-has-relevant-tests'),
     }
     """Runs task containing tests in the same directories as modified files."""
 
     seta = {
         'test': Any('skip-unless-schedules', 'seta'),
     }
     """Provides a stable history of SETA's performance in the event we make it
     non-default in the future. Only useful as a benchmark."""
-
-    class bugbug(object):
-        """Strategies that query the bugbug push schedules endpoint which uses machine
-        learning to determine which tasks to run."""
-
-        all = {
-            'test': Any('skip-unless-schedules', 'bugbug-all'),
-        }
-        """Doesn't limit platforms, medium confidence threshold."""
-
-        all_low = {
-            'test': Any('skip-unless-schedules', 'bugbug-all-low'),
-        }
-        """Doesn't limit platforms, low confidence threshold."""
-
-        all_high = {
-            'test': Any('skip-unless-schedules', 'bugbug-all-high'),
-        }
-        """Doesn't limit platforms, high confidence threshold."""
-
-        debug = {
-            'test': Any('skip-unless-schedules', 'bugbug-debug'),
-        }
-        """Restricts tests to debug platforms."""
-
-        reduced = {
-            'test': Any('skip-unless-schedules', 'bugbug-reduced'),
-        }
-        """Use the reduced set of tasks (and no groups) chosen by bugbug."""
-
-        reduced_high = {
-            'test': Any('skip-unless-schedules', 'bugbug-reduced-high'),
-        }
-        """Use the reduced set of tasks (and no groups) chosen by bugbug, high
-        confidence threshold."""
--- a/tools/tryselect/selectors/auto.py
+++ b/tools/tryselect/selectors/auto.py
@@ -24,17 +24,17 @@ class AutoParser(BaseTryParser):
 def run(message='{msg}', push=True, closed_tree=False, try_config=None):
     print("warning: 'mach try auto' is experimental, results may vary!")
     msg = message.format(msg='Tasks automatically selected.')
     try_config = try_config or {}
 
     # XXX Remove once an intelligent scheduling algorithm is running on
     # autoland by default. This ensures `mach try auto` doesn't run SETA.
     try_config.setdefault('optimize-strategies',
-                          'taskgraph.optimize:experimental.bugbug.debug')
+                          'taskgraph.optimize:experimental.bugbug_debug')
 
     task_config = {
         'version': 2,
         'parameters': {
             'optimize_target_tasks': True,
             'target_tasks_method': 'try_auto',
             'try_mode': 'try_auto',
             'try_task_config': try_config or {},
--- a/tools/tryselect/test/test_auto.t
+++ b/tools/tryselect/test/test_auto.t
@@ -12,17 +12,17 @@ Test auto selector
   Pushed via `mach try auto`
   Calculated try_task_config.json:
   {
       "parameters": {
           "optimize_target_tasks": true,
           "target_tasks_method": "try_auto",
           "try_mode": "try_auto",
           "try_task_config": {
-              "optimize-strategies": "taskgraph.optimize:experimental.bugbug.debug"
+              "optimize-strategies": "taskgraph.optimize:experimental.bugbug_debug"
           }
       },
       "version": 2
   }
   
 
   $ ./mach try auto $testargs --closed-tree
   warning: 'mach try auto' is experimental, results may vary!
@@ -32,17 +32,17 @@ Test auto selector
   Pushed via `mach try auto`
   Calculated try_task_config.json:
   {
       "parameters": {
           "optimize_target_tasks": true,
           "target_tasks_method": "try_auto",
           "try_mode": "try_auto",
           "try_task_config": {
-              "optimize-strategies": "taskgraph.optimize:experimental.bugbug.debug"
+              "optimize-strategies": "taskgraph.optimize:experimental.bugbug_debug"
           }
       },
       "version": 2
   }
   
   $ ./mach try auto $testargs --closed-tree -m "foo {msg} bar"
   warning: 'mach try auto' is experimental, results may vary!
   Commit message:
@@ -51,14 +51,14 @@ Test auto selector
   Pushed via `mach try auto`
   Calculated try_task_config.json:
   {
       "parameters": {
           "optimize_target_tasks": true,
           "target_tasks_method": "try_auto",
           "try_mode": "try_auto",
           "try_task_config": {
-              "optimize-strategies": "taskgraph.optimize:experimental.bugbug.debug"
+              "optimize-strategies": "taskgraph.optimize:experimental.bugbug_debug"
           }
       },
       "version": 2
   }