Bug 1751474 - Vendor taskcluster-taskgraph==1.1.2 r=jcristau

This picks up a bustage fix that occurs with Python 3.10.

Differential Revision: https://phabricator.services.mozilla.com/D136690
This commit is contained in:
Andrew Halberstadt 2022-01-24 08:57:18 +00:00
parent 2387917375
commit 40d7af88ab
18 changed files with 131 additions and 105 deletions

View File

@ -40,7 +40,7 @@ setuptools==51.2.0
six==1.13.0
slugid==2.0.0
taskcluster==44.2.2
taskcluster-taskgraph==1.1.0
taskcluster-taskgraph==1.1.2
taskcluster-urls==13.0.1
tqdm==4.62.3
voluptuous==0.12.1

View File

@ -418,9 +418,9 @@ slugid==2.0.0 \
# -r requirements-mach-vendor-python.in
# taskcluster
# taskcluster-taskgraph
taskcluster-taskgraph==1.1.0 \
--hash=sha256:d3991c71484dfdf102e5479ce71a4e6d43a1889a33bec4aae634c70150cd3f28 \
--hash=sha256:eee145dedd2c12b6404d100ceb6e15a30820b75c8fed587a5cb804d254947153
taskcluster-taskgraph==1.1.2 \
--hash=sha256:2c150b7e0ed760350fa64c609dccfad966d326f9bd463e592a14b9ec7f07fd33 \
--hash=sha256:8496cd571c29ad7b8340dcb42aeecb79c6c176fe9fb37591f29d52931d55a6e5
# via -r requirements-mach-vendor-python.in
taskcluster-urls==13.0.1 \
--hash=sha256:5e25e7e6818e8877178b175ff43d2e6548afad72694aa125f404a7329ece0973 \

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: taskcluster-taskgraph
Version: 1.1.0
Version: 1.1.2
Summary: Build taskcluster taskgraphs
Home-page: https://hg.mozilla.org/ci/taskgraph
License: UNKNOWN

View File

@ -6,27 +6,27 @@ taskgraph/docker.py,sha256=HlCEtfW2coUAyGce8ToVfn8OdLfQJT7Vq_mYQntO4gQ,7485
taskgraph/files_changed.py,sha256=30ONF-m1hbGQnQ31E-TCsHG1jhdNjLTOolSXu2jzOCs,2159
taskgraph/filter_tasks.py,sha256=ty4SK0ujcZ8824F4ikwdCaGX1TRSq_90TFArDogJHTo,875
taskgraph/generator.py,sha256=Axwun0FeuEXKZpCKD3F4HHCk5K3STeYrR2gr15DY9DM,14549
taskgraph/graph.py,sha256=x5WnB9a-1OoY1BETREq1rPll9w1coruGHHlXYUA-daE,4535
taskgraph/graph.py,sha256=W7I-lfDiBMqSj5ZKgqVmebwTaNxdmbKLx2MqFT_cD_I,4666
taskgraph/main.py,sha256=8R6zwOKzK7W4khjxeShbbHstubMOgznbi4QKgGjCKMc,22397
taskgraph/morph.py,sha256=EH_kP5FAMb0F8Oap4VZeVpMNXGr0QhDVz_lxiY-ksgA,9562
taskgraph/optimize.py,sha256=dxeS3BVaRpPrhC0oK4vmZpcSfdMQTeKiWqvb_Lnx1dM,12518
taskgraph/parameters.py,sha256=NahNTMxVNc76_BQ2-kizD8VYfEU65sLAKKPw6wFg_FA,10277
taskgraph/target_tasks.py,sha256=mspItlKD-HCuQR1x_UD6HT_Qd1v5kEHvgRWIUbweRDg,3166
taskgraph/task.py,sha256=OiYCsYhVukqLdQR2olQSG-l7oP2Z_2XaIZxovBPqxCc,2733
taskgraph/taskgraph.py,sha256=Sp6Z68pMGmGVpmaRqUNMRRlK9X7YaGd8lyUGDxOxd3M,2276
taskgraph/taskgraph.py,sha256=DfldF0Fp_hQeDK2lQs4SoWgrp_9tG6y2VfuBEp8C3OM,2397
taskgraph/actions/__init__.py,sha256=lVP1e0YyELg7-_42MWWDbT0cKv_p53BApVE6vWOiPww,416
taskgraph/actions/add_new_jobs.py,sha256=mX_DFDJaQUHetjyMNi5b8zPCCeqfzDrCjDg5DxTaA-I,1831
taskgraph/actions/cancel.py,sha256=vrCVtbkpYTCyW9s9IHCHYI18yuRs1C8g5x8DNRaBnW8,1307
taskgraph/actions/cancel_all.py,sha256=aa8rcM5-Wee8UcDsGAAsfc3AvwBbnM-ac19Lb-G_tXs,1945
taskgraph/actions/registry.py,sha256=YLz8LeDiy8Lugq3K4M_VozG2Y_dJjY8IhdxaPsu4t_E,13233
taskgraph/actions/registry.py,sha256=fcakjIZ1KlYGl2IJ3hFzGT7nkSnhysBK2gQ5eH7VE6A,13370
taskgraph/actions/retrigger.py,sha256=TAhq1yDqkGz0z4Di40WT79RhFhNJdhQajHHg1lDUKSQ,9385
taskgraph/actions/util.py,sha256=OjajY7GqT7K3kEM_fVT9rhVG8vKLh93dNshIvUsRqgs,10660
taskgraph/actions/util.py,sha256=za6ZjGpZOFKHhNouglyUlLBikAVo6y4ckY6kqKPBXpU,10661
taskgraph/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
taskgraph/loader/transform.py,sha256=6DNQ5xIp4RFPJobCzDhisCzarH92YVoGFZOqLbJAFqY,2086
taskgraph/run-task/fetch-content,sha256=auxWFlOG8lSSIKRJZsia7irmA45AoyPiOOK2tdanq0E,23771
taskgraph/run-task/hgrc,sha256=BybWLDR89bWi3pE5T05UqmDHs02CbLypE-omLZWU6Uk,896
taskgraph/run-task/robustcheckout.py,sha256=P41ZGrec5aa8hVTEqOkKJ9wTygsgaXtjoQnl7hkfW-k,28978
taskgraph/run-task/run-task,sha256=AY-hEgsz-vxTPdkqhnek840z67thIOQP4ucL6Rxmpfk,38667
taskgraph/run-task/run-task,sha256=pi1ON9mV_zF6g3rKDooI5aZ4xWRHFztDZBjzfiK_AzI,38668
taskgraph/test/__init__.py,sha256=7LTScvkVcLPqivjL-wCb_Znk2GGajaJi1fJ4SjcLMoA,289
taskgraph/test/automationrelevance.json,sha256=ttGejNZeVhcTWXFdoU0xME0YEYRYvaYcAr8zBz0ewrw,17980
taskgraph/test/conftest.py,sha256=MiCe5gyqGDIARdzauK4wgB4jlyJzhfwiAElBxfTYtlg,3462
@ -56,7 +56,7 @@ taskgraph/test/test_util_taskcluster.py,sha256=yRF_wUpPjYDe6lrrDhTs6HONead97AMNE
taskgraph/test/test_util_templates.py,sha256=u3ckrzmx1eyk7vXiqRiQlETtVZvSx4FHEXN5xB4GZDQ,1676
taskgraph/test/test_util_time.py,sha256=SG4WmSupTQiL1UhE2UMsMNZEugfPdoaxO4aWSxLGXBM,1803
taskgraph/test/test_util_treeherder.py,sha256=20zzGcMd0BL0ayTFQj6Etj39afdxZPgtZxSGUZ0iL5M,912
taskgraph/test/test_util_vcs.py,sha256=s36YylI0CGdPKCWWc2Z-XCFYgt2CdTa1uSFJqMuv6Zk,5804
taskgraph/test/test_util_vcs.py,sha256=z7PtK1ogFhoSxCQGOBHFBcQ0WMezeXWWHBW-ZZR6FM4,6197
taskgraph/test/test_util_yaml.py,sha256=zymZxaAZBIBn5u-p91QsA---IqCH_CVVk3YqMoshLlQ,1019
taskgraph/transforms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
taskgraph/transforms/base.py,sha256=oIQdBKrHG_FZXAoRyiazxgLa8zbAI4TEVlduqz8H12I,5277
@ -64,7 +64,7 @@ taskgraph/transforms/cached_tasks.py,sha256=fMCbxqA-HPSMG6mILYCfdIpnUg9uSKlQGKkU
taskgraph/transforms/code_review.py,sha256=du7npIGOpVMK9QZtdkHrkNecRiaqd-fHjHavDVkfL58,698
taskgraph/transforms/docker_image.py,sha256=14FPWvQ1cAOpSMX1hDV2vTQw3-E99DKI78GnDBIWCo8,7590
taskgraph/transforms/fetch.py,sha256=z-SAZTQSOcVRiFa2E8z0dAEhkIUhdOJdwQgdUah2LzA,9400
taskgraph/transforms/task.py,sha256=osUgHHrgFu-KeOL3oV118kLnCeSNygUMrgox0Yy7rUg,46789
taskgraph/transforms/task.py,sha256=zAfcqIVegJh2OScqQR0mgLPhxjD4WCzXmRgW4-jC0Ng,46793
taskgraph/transforms/job/__init__.py,sha256=imtb3MHVQbKtcCngSnvgumtBfOwxOPiRsJDwHKUtYn0,16891
taskgraph/transforms/job/common.py,sha256=onHnerPcmmvbSk0oHt8mvJmOo7AnjHQya0ombgMNLG8,7106
taskgraph/transforms/job/index_search.py,sha256=zPldmHSalHJjvULAMF9_QAeOZzIeWpr89kOVeP2IJAE,1220
@ -79,22 +79,22 @@ taskgraph/util/docker.py,sha256=kj9V58ZqE12qtNDeRZjz6mxmgoJzZp_eZTzHQoU5lVA,1167
taskgraph/util/hash.py,sha256=_59JUSZeuSu6fo4XjP36Ubs4vbQ5_4RBv61mcmau-t8,1560
taskgraph/util/keyed_by.py,sha256=cgBH4tG8eH5UUrm5q4ODG7A4fzkGAOI7feVoZy3V8Ho,3419
taskgraph/util/memoize.py,sha256=XDlwc-56gzoY8QTwOoiCOYL-igX7JoMcY-9Ih80Euc8,1331
taskgraph/util/parameterization.py,sha256=H3VLBBER63zvgD5yZxx7H542JZZiSPk2_--9-tbREVg,3181
taskgraph/util/path.py,sha256=s1Mt4MWjkI14QUQn817eALrP0yjzYScwuCiAV48NOKM,4359
taskgraph/util/parameterization.py,sha256=rjc_dviIGQIo-C8Hrx1ZcHHOMmxKbE5CLJqkciWW8pQ,3184
taskgraph/util/path.py,sha256=lZKXxtxjbVTSvto0X-M6zKaNVRwpdoR5Y8IaJg-_Xag,4688
taskgraph/util/python_path.py,sha256=93R0mADSe1MeTTOsrDWEjLTW6MVpf2COuf1jXbxuQOk,821
taskgraph/util/readonlydict.py,sha256=XzTG-gqGqWVlSkDxSyOL6Ur7Z0ONhIJ9DVLWV3q4q1w,787
taskgraph/util/schema.py,sha256=ZaxLYnqu9_GmlfuGfNtYN029ZocuxwcDuxGhN5M4-H4,6825
taskgraph/util/schema.py,sha256=rtb3ebLsC0aOdoc2g6DaMZF-Md2G9jfIXAoN65oPDjg,6829
taskgraph/util/taskcluster.py,sha256=Xn4Oly9XStt4j0zVO5QmWb2SN9UF_tFRNyWEPeKOlrc,11042
taskgraph/util/taskgraph.py,sha256=OfaclpaZzVfxViMXaBIAYmSJlI-ZFsBudGVndgH7znw,1982
taskgraph/util/templates.py,sha256=Dqxfl244u-PX7dnsk3_vYyzDwpDgJtANK6NmZwN3Qow,1417
taskgraph/util/time.py,sha256=cMRYsBiz7rgPwgZk77p0P7h9JzeEJENBZCoetBaEHqY,3490
taskgraph/util/treeherder.py,sha256=oCSNiT6l44-c_06H0jZiibsrTsJCae7WJGDXYdA48FE,1993
taskgraph/util/vcs.py,sha256=VRosUvlq8dt65wOIZkmpqiJrTGwkgwxg0dhT8sXr7X8,6192
taskgraph/util/treeherder.py,sha256=XrdE-Je0ZvXe6_8f0DvvqNbrHherUk-hUuxirImPEIo,2138
taskgraph/util/vcs.py,sha256=xqBYwWjiuuRxtVEpA9n3pQJ9iJdyaayD1VtDn2NWPOI,6284
taskgraph/util/verify.py,sha256=e0j_Ec2gDDIVlnEO9tHQ0gjxzGm00NJbPVI5q4BuiHc,5653
taskgraph/util/workertypes.py,sha256=5g2mgIbEKMzDpZNnmPMoMNyy7Wahi-jmWcV1amDAcPo,2341
taskgraph/util/yaml.py,sha256=hfKI_D8Q7dimq4_VvO3WEh8CJsTrsIMwN6set7HIQbY,990
taskcluster_taskgraph-1.1.0.dist-info/METADATA,sha256=dFpakwX6tA0vOvp_EWb8jM1ywhfkhHrEq5z481yUdgE,730
taskcluster_taskgraph-1.1.0.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
taskcluster_taskgraph-1.1.0.dist-info/entry_points.txt,sha256=VoXNtZpN4LvyXYB1wq47AU9CO-DMYMJ0VktKxjugzbY,51
taskcluster_taskgraph-1.1.0.dist-info/top_level.txt,sha256=3JNeYn_hNiNXC7DrdH_vcv-WYSE7QdgGjdvUYvSjVp0,10
taskcluster_taskgraph-1.1.0.dist-info/RECORD,,
taskcluster_taskgraph-1.1.2.dist-info/METADATA,sha256=tvMbVqANNYWJoggoATAbfONPucjBXD5PNP9ahJCW1ZA,730
taskcluster_taskgraph-1.1.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
taskcluster_taskgraph-1.1.2.dist-info/entry_points.txt,sha256=VoXNtZpN4LvyXYB1wq47AU9CO-DMYMJ0VktKxjugzbY,51
taskcluster_taskgraph-1.1.2.dist-info/top_level.txt,sha256=3JNeYn_hNiNXC7DrdH_vcv-WYSE7QdgGjdvUYvSjVp0,10
taskcluster_taskgraph-1.1.2.dist-info/RECORD,,

View File

@ -1,5 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.37.0)
Generator: bdist_wheel (0.37.1)
Root-Is-Purelib: true
Tag: py3-none-any

View File

@ -67,7 +67,7 @@ def register_callback_action(
parameters as follows:
``parameters``:
Decision task parameters, see ``taskgraph.parameters.Parameters``.
Decision task :class:`parameters <taskgraph.parameters.Parameters>`.
``input``:
Input matching specified JSON schema, ``None`` if no ``schema``
parameter is given to ``register_callback_action``.
@ -78,55 +78,52 @@ def register_callback_action(
for, ``None`` if no ``context`` parameters was given to
``register_callback_action``.
Parameters
----------
name : str
An identifier for this action, used by UIs to find the action.
title : str
A human readable title for the action to be used as label on a button
or text on a link for triggering the action.
symbol : str
Treeherder symbol for the action callback, this is the symbol that the
task calling your callback will be displayed as. This is usually 1-3
letters abbreviating the action title.
description : str
A human readable description of the action in **markdown**.
This will be display as tooltip and in dialog window when the action
is triggered. This is a good place to describe how to use the action.
order : int
Order of the action in menus, this is relative to the ``order`` of
other actions declared.
context : list of dict
List of tag-sets specifying which tasks the action is can take as input.
If no tag-sets is specified as input the action is related to the
entire task-group, and won't be triggered with a given task.
Args:
name (str):
An identifier for this action, used by UIs to find the action.
title (str):
A human readable title for the action to be used as label on a button
or text on a link for triggering the action.
symbol (str):
Treeherder symbol for the action callback, this is the symbol that the
task calling your callback will be displayed as. This is usually 1-3
letters abbreviating the action title.
description (str):
A human readable description of the action in **markdown**.
This will be display as tooltip and in dialog window when the action
is triggered. This is a good place to describe how to use the action.
order (int):
Order of the action in menus, this is relative to the ``order`` of
other actions declared.
context (list of dict):
List of tag-sets specifying which tasks the action is can take as input.
If no tag-sets is specified as input the action is related to the
entire task-group, and won't be triggered with a given task.
Otherwise, if ``context = [{'k': 'b', 'p': 'l'}, {'k': 't'}]`` will only
be displayed in the context menu for tasks that has
``task.tags.k == 'b' && task.tags.p = 'l'`` or ``task.tags.k = 't'``.
Esentially, this allows filtering on ``task.tags``.
Otherwise, if ``context = [{'k': 'b', 'p': 'l'}, {'k': 't'}]`` will only
be displayed in the context menu for tasks that has
``task.tags.k == 'b' && task.tags.p = 'l'`` or ``task.tags.k = 't'``.
Esentially, this allows filtering on ``task.tags``.
If this is a function, it is given the decision parameters and must return
a value of the form described above.
available : function
An optional function that given decision parameters decides if the
action is available. Defaults to a function that always returns ``True``.
schema : dict
JSON schema specifying input accepted by the action.
This is optional and can be left ``null`` if no input is taken.
generic : boolean
Whether this is a generic action or has its own permissions.
cb_name : string
The name under which this function should be registered, defaulting to
`name`. This is used to generation actionPerm for non-generic hook
actions, and thus appears in ci-configuration and various role and hook
names. Unlike `name`, which can appear multiple times, cb_name must be
unique among all registered callbacks.
If this is a function, it is given the decision parameters and must return
a value of the form described above.
available (function):
An optional function that given decision parameters decides if the
action is available. Defaults to a function that always returns ``True``.
schema (dict):
JSON schema specifying input accepted by the action.
This is optional and can be left ``null`` if no input is taken.
generic (bool)
Whether this is a generic action or has its own permissions.
cb_name (str):
The name under which this function should be registered, defaulting to
`name`. This is used to generation actionPerm for non-generic hook
actions, and thus appears in ci-configuration and various role and hook
names. Unlike `name`, which can appear multiple times, cb_name must be
unique among all registered callbacks.
Returns
-------
function
To be used as decorator for the callback function.
Returns:
function: Decorator to be used for the callback function.
"""
mem = {"registered": False} # workaround nonlocal missing in 2.x
@ -262,15 +259,14 @@ def render_actions_json(parameters, graph_config, decision_task_id):
"""
Render JSON object for the ``public/actions.json`` artifact.
Parameters
----------
parameters : taskgraph.parameters.Parameters
Decision task parameters.
Args:
parameters (:class:`~taskgraph.parameters.Parameters`):
Decision task parameters.
Returns
-------
dict
JSON object representation of the ``public/actions.json`` artifact.
Returns:
dict:
JSON object representation of the ``public/actions.json``
artifact.
"""
assert isinstance(parameters, Parameters), "requires instance of Parameters"
actions = []

View File

@ -251,7 +251,8 @@ def relativize_datestamps(task_def):
def add_args_to_command(cmd_parts, extra_args=[]):
"""
Add custom command line args to a given command.
args:
Args:
cmd_parts: the raw command as seen by taskcluster
extra_args: array of args we want to add
"""

View File

@ -9,9 +9,8 @@ import collections
@attr.s(frozen=True)
class Graph:
"""
Generic representation of a directed acyclic graph with labeled edges
connecting the nodes. Graph operations are implemented in a functional
"""Generic representation of a directed acyclic graph with labeled edges
connecting the nodes. Graph operations are implemented in a functional
manner, so the data structure is immutable.
It permits at most one edge of a given name between any set of nodes. The
@ -21,27 +20,27 @@ class Graph:
The `nodes` and `edges` attributes may be accessed in a read-only fashion.
The `nodes` attribute is a set of node names, while `edges` is a set of
`(left, right, name)` tuples representing an edge named `name` going from
node `left` to node `right..
node `left` to node `right`..
"""
nodes = attr.ib(converter=frozenset)
edges = attr.ib(converter=frozenset)
def transitive_closure(self, nodes, reverse=False):
"""
Return the transitive closure of <nodes>: the graph containing all
"""Return the transitive closure of <nodes>: the graph containing all
specified nodes as well as any nodes reachable from them, and any
intervening edges.
If `reverse` is true, the "reachability" will be reversed and this
will return the set of nodes that can reach the specified nodes.
Example
-------
Example:
a ------> b ------> c
|
`-------> d
.. code-block::
a ------> b ------> c
|
`-------> d
transitive_closure([b]).nodes == set([a, b])
transitive_closure([c]).nodes == set([c, b, a])
@ -49,7 +48,10 @@ class Graph:
transitive_closure([b], reverse=True).nodes == set([b, c, d])
"""
assert isinstance(nodes, set)
assert nodes <= self.nodes
if not (nodes <= self.nodes):
raise Exception(
f"Unknown nodes in transitive closure: {nodes - self.nodes}"
)
# generate a new graph by expanding along edges until reaching a fixed
# point

View File

@ -1042,7 +1042,7 @@ def main(args):
try:
for k in ['MOZ_FETCHES_DIR', 'UPLOAD_DIR'] + [
'%_PATH'.format(repository['project'].upper()) for repository in repositories
'{}_PATH'.format(repository['project'].upper()) for repository in repositories
]:
if k in os.environ:
os.environ[k] = os.path.abspath(os.environ[k])

View File

@ -16,6 +16,9 @@ class TaskGraph:
A task graph is a combination of a Graph and a dictionary of tasks indexed
by label. TaskGraph instances should be treated as immutable.
In the graph, tasks are said to "link to" their dependencies. Whereas
tasks are "linked from" their dependents.
"""
tasks = attr.ib()

View File

@ -1132,7 +1132,7 @@ def chain_of_trust(config, tasks):
@transforms.add
def check_task_identifiers(config, tasks):
"""Ensures that all tasks have well defined identifiers:
^[a-zA-Z0-9_-]{1,38}$
``^[a-zA-Z0-9_-]{1,38}$``
"""
e = re.compile("^[a-zA-Z0-9_-]{1,38}$")
for task in tasks:

View File

@ -39,11 +39,10 @@ def resolve_timestamps(now, task_def):
def resolve_task_references(label, task_def, task_id, decision_task_id, dependencies):
"""Resolve all instances of
{'task-reference': '..<..>..'}
and
{'artifact-reference`: '..<dependency/artifact/path>..'}
in the given task definition, using the given dependencies"""
"""Resolve all instances of ``{'task-reference': '..<..>..'} ``
and ``{'artifact-reference`: '..<dependency/artifact/path>..'}``
in the given task definition, using the given dependencies.
"""
def task_reference(val):
def repl(match):

View File

@ -153,3 +153,20 @@ def rebase(oldbase, base, relativepath):
if relativepath.endswith("/") and not result.endswith("/"):
result += "/"
return result
def ancestors(path):
"""Emit the parent directories of a path.
Args:
path (str): Path to emit parents of.
Yields:
str: Path of parent directory.
"""
while path:
yield path
newpath = os.path.dirname(path)
if newpath == path:
break
path = newpath

View File

@ -161,7 +161,7 @@ def check_schema(schema):
)
)
if isinstance(sch, collections.Mapping):
if isinstance(sch, collections.abc.Mapping):
for k, v in sch.items():
child = f"{path}[{k!r}]"
check_identifier(child, k)

View File

@ -4,6 +4,8 @@
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
@ -11,7 +13,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(f"`{symbol}` is not a valid treeherder symbol.")
return groupSymbol, symbol
@ -49,7 +55,6 @@ def inherit_treeherder_from_dep(job, dep_job):
dep_th_collection = list(
dep_job.task.get("extra", {}).get("treeherder", {}).get("collection", {}).keys()
)[0]
# XXX Doesn't yet support non-opt
treeherder.setdefault("platform", f"{dep_th_platform}/{dep_th_collection}")
treeherder.setdefault(
"tier", dep_job.task.get("extra", {}).get("treeherder", {}).get("tier", 1)

View File

@ -11,6 +11,8 @@ from shutil import which
import requests
from redo import retry
from taskgraph.util.path import ancestors
PUSHLOG_TMPL = "{}/json-pushes?version=2&changeset={}&tipsonly=1&full=1"
@ -162,10 +164,11 @@ def get_repository(path):
"""Get a repository object for the repository at `path`.
If `path` is not a known VCS repository, raise an exception.
"""
if os.path.isdir(os.path.join(path, ".hg")):
return HgRepository(path)
elif os.path.exists(os.path.join(path, ".git")):
return GitRepository(path)
for path in ancestors(path):
if os.path.isdir(os.path.join(path, ".hg")):
return HgRepository(path)
elif os.path.exists(os.path.join(path, ".git")):
return GitRepository(path)
raise RuntimeError("Current directory is neither a git or hg repository")