Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
]
requires-python = ">=3.9"
dependencies = [
"taskcluster-taskgraph>=16.2.1,<19",
"taskcluster-taskgraph>=19,<20",
]

[project.urls]
Expand Down
4 changes: 2 additions & 2 deletions src/mozilla_taskgraph/transforms/replicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
from taskcluster.exceptions import TaskclusterRestFailure
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.attributes import attrmatch
from taskgraph.util.schema import Schema
from taskgraph.util.schema import LegacySchema
from taskgraph.util.taskcluster import (
find_task_id,
get_artifact,
get_task_definition,
)
from voluptuous import ALLOW_EXTRA, Any, Optional, Required

REPLICATE_SCHEMA = Schema(
REPLICATE_SCHEMA = LegacySchema(
{
Required(
"replicate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

from taskgraph.transforms.base import TransformSequence
from taskgraph.transforms.task import task_description_schema
from taskgraph.util.schema import Schema
from taskgraph.util.schema import LegacySchema
from taskgraph.util.workertypes import worker_type_implementation
from voluptuous import Extra, Optional, Required

transforms = TransformSequence()

release_artifacts_schema = Schema(
release_artifacts_schema = LegacySchema(
{
Required("worker-type"): task_description_schema["worker-type"],
Optional("release-artifacts"): [str],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from textwrap import dedent

from taskgraph.transforms.base import TransformSequence
from taskgraph.util.schema import Schema, optionally_keyed_by, resolve_keyed_by
from taskgraph.util.schema import LegacySchema, optionally_keyed_by, resolve_keyed_by
from voluptuous import Extra, Optional

transforms = TransformSequence()

mark_as_shipped_schema = Schema(
mark_as_shipped_schema = LegacySchema(
{
Optional("name"): str,
Optional("shipit-product"): optionally_keyed_by("build-type", str),
Expand Down
27 changes: 12 additions & 15 deletions test/actions/test_release_promotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,22 @@ def inner(previous_graphs=None):
)

# Only the parameters from the first previous graph is downloaded.
responses.add(
method="GET",
url=f"{tc_url}/api/queue/v1/task/{list(previous_graphs.keys())[0]}/artifacts/public%2Fparameters.yml",
json=parameters,
)
# get_artifact does a two-step fetch: getLatestArtifact returns
# {"url": url}, then the content is fetched from that url.
url = f"{tc_url}/api/queue/v1/task/{list(previous_graphs.keys())[0]}/artifacts/public%2Fparameters.yml"
responses.add(method="GET", url=url, json={"url": url})
responses.add(method="GET", url=url, json=parameters)

tid = count(0)
for decision_id, full_task_graph in previous_graphs.items():
responses.add(
method="GET",
url=f"{tc_url}/api/queue/v1/task/{decision_id}/artifacts/public%2Ffull-task-graph.json",
json=full_task_graph.to_json(),
)
url = f"{tc_url}/api/queue/v1/task/{decision_id}/artifacts/public%2Ffull-task-graph.json"
responses.add(method="GET", url=url, json={"url": url})
responses.add(method="GET", url=url, json=full_task_graph.to_json())

label_to_taskid = {label: int(next(tid)) for label in full_task_graph.tasks}
responses.add(
method="GET",
url=f"{tc_url}/api/queue/v1/task/{decision_id}/artifacts/public%2Flabel-to-taskid.json",
json=label_to_taskid,
)
url = f"{tc_url}/api/queue/v1/task/{decision_id}/artifacts/public%2Flabel-to-taskid.json"
responses.add(method="GET", url=url, json={"url": url})
responses.add(method="GET", url=url, json=label_to_taskid)

return inner

Expand Down
14 changes: 8 additions & 6 deletions test/transforms/test_replicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,11 @@ def test_decision_task(responses, run_replicate):
expected = get_expected(prefix, *task_defs)

counter = count()
responses.get(
f"{TC_ROOT_URL}/api/queue/v1/task/{task_id}/artifacts/public%2Ftask-graph.json",
json={next(counter): task_def for task_def in task_defs},
url = (
f"{TC_ROOT_URL}/api/queue/v1/task/{task_id}/artifacts/public%2Ftask-graph.json"
)
responses.get(url, json={"url": url})
responses.get(url, json={next(counter): task_def for task_def in task_defs})
result = run_replicate(task)
assert result == expected

Expand Down Expand Up @@ -269,9 +270,10 @@ def test_filtered_out(responses, run_replicate, target_def):
task_defs = get_target_defs(target_def)

counter = count()
responses.get(
f"{TC_ROOT_URL}/api/queue/v1/task/{task_id}/artifacts/public%2Ftask-graph.json",
json={next(counter): task_def for task_def in task_defs},
url = (
f"{TC_ROOT_URL}/api/queue/v1/task/{task_id}/artifacts/public%2Ftask-graph.json"
)
responses.get(url, json={"url": url})
responses.get(url, json={next(counter): task_def for task_def in task_defs})
result = run_replicate(task)
assert len(result) == 0
Loading