Skip to content

Commit

Permalink
ci(integration): turn firefoxci-artifact tasks into cached_tasks (moz…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahal authored Dec 11, 2024
1 parent 2cd57e3 commit 0d3cf5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 13 additions & 3 deletions taskcluster/fxci_config_taskgraph/transforms/firefoxci_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,18 @@ def make_firefoxci_artifact_tasks(config, tasks):
tasks_to_create[task_id].append(fetch["artifact"])

for task_id, artifacts in tasks_to_create.items():
name = f"{task['name']}-{task_id}"
new_task = deepcopy(task)
new_task["label"] = f"firefoxci-artifact-{task['name']}-{task_id}"
new_task["label"] = f"firefoxci-artifact-{name}"

# Used by cached_tasks transforms. It's ok for digest-data to be
# empty because all the information that could impact this task is
# already in the "name", which is already part of the index path.
new_task["cache"] = {
"digest-data": [],
"name": name,
"type": "firefoxci-artifact.v1",
}

env = new_task["worker"]["env"]
env["FETCH_FIREFOXCI_TASK_ID"] = task_id
Expand All @@ -62,12 +72,12 @@ def make_firefoxci_artifact_tasks(config, tasks):
artifact_dir = env["MOZ_ARTIFACT_DIR"]
new_task["worker"]["artifacts"] = []
for artifact in artifacts:
name = artifact.rsplit("/", 1)[-1]
artifact_name = artifact.rsplit("/", 1)[-1]
new_task["worker"]["artifacts"].append(
{
"type": "file",
"name": artifact,
"path": f"{artifact_dir}/{name}",
"path": f"{artifact_dir}/{artifact_name}",
}
)
yield new_task
2 changes: 2 additions & 0 deletions taskcluster/kinds/firefoxci-artifact/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ loader: taskgraph.loader.transform:loader

transforms:
- fxci_config_taskgraph.transforms.firefoxci_artifact
- taskgraph.transforms.cached_tasks
- taskgraph.transforms.run
- taskgraph.transforms.task

task-defaults:
attributes: {} # cached_tasks transforms assume this exists
worker-type: t-linux
worker:
docker-image: {in-tree: python3.11}
Expand Down

0 comments on commit 0d3cf5e

Please sign in to comment.