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 Jan 22, 2025
1 parent 2367f90 commit cf5dc54
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def make_firefoxci_artifact_tasks(config, tasks):
include_attrs = task.pop("include-attrs", {})
exclude_attrs = task.pop("exclude-attrs", {})
include_deps = task.pop("include-deps", [])
mirror_public_artifacts = [re.compile(r) for r in task.pop("mirror-public-artifacts", [])]
mirror_public_artifacts = [
re.compile(r) for r in task.pop("mirror-public-artifacts", [])
]
for decision_index_path in task.pop("decision-index-paths"):
for _, task_def in find_tasks(
decision_index_path,
Expand All @@ -50,7 +52,12 @@ def make_firefoxci_artifact_tasks(config, tasks):
)
for fetch in fetches:
if fetch["artifact"].startswith("public"):
if not any([pat.match(task_def["metadata"]["name"]) for pat in mirror_public_artifacts]):
if not any(
[
pat.match(task_def["metadata"]["name"])
for pat in mirror_public_artifacts
]
):
continue

task_id = fetch["task"]
Expand Down
25 changes: 21 additions & 4 deletions taskcluster/fxci_config_taskgraph/transforms/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ def rewrite_mirrored_dependencies(
taskdesc["dependencies"][upstream_task_label] = upstream_task_label

artifact_task_label = f"firefoxci-artifact-{prefix}-{upstream_task_id}"
if artifact_task_label in artifact_tasks and artifact_task_label not in taskdesc["dependencies"].values():
if (
artifact_task_label in artifact_tasks
and artifact_task_label not in taskdesc["dependencies"].values()
):
mirrored_deps.add(upstream_task_id)
taskdesc["dependencies"][artifact_task_label] = artifact_task_label

Expand Down Expand Up @@ -317,7 +320,12 @@ def make_integration_test_description(
rewrite_docker_image(taskdesc)
rewrite_private_fetches(taskdesc)
rewrite_mirrored_dependencies(
taskdesc, name_prefix, orig_dependencies, tasks, include_deps, artifact_tasks,
taskdesc,
name_prefix,
orig_dependencies,
tasks,
include_deps,
artifact_tasks,
)
return taskdesc

Expand All @@ -330,7 +338,11 @@ def schedule_tasks_at_index(config, tasks):
if os.environ["TASKCLUSTER_ROOT_URL"] != STAGING_ROOT_URL:
return

artifact_tasks = {k: v for k, v in config.kind_dependencies_tasks.items() if k.startswith("firefoxci-artifact")}
artifact_tasks = {
k: v
for k, v in config.kind_dependencies_tasks.items()
if k.startswith("firefoxci-artifact")
}
for task in tasks:
include_attrs = task.pop("include-attrs", {})
exclude_attrs = task.pop("exclude-attrs", {})
Expand All @@ -347,5 +359,10 @@ def schedule_tasks_at_index(config, tasks):
# task_def is copied to avoid modifying the version in `tasks`, which
# may be used to modify parts of the new task description
yield make_integration_test_description(
copy.deepcopy(task_def), task["name"], found_tasks, include_deps, patch_root_url, artifact_tasks
copy.deepcopy(task_def),
task["name"],
found_tasks,
include_deps,
patch_root_url,
artifact_tasks,
)

0 comments on commit cf5dc54

Please sign in to comment.