--- a/taskcluster/taskgraph/actions/registry.py
+++ b/taskcluster/taskgraph/actions/registry.py
@@ -5,16 +5,17 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
import json
import os
import inspect
import re
+from slugid import nice as slugid
from mozbuild.util import memoize
from types import FunctionType
from collections import namedtuple
from taskgraph import create
from taskgraph.util.docker import docker_image
from taskgraph.parameters import Parameters
@@ -178,30 +179,34 @@ def register_callback_action(name, title
return None
match = re.match(r'https://(hg.mozilla.org)/(.*?)/?$', parameters['head_repository'])
if not match:
raise Exception('Unrecognized head_repository')
repo_scope = 'assume:repo:{}/{}:*'.format(
match.group(1), match.group(2))
+ task_group_id = os.environ.get('TASK_ID', slugid())
+
return {
'created': {'$fromNow': ''},
'deadline': {'$fromNow': '12 hours'},
'expires': {'$fromNow': '14 days'},
'metadata': {
'owner': 'mozilla-taskcluster-maintenance@mozilla.com',
'source': '{}raw-file/{}/{}'.format(
parameters['head_repository'], parameters['head_rev'], source_path,
),
'name': 'Action: {}'.format(title),
'description': 'Task executing callback for action.\n\n---\n' + description,
},
'workerType': 'gecko-decision',
'provisionerId': 'aws-provisioner-v1',
+ 'taskGroupId': task_group_id,
+ 'schedulerId': 'gecko-level-{}'.format(parameters['level']),
'scopes': [
repo_scope,
],
'tags': {
'createdForUser': parameters['owner'],
'kind': 'action-callback',
},
'routes': [
@@ -212,17 +217,17 @@ def register_callback_action(name, title
],
'payload': {
'env': {
'GECKO_BASE_REPOSITORY': 'https://hg.mozilla.org/mozilla-unified',
'GECKO_HEAD_REPOSITORY': parameters['head_repository'],
'GECKO_HEAD_REF': parameters['head_ref'],
'GECKO_HEAD_REV': parameters['head_rev'],
'HG_STORE_PATH': '/home/worker/checkouts/hg-store',
- 'ACTION_TASK_GROUP_ID': {'$eval': 'taskGroupId'},
+ 'ACTION_TASK_GROUP_ID': task_group_id,
'ACTION_TASK_ID': {'$json': {'$eval': 'taskId'}},
'ACTION_TASK': {'$json': {'$eval': 'task'}},
'ACTION_INPUT': {'$json': {'$eval': 'input'}},
'ACTION_CALLBACK': cb.__name__,
'ACTION_PARAMETERS': {'$json': {'$eval': 'parameters'}},
},
'cache': {
'level-{}-checkouts'.format(parameters['level']):