Skip to content

Commit 0f46df6

Browse files
committed
fix!: only add target_tasks_method filter if no other filters were specified
BREAKING CHANGE: The target_tasks_method is now only implicitly added if no other filters exist. This is needed to fix a bug in Gecko's `./mach try` infrastructure, however the change makes sense on its own. Currently there's no way to forego target_tasks_method, and this allows us to do that. Furthermore, there are no other built-in filters, so it's unlikely that this will impact any existing consumers.
1 parent ea79a39 commit 0f46df6

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

docs/reference/migrations.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@ Migration Guide
33

44
This page can help when migrating Taskgraph across major versions.
55

6+
11.x -> 12.x
7+
------------
8+
9+
* Add ``target_tasks_method`` to the front of the ``filters`` parameter wherever
10+
you are also using a custom filter.
11+
12+
For example, if you are passing in:
13+
14+
.. code-block:: yaml
15+
16+
filters: ["my_custom_filter"]
17+
18+
Change it to:
19+
20+
.. code-block:: yaml
21+
22+
filters: ["target_tasks_method", "my_custom_filter"]
23+
24+
No action is necessary if the ``filters`` parameter was empty.
25+
626
10.x -> 11.x
727
------------
828

src/taskgraph/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ def _run(self):
269269
logger.debug(f"Dumping parameters:\n{repr(parameters)}")
270270

271271
filters = parameters.get("filters", [])
272-
# Always add legacy target tasks method until we deprecate that API.
273-
if "target_tasks_method" not in filters:
274-
filters.insert(0, "target_tasks_method")
272+
if not filters:
273+
# Default to target_tasks_method if none specified.
274+
filters.append("target_tasks_method")
275275
filters = [filter_tasks.filter_task_functions[f] for f in filters]
276276

277277
yield self.verify("parameters", parameters)

0 commit comments

Comments
 (0)