turbo ls --affected shows all packages when changing files in the packages/ directory but works correctly for apps/ directory
#11533
-
Summary
Expected: Only the changed package (and its dependents) should be marked affected. Actual: All 10 packages are marked affected. Environment
Steps to reproduce# Change a single file in packages/component-library
git diff dev --name-only # Shows only one changed file
TURBO_SCM_BASE=dev pnpm turbo ls --affected # Shows all 10 packagesInvestigationI ran // packages/theme — has root dependency
{
"name": "@myscope/theme",
"directDependencies": {
"items": [{ "name": "//" }]
}
}// apps/webapp — no root dependency
{
"name": "@myscope/webapp",
"directDependencies": {
"items": [
{ "name": "@myscope/core" },
{ "name": "@myscope/theme" }
]
}
}Questions
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
this is a known behavior tied to how turbo builds its dependency graph, and there's likely a known bug amplifying it. why it happenswhen turbo computes
step 4 is the key. in if internal.is_empty() {
// packages with no internal deps get connected to root
self.workspace_graph.add_edge(*node_idx, *root_idx, ());
}so every leaf package in the bug that's probably making this worsethere's a confirmed bug in vercel/turborepo#11144 where turbo's internal file change detection can falsely flag the root the symptoms match your case exactly. how to verifyrun with trace logging to see what's happening under the hood: TURBO_LOG_VERBOSITY=trace TURBO_SCM_BASE=dev pnpm turbo ls --affected 2>&1 | grep -E "changed files|global file|all packages"if you see something like workarounds1. use explicit turbo ls --filter=...[dev...HEAD]2. make sure you have full git history: the docs warn that shallow clones cause all packages to be marked changed. in CI: # github actions
- uses: actions/checkout@v4
with:
fetch-depth: 03. set explicit base/head refs: TURBO_SCM_BASE=dev TURBO_SCM_HEAD=HEAD turbo ls --affectedthe root dependency edge is by designthe links |
Beta Was this translation helpful? Give feedback.
-
|
Hey both, the linked issue is fixed. In the future, please use Issues when reporting issues. Thank you! |
Beta Was this translation helpful? Give feedback.
Hey both, the linked issue is fixed. In the future, please use Issues when reporting issues. Thank you!