turbo
fedaafb2 - fix: Detect affected tasks with `$TURBO_ROOT$` inputs when using `affectedUsingTaskInputs` (#12331)

Commit
45 days ago
fix: Detect affected tasks with `$TURBO_ROOT$` inputs when using `affectedUsingTaskInputs` (#12331) ## Summary - Fixes `--affected` + `affectedUsingTaskInputs` not detecting tasks whose only changed input is a `$TURBO_ROOT$` file Closes #12329 ## Problem When `affectedUsingTaskInputs` is enabled, affected detection runs in two phases: 1. **Package-level scope resolution** determines which packages have changed files 2. **Task-level filtering** checks each engine task's `inputs` globs against the changed files The bug: phase 1 uses `GlobalDepsPackageChangeMapper` which, for a root-level file not in `globalDependencies`, only marks the root package as changed. Non-root packages are excluded from `filtered_pkgs`, so `build_engine()` never creates their tasks. When phase 2 runs, it iterates an engine that's already missing the tasks it needs to match. ## Fix When `affectedUsingTaskInputs` is active, the engine is now built with **all** packages instead of only the package-level filtered set. This lets `match_tasks_against_changed_files()` see every task — including those in packages whose own source files didn't change but whose `$TURBO_ROOT$` inputs did. The task-level filter then prunes down to only the truly affected tasks. ## Testing New integration test `test_task_level_affected_turbo_root_input`: - Sets up a monorepo where `build` tasks declare `$TURBO_ROOT$/rootconfig.txt` as an input - Changes only the root file (no package source changes) - Asserts both `lib-a#build` and `app-a#build` are detected as affected - Asserts `test` tasks (which don't reference the root file) are NOT affected This test fails without the fix (`task_ids` is empty) and passes with it.
Author
Parents
Loading