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
3 changes: 2 additions & 1 deletion src/taskgraph/transforms/from_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def from_deps(config, tasks):
)
fetches_from_dep.append(entry)

task_fetches[dep_task.label] = fetches_from_dep
key = dep_task.kind if unique_kinds else dep_task.label
task_fetches[key] = fetches_from_dep

yield new_task
24 changes: 24 additions & 0 deletions test/test_transforms_from_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ def assert_group_by_all_with_fetch(deps, tasks):
}


def assert_unique_kinds_with_fetch(deps, tasks):
handle_exception(tasks)
assert tasks[0]["fetches"] == {"foo": [{"artifact": "foo.txt"}]}


@pytest.mark.parametrize(
"task, kind_config, deps",
(
Expand Down Expand Up @@ -423,6 +428,25 @@ def assert_group_by_all_with_fetch(deps, tasks):
},
id="group_by_all_with_fetch",
),
pytest.param(
# task
{
"from-deps": {
"kinds": ["foo"],
"unique-kinds": True,
"fetches": {
"foo": [
{"artifact": "foo.txt"},
],
},
},
},
# kind config
None,
# deps
None,
id="unique_kinds_with_fetch",
),
),
)
def test_transforms(
Expand Down
Loading