Bug 1397722 - [tryselect] Filter 'ccov' tasks out of the target task set (now they must be selected with --full), r=sparky

Usually people don't mean to schedule code coverage tasks on try. But e.g |mach
try fuzzy -q "'mochitest"|, will cause them to be scheduled as a side effect.
This results in wasted resources and superfluous data in ActiveData.

This patch makes it so you need to explicitly pass --full to select ccov tasks
(even though they're technically part of the target task graph).

Differential Revision: https://phabricator.services.mozilla.com/D3917

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2018-08-21 20:00:32 +00:00
Родитель 869419ee56
Коммит bc487acc65
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -6,6 +6,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import hashlib
import os
import re
import shutil
import sys
@ -35,6 +36,12 @@ To fix this, either rebase onto the latest mozilla-central or pass in
https://firefox-source-docs.mozilla.org/taskcluster/taskcluster/mach.html#parameters
"""
# Some tasks show up in the target task set, but are either special cases
# or uncommon enough that they should only be selectable with --full.
TARGET_TASK_FILTERS = (
'.*-ccov\/.*',
)
def invalidate(cache, root):
if not os.path.isfile(cache):
@ -48,6 +55,10 @@ def invalidate(cache, root):
os.remove(cache)
def filter_target_task(task):
return not any(re.search(pattern, task) for pattern in TARGET_TASK_FILTERS)
def generate_tasks(params, full, root):
params = params or "project=mozilla-central"
@ -85,6 +96,9 @@ def generate_tasks(params, full, root):
tg = getattr(TaskGraphGenerator(root_dir=root, parameters=params), attr)
labels = [label for label in tg.graph.visit_postorder()]
if not full:
labels = filter(filter_target_task, labels)
os.chdir(cwd)
with open(cache, 'w') as fh: