From 17cb09616b795058a21b19e23429b5939c7b7f7d Mon Sep 17 00:00:00 2001 From: Heitor Neiva Date: Mon, 6 Jan 2025 11:26:02 -0800 Subject: [PATCH] fix: Add False as option in from-deps set-name config (#621) --- src/taskgraph/transforms/from_deps.py | 1 + test/test_transforms_from_deps.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/taskgraph/transforms/from_deps.py b/src/taskgraph/transforms/from_deps.py index 0d9d0bc9e..ba46c16b3 100644 --- a/src/taskgraph/transforms/from_deps.py +++ b/src/taskgraph/transforms/from_deps.py @@ -48,6 +48,7 @@ ), ): Any( None, + False, *SET_NAME_MAP, {Any(*SET_NAME_MAP): object}, ), diff --git a/test/test_transforms_from_deps.py b/test/test_transforms_from_deps.py index 8e6699f82..87020c8b2 100644 --- a/test/test_transforms_from_deps.py +++ b/test/test_transforms_from_deps.py @@ -91,6 +91,12 @@ def assert_dont_set_name(tasks): assert tasks[0]["name"] == "a-special-name" +def assert_dont_set_name_false(tasks): + handle_exception(tasks) + assert len(tasks) == 1 + assert tasks[0]["name"] == "a-special-name" + + def assert_set_name_strip_kind(tasks): handle_exception(tasks) assert len(tasks) == 2 @@ -187,6 +193,21 @@ def assert_group_by_all_with_fetch(tasks): None, id="dont_set_name", ), + pytest.param( + # task + { + "name": "a-special-name", + "from-deps": { + "group-by": "all", + "set-name": False, + }, + }, + # kind config + None, + # deps + None, + id="dont_set_name_false", + ), pytest.param( # task {