mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1472776: add a 'cancel' action to cancel one task; r=tomprince
MozReview-Commit-ID: E3MTcM4TR7e --HG-- extra : rebase_source : 41b56b8c5cc0cbafeae81582c47148f24ffbbce7
This commit is contained in:
parent
911da838e3
commit
7a41f4be8d
28
taskcluster/taskgraph/actions/cancel.py
Normal file
28
taskcluster/taskgraph/actions/cancel.py
Normal file
@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
from taskgraph.util.taskcluster import cancel_task
|
||||
from .registry import register_callback_action
|
||||
|
||||
|
||||
@register_callback_action(
|
||||
title='Cancel Task',
|
||||
name='cancel',
|
||||
symbol='cx',
|
||||
kind='hook',
|
||||
generic=True,
|
||||
description=(
|
||||
'Cancel the given task'
|
||||
),
|
||||
order=100,
|
||||
context=[{}]
|
||||
)
|
||||
def cancel_action(parameters, graph_config, input, task_group_id, task_id, task):
|
||||
# Note that this is limited by the scopes afforded to generic actions to
|
||||
# only cancel tasks with the level-specific schedulerId.
|
||||
cancel_task(task_id, use_proxy=True)
|
Loading…
Reference in New Issue
Block a user