Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: only add target_tasks_method filter if no other filters were sp… #600

Merged
merged 1 commit into from
Oct 25, 2024
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
20 changes: 20 additions & 0 deletions docs/reference/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ Migration Guide

This page can help when migrating Taskgraph across major versions.

11.x -> 12.x
------------

* Add ``target_tasks_method`` to the front of the ``filters`` parameter wherever
you are also using a custom filter.

For example, if you are passing in:

.. code-block:: yaml

filters: ["my_custom_filter"]

Change it to:

.. code-block:: yaml

filters: ["target_tasks_method", "my_custom_filter"]

No action is necessary if the ``filters`` parameter was empty.

10.x -> 11.x
------------

Expand Down
6 changes: 3 additions & 3 deletions src/taskgraph/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def _run(self):
logger.debug(f"Dumping parameters:\n{repr(parameters)}")

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

yield self.verify("parameters", parameters)
Expand Down
Loading