Skip to content

Commit

Permalink
style: pre-commit.ci auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 10, 2024
1 parent 4e1bb62 commit e290224
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions taskcluster/fxci_config_taskgraph/util/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from functools import cache
import os
import re
from typing import Any, Union
from functools import cache
from typing import Any

import os
import requests
import taskcluster
from taskgraph.util.taskcluster import get_ancestors as taskgraph_get_ancestors
Expand All @@ -15,7 +15,7 @@
STAGING_ROOT_URL = "https://stage.taskcluster.nonprod.cloudops.mozgcp.net"


def get_ancestors(task_ids: Union[list[str], str]) -> dict[str, str]:
def get_ancestors(task_ids: list[str] | str) -> dict[str, str]:
# TODO: this is not ideal, but at the moment we don't have a better way
# to ensure that the upstream get_ancestors talks to the correct taskcluster
# instance.
Expand All @@ -28,14 +28,17 @@ def get_ancestors(task_ids: Union[list[str], str]) -> dict[str, str]:

return ret


@cache
def get_taskcluster_client(service: str):
options = {"rootUrl": FIREFOXCI_ROOT_URL}
return getattr(taskcluster, service.capitalize())(options)


@cache
def find_tasks(decision_index_path: str, include_deps: list[re.Pattern] = []) -> list[dict[str, Any]]:
def find_tasks(
decision_index_path: str, include_deps: list[re.Pattern] = []
) -> list[dict[str, Any]]:
"""Find tasks targeted by the Decision task pointed to by `decision_index_path`."""
queue = get_taskcluster_client("queue")
index = get_taskcluster_client("index")
Expand Down

0 comments on commit e290224

Please sign in to comment.