No bug: Be strict about treeherder symbol splitting; r=Callek

Differential Revision: https://phabricator.services.mozilla.com/D82624
This commit is contained in:
Tom Prince 2020-07-08 20:02:26 +00:00
Родитель 919ac9b1ae
Коммит f27be8d7e7
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -11,6 +11,7 @@ from __future__ import absolute_import, print_function, unicode_literals
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.attributes import RELEASE_PROJECTS
from taskgraph.util.schema import resolve_keyed_by
from taskgraph.util.treeherder import add_suffix
from taskgraph.util.workertypes import worker_type_implementation
from mozbuild.artifact_builds import JOB_CHOICES as ARTIFACT_JOBS
@ -131,7 +132,7 @@ def use_artifact(config, jobs):
# If tests aren't packaged, then we are not able to rebuild all the packages
and job['worker']['env'].get('MOZ_AUTOMATION_PACKAGE_TESTS') == '1'
):
job['treeherder']['symbol'] += 'a'
job['treeherder']['symbol'] = add_suffix(job['treeherder']['symbol'], 'a')
job['worker']['env']['USE_ARTIFACT'] = '1'
job['attributes']['artifact-build'] = True
yield job

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

@ -5,6 +5,8 @@
from __future__ import absolute_import, print_function, unicode_literals
import re
_JOINED_SYMBOL_RE = re.compile(r'([^(]*)\(([^)]*)\)$')
def split_symbol(treeherder_symbol):
"""Split a symbol expressed as grp(sym) into its two parts. If no group is
@ -12,7 +14,11 @@ def split_symbol(treeherder_symbol):
groupSymbol = '?'
symbol = treeherder_symbol
if '(' in symbol:
groupSymbol, symbol = re.match(r'([^(]*)\(([^)]*)\)', symbol).groups()
match = _JOINED_SYMBOL_RE.match(symbol)
if match:
groupSymbol, symbol = match.groups()
else:
raise Exception("`{}` is not a valid treeherder symbol.".format(symbol))
return groupSymbol, symbol