Bug 1470621: make all actions use hooks draft
authorDustin J. Mitchell <dustin@mozilla.com>
Tue, 26 Jun 2018 20:57:27 +0000
changeset 814631 ad38db81d950bedb44520afda367c104acc50db8
parent 814462 085cdfb90903d4985f0de1dc7786522d9fb45596
child 814632 32946dea16558e97261abefc65ca34b03db26dc9
push id115287
push userdmitchell@mozilla.com
push dateThu, 05 Jul 2018 20:14:40 +0000
bugs1470621
milestone63.0a1
Bug 1470621: make all actions use hooks Everything but release-promotion (to be handled in another bug) is generic. For the moment, these all run with the default repo scopes; once this is landed, I can start adjusting that and granting the necessary scopes only to these actions. MozReview-Commit-ID: IB8OEsfeBpj
taskcluster/taskgraph/actions/add_new_jobs.py
taskcluster/taskgraph/actions/add_talos.py
taskcluster/taskgraph/actions/cancel_all.py
taskcluster/taskgraph/actions/mochitest_retrigger.py
taskcluster/taskgraph/actions/purge_caches.py
taskcluster/taskgraph/actions/rerun.py
taskcluster/taskgraph/actions/run_missing_tests.py
--- a/taskcluster/taskgraph/actions/add_new_jobs.py
+++ b/taskcluster/taskgraph/actions/add_new_jobs.py
@@ -9,16 +9,18 @@ from __future__ import absolute_import, 
 from .registry import register_callback_action
 
 from .util import (create_tasks, fetch_graph_and_labels)
 
 
 @register_callback_action(
     name='add-new-jobs',
     title='Add new jobs',
+    kind='hook',
+    generic=True,
     symbol='add-new',
     description="Add new jobs using task labels.",
     order=10000,
     context=[],
     schema={
         'type': 'object',
         'properties': {
             'tasks': {
--- a/taskcluster/taskgraph/actions/add_talos.py
+++ b/taskcluster/taskgraph/actions/add_talos.py
@@ -12,16 +12,18 @@ from .registry import register_callback_
 from .util import create_tasks, fetch_graph_and_labels
 
 logger = logging.getLogger(__name__)
 
 
 @register_callback_action(
     name='run-all-talos',
     title='Run All Talos Tests',
+    kind='hook',
+    generic=True,
     symbol='raT',
     description="Add all Talos tasks to a push.",
     order=100,  # Useful for sheriffs, but not top of the list
     context=[],
     schema={
         'type': 'object',
         'properties': {
             'times': {
--- a/taskcluster/taskgraph/actions/cancel_all.py
+++ b/taskcluster/taskgraph/actions/cancel_all.py
@@ -34,16 +34,18 @@ def list_group(task_group_id, session):
             params = {'continuationToken': response.get('continuationToken')}
         else:
             break
 
 
 @register_callback_action(
     title='Cancel All',
     name='cancel-all',
+    kind='hook',
+    generic=True,
     symbol='cAll',
     description=(
         'Cancel all running and pending tasks created by the decision task '
         'this action task is associated with.'
     ),
     order=100,
     context=[]
 )
--- a/taskcluster/taskgraph/actions/mochitest_retrigger.py
+++ b/taskcluster/taskgraph/actions/mochitest_retrigger.py
@@ -18,16 +18,18 @@ from taskgraph.util.parameterization imp
 TASKCLUSTER_QUEUE_URL = "https://queue.taskcluster.net/v1/task"
 
 logger = logging.getLogger(__name__)
 
 
 @register_callback_action(
     name='retrigger-mochitest-reftest-with-options',
     title='Mochitest/Reftest Retrigger',
+    kind='hook',
+    generic=True,
     symbol='tr',
     description="Retriggers the specified mochitest/reftest job with additional options",
     context=[{'test-type': 'mochitest'},
              {'test-type': 'reftest'}],
     order=0,
     schema={
         'type': 'object',
         'properties': {
--- a/taskcluster/taskgraph/actions/purge_caches.py
+++ b/taskcluster/taskgraph/actions/purge_caches.py
@@ -12,16 +12,18 @@ from taskgraph.util.taskcluster import p
 from .registry import register_callback_action
 
 logger = logging.getLogger(__name__)
 
 
 @register_callback_action(
     title='Purge Caches',
     name='purge-caches',
+    kind='hook',
+    generic=True,
     symbol='purge-caches',
     description=(
         'Purge any caches associated with this task '
         'across all workers of the same workertype as the task.'
     ),
     order=100,
     context=[{'worker-implementation': 'docker-worker'}]
 )
--- a/taskcluster/taskgraph/actions/rerun.py
+++ b/taskcluster/taskgraph/actions/rerun.py
@@ -19,16 +19,18 @@ from .util import fetch_graph_and_labels
 logger = logging.getLogger(__name__)
 
 RERUN_STATES = ('exception', 'failed')
 
 
 @register_callback_action(
     title='Rerun',
     name='rerun',
+    kind='hook',
+    generic=True,
     symbol='rr',
     description=(
         'Rerun a task.\n\n'
         'This only works on failed or exception tasks in the original taskgraph,'
         ' and is CoT friendly.'
     ),
     order=1,
     context=[{}],
--- a/taskcluster/taskgraph/actions/run_missing_tests.py
+++ b/taskcluster/taskgraph/actions/run_missing_tests.py
@@ -13,16 +13,18 @@ from .util import create_tasks, fetch_gr
 from taskgraph.util.taskcluster import get_artifact
 
 logger = logging.getLogger(__name__)
 
 
 @register_callback_action(
     name='run-missing-tests',
     title='Run Missing Tests',
+    kind='hook',
+    generic=True,
     symbol='rmt',
     description=(
         "Run tests in the selected push that were optimized away, usually by SETA."
         "\n"
         "This action is for use on pushes that will be merged into another branch,"
         "to check that optimization hasn't hidden any failures."
     ),
     order=100,  # Useful for sheriffs, but not top of the list