Skip to content

build(turbo): select affected tasks by their declared inputs - #113

Merged
systemfsoftware-bot merged 1 commit into
mainfrom
build/turbo-affected-task-inputs
Nov 13, 2026
Merged

systemfsoftware-bot merged 1 commit into
mainfrom
build/turbo-affected-task-inputs

Conversation

@systemfsoftware-bot

Copy link
Copy Markdown
Contributor

What changes

turbo.json enables futureFlags.affectedUsingTaskInputs. turbo run --affected then matches each changed file against each task's inputs instead of selecting every task of the package that owns the file, plus all of its dependents.

Evidence

Measured with turbo 2.11.10, turbo query on this repository. The probe commits one appended line to the named file on top of the base, then runs:

turbo query 'query { affectedTasks(base: "<base>", head: "HEAD", tasks: ["typecheck", "lint", "attw"]) { length items { fullName reason { __typename } } } }'
turbo query 'query { affectedTasks(base: "<base>", head: "HEAD", tasks: ["test"]) { length items { fullName reason { __typename } } } }'
Changed file typecheck/lint/attw before → after test before → after Reasons before Reasons after
packages/arethetypeswrong/README.md 9 → 0 4 → 0 TaskAllChanged 9 none
packages/arethetypeswrong/src/Analysis/mod.ts 9 → 9 4 → 4 TaskAllChanged 1, TaskDependencyTaskChanged 5, TaskFileChanged 3 TaskAllChanged 1, TaskDependencyTaskChanged 5, TaskFileChanged 3

Before is the default branch, after is this branch. A source change selects the same tasks with and without the flag; a file that no task lists in its inputs stops selecting tasks.

Real ranges from this repository's history, replayed with the flag applied to both ends:

Range typecheck/lint/attw before → after test before → after
d1e227d51a..05349db3f3 9 → 0 5 → 0
9e702e4309..821d1e6626 9 → 8 2 → 2

TaskAllChanged with the description package is affected is the package-level selection this removes.

Enable futureFlags.affectedUsingTaskInputs so `turbo run --affected`
matches each changed file against each task's `inputs` instead of
selecting every task of the package that owns the file. A change that
no task reads, such as a package README, no longer runs that
package's tasks or its dependents' tasks.
@systemfsoftware-bot
systemfsoftware-bot merged commit 296716f into main Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant