Skip to content

fix(affected): Treat root internal dependency changes as global - #14156

Merged
anthonyshew merged 2 commits into
mainfrom
claude/repo-issue-diagnosis-xrzrsc
Sep 22, 2026
Merged

anthonyshew merged 2 commits into
mainfrom
claude/repo-issue-diagnosis-xrzrsc

Conversation

@anthonyshew

@anthonyshew anthonyshew commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

is_global_change in the task-level affected detector recognized root config files, the lockfile and globalDependencies, but not a change inside a package the root package.json depends on. Those files feed hashOfInternalDependencies, which is part of the global hash, so they change every task's hash.

The result was that turbo run --affected with futureFlags.affectedUsingTaskInputs selected only the changed package's tasks, while every other task's hash had changed and turbo query affected reported them all. The package-level path already handles this as AllPackageChangeReason::RootInternalDepChanged; this brings the task-level path in line. turbo watch with watchUsingTaskInputs and --filter=...[ref] with filterUsingTasks share the same function and are fixed too.

The check is a directory prefix match against root_internal_package_dependencies_paths(), which is exactly the set of directories the global hash walks.

Fixes #14151

`is_global_change` in the task-level affected detector recognized root
config files, the lockfile and `globalDependencies`, but not a change
inside a package the root `package.json` depends on. Those files feed
`hashOfInternalDependencies`, which is part of the global hash, so they
change every task's hash.

The result was that `turbo run --affected` with
`futureFlags.affectedUsingTaskInputs` selected only the changed
package's tasks, while every other task's hash had changed and
`turbo query affected` reported them all. The package-level path already
handles this as `AllPackageChangeReason::RootInternalDepChanged`; this
brings the task-level path in line. `turbo watch` with
`watchUsingTaskInputs` and `--filter=...[ref]` with `filterUsingTasks`
share the same function and are fixed too.

The check is a directory prefix match against
`root_internal_package_dependencies_paths()`, which is exactly the set
of directories the global hash walks.

Fixes #14151

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BtBxcwGiQoo1VdmzX5JXKA
@anthonyshew
anthonyshew requested review from a team and tknickman September 21, 2026 23:25
@vercel

vercel Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
examples-basic-web Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-designsystem-docs Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-gatsby-web Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-kitchensink-blog Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-nonmonorepo Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-svelte-web Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-tailwind-web Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
examples-vite-web Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
turbo-site Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC
turborepo-factory Ready Ready Preview, v0 Sep 22, 2026 2:17am UTC

@anthonyshew anthonyshew changed the title fix(affected): treat root internal dependency changes as global fix(affected): Treat root internal dependency changes as global Sep 22, 2026
@anthonyshew
anthonyshew merged commit 69b7c6b into main Sep 22, 2026
54 checks passed
@anthonyshew
anthonyshew deleted the claude/repo-issue-diagnosis-xrzrsc branch September 22, 2026 10:36
github-actions Bot added a commit that referenced this pull request Sep 22, 2026
## Release v2.11.3-canary.4

> [!CAUTION]
> Versioned docs aliasing FAILED. [View
logs](https://github.com/vercel/turborepo/actions/runs/35767518688)

### Changes

- chore: Release Turborepo 2.11.3-canary.3 (#14141) (`a3b6df8`)
- refactor: Extract prune orchestration (#14142) (`357e766`)
- ci: Update Node.js test matrices (#14139) (`b437bf1`)
- refactor: Add Turborepo run context crate (#14143) (`b8a9a8c`)
- refactor: Add repository run context (#14144) (`1876b23`)
- refactor: Use RepoContext in task graph visitor (#14145) (`a29a419`)
- refactor: Extract repository discovery from run builder (#14146)
(`82031c9`)
- refactor: Extract run execution context construction (#14147)
(`c3efb59`)
- refactor: Extract run services construction (#14148) (`0750df6`)
- refactor: Promote task graph to dedicated crate (#14150) (`d7e061b`)
- refactor: Extract run options into dedicated crate (#14152)
(`fb0a9ec`)
- docs: Remove duplicated word in the 1.9 blog post (#14129) (`3bf6ef8`)
- refactor: Promote run and watch to dedicated crates (#14153)
(`87bccbe`)
- refactor: Extract run command orchestration (#14154) (`1dead3c`)
- refactor: Rename `turborepo-lib` to `turborepo-cli` (#14155)
(`f81062f`)
- refactor: Slim query API interface (#14157) (`5614369`)
- fix(affected): Treat root internal dependency changes as global
(#14156) (`69b7c6b`)
- refactor: Move engine validation into turborepo-engine (#14158)
(`4f23af2`)
- test: Harden weak tests and shared assertion helpers (#14159)
(`ad8379b`)
- chore: Update with-rsbuild-module-federation example (#14160)
(`c079ed3`)
- perf: Reuse parsed lockfile during lazy graph loading (#14161)
(`dd1d31a`)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pull Bot pushed a commit to Dustin4444/turborepo that referenced this pull request Sep 22, 2026
## Release v2.11.3

> [!CAUTION]
> Versioned docs aliasing FAILED. [View
logs](https://github.com/vercel/turborepo/actions/runs/35779237464)

### Changes

- chore: Release Turborepo 2.11.2 (vercel#14107) (`bcc853c`)
- refactor: Remove experimental Cargo compile cache (vercel#14110) (`c14db49`)
- refactor: Remove clap from turborepo-types (vercel#14111) (`1fc6e60`)
- chore: Use canary turbo for Vercel builds (vercel#14112) (`d3b74e7`)
- refactor: Extract turborepo-tracing crate (vercel#14113) (`edc9f82`)
- refactor: Remove Run boundaries extension (vercel#14114) (`18c7be1`)
- refactor: Relocate child spawning to turborepo-process (vercel#14115)
(`5960801`)
- docs: Drop stale support-policy entry from getting-started nav
(vercel#14116) (`4735da1`)
- refactor: Move CLI configuration overrides into CLI (vercel#14119)
(`c61a4cb`)
- fix: Avoid microfrontend polyrepo warnings (vercel#14118) (`530f2eb`)
- refactor: Add run and execution selector DTOs (vercel#14120) (`b730cdb`)
- chore: Release Turborepo 2.11.3-canary.1 (vercel#14121) (`19afae0`)
- test: Reuse Go cache in invalidation test (vercel#14122) (`ba7f8a1`)
- chore: Release Turborepo 2.11.3-canary.2 (vercel#14124) (`cfe2f20`)
- test: Avoid overlapping concurrent cache restores (vercel#14125) (`da00de7`)
- refactor: Rewire Opts to consume selectors (vercel#14126) (`ae55ecc`)
- refactor: Extract task filtering into dedicated crate (vercel#14127)
(`6564345`)
- refactor: Extract task access into dedicated crate (vercel#14128)
(`c12b1f1`)
- refactor: Extract MicrofrontendsConfigs (vercel#14133) (`b5f9880`)
- chore: Update with-rollup example (vercel#14123) (`748aff9`)
- refactor: Move unified turbo.json loader (vercel#14134) (`c031520`)
- refactor: Extract package watcher crate (vercel#14135) (`88c2f90`)
- refactor: Extract prune input DTO (vercel#14136) (`307e2d2`)
- fix: Ignore gitignored files in boundaries (vercel#14137) (`773b3d9`)
- fix: Stabilize boundaries tag order in prune (vercel#14138) (`b64369e`)
- fix: Normalize affected task input globs (vercel#14140) (`00ee364`)
- chore: Release Turborepo 2.11.3-canary.3 (vercel#14141) (`a3b6df8`)
- refactor: Extract prune orchestration (vercel#14142) (`357e766`)
- ci: Update Node.js test matrices (vercel#14139) (`b437bf1`)
- refactor: Add Turborepo run context crate (vercel#14143) (`b8a9a8c`)
- refactor: Add repository run context (vercel#14144) (`1876b23`)
- refactor: Use RepoContext in task graph visitor (vercel#14145) (`a29a419`)
- refactor: Extract repository discovery from run builder (vercel#14146)
(`82031c9`)
- refactor: Extract run execution context construction (vercel#14147)
(`c3efb59`)
- refactor: Extract run services construction (vercel#14148) (`0750df6`)
- refactor: Promote task graph to dedicated crate (vercel#14150) (`d7e061b`)
- refactor: Extract run options into dedicated crate (vercel#14152)
(`fb0a9ec`)
- docs: Remove duplicated word in the 1.9 blog post (vercel#14129) (`3bf6ef8`)
- refactor: Promote run and watch to dedicated crates (vercel#14153)
(`87bccbe`)
- refactor: Extract run command orchestration (vercel#14154) (`1dead3c`)
- refactor: Rename `turborepo-lib` to `turborepo-cli` (vercel#14155)
(`f81062f`)
- refactor: Slim query API interface (vercel#14157) (`5614369`)
- fix(affected): Treat root internal dependency changes as global
(vercel#14156) (`69b7c6b`)
- refactor: Move engine validation into turborepo-engine (vercel#14158)
(`4f23af2`)
- test: Harden weak tests and shared assertion helpers (vercel#14159)
(`ad8379b`)
- chore: Update with-rsbuild-module-federation example (vercel#14160)
(`c079ed3`)
- perf: Reuse parsed lockfile during lazy graph loading (vercel#14161)
(`dd1d31a`)
- chore: Release Turborepo 2.11.3-canary.4 (vercel#14162) (`fb2fb0c`)
- fix: Stop with tasks when parent exits (vercel#14163) (`fde6637`)
- fix: Respect negated global dependencies in affected detection
(vercel#14164) (`83f6d32`)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – turborepo-factory cd391e73 Deployed Sep 22, 2026 by vercel[bot]
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.

affectedUsingTaskInputs: turbo run --affected skips tasks when a root internal dependency changes, while turbo query affected selects them

2 participants