1
0
Fork 0

Let taskgraph load tasks for pushes

master
Johan Lorenzo 2019-09-13 08:19:42 +02:00 committed by Sebastian Kaspari
parent 2a4f48109d
commit d26ef6087d
3 changed files with 7 additions and 7 deletions

View File

@ -84,7 +84,7 @@ tasks:
else:
$if: 'tasks_for in ["cron", "action"]'
then: '${repository.level}'
else: 1
else: '1'
in:
taskId: '${ownTaskId}'
taskGroupId:
@ -130,7 +130,7 @@ tasks:
routes:
$flatten:
- checks
- $if: 'tasks_for != "github-pull-request"'
- $if: 'level == "3"'
then:
- "tc-treeherder.v2.${project}.${head_sha}"
else: []

View File

@ -45,10 +45,8 @@ def pr(builder):
def push(builder):
all_tasks = pr()
other_tasks = all_tasks[-1]
other_tasks[_generate_slug_id()] = builder.craft_ui_tests_task()
all_tasks = pr(builder)
all_tasks.append(builder.craft_ui_tests_task())
return all_tasks

View File

@ -11,7 +11,7 @@ current_dir = os.path.dirname(os.path.realpath(__file__))
project_dir = os.path.realpath(os.path.join(current_dir, '..', '..', '..'))
sys.path.append(project_dir)
from automation.taskcluster.decision_task import pr
from automation.taskcluster.decision_task import pr, push
from automation.taskcluster.lib.tasks import TaskBuilder
@ -37,6 +37,8 @@ def loader(kind, path, config, params, loaded_tasks):
tasks_for = params['tasks_for']
if tasks_for == 'github-pull-request':
ordered_groups_of_tasks = pr(builder)
elif tasks_for == 'github-push':
ordered_groups_of_tasks = push(builder)
else:
raise NotImplementedError('Unsupported tasks_for "{}"'.format(tasks_for))