feat: Add circular package dependency detection to boundaries#12567
Merged
anthonyshew merged 2 commits intomainfrom Apr 6, 2026
Merged
feat: Add circular package dependency detection to boundaries#12567anthonyshew merged 2 commits intomainfrom
anthonyshew merged 2 commits intomainfrom
Conversation
Adds a new CircularDependency rule to turbo boundaries that detects circular package dependency chains using Tarjan's SCC algorithm. Previously, cycles were only logged as warnings during package graph validation — now they surface as actionable diagnostics. Also adds a vscode module exception to the NotTypeOnlyImport rule (matching existing bun builtin pattern) and fixes a progress bar count mismatch where root package was included in the total but skipped during checking.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
trace_cycle_path was non-deterministic because it started from HashSet::iter().next() (random seed) and followed arbitrary edges. On Ubuntu CI, this caused test_find_cycles_complex_scc to trace only 3 of 4 SCC members. Fix: start from min(NodeIndex) and always pick the smallest NodeIndex neighbor. Relax the complex SCC test to accept that a traced path through a multi-cycle SCC may cover a subset of members.
github-actions Bot
added a commit
that referenced
this pull request
Apr 6, 2026
## Release v2.9.5-canary.3 Versioned docs: https://v2-9-5-canary-3.turborepo.dev ### Changes - release(turborepo): 2.9.5-canary.2 (#12566) (`8479f02`) - feat: Add circular package dependency detection to boundaries (#12567) (`217d486`) - perf: Increase remote cache upload chunk size from 8KB to 256KB (#12568) (`374f7a7`) Co-authored-by: Turbobot <turbobot@vercel.com>
github-actions Bot
added a commit
that referenced
this pull request
Apr 7, 2026
## Release v2.9.5 Versioned docs: https://v2-9-5.turborepo.dev ### Changes - release(turborepo): 2.9.4 (#12559) (`20dfb78`) - feat: Replace package manager commands in scaffolded README files (#6747) (`8f6f012`) - release(turborepo): 2.9.5-canary.1 (#12564) (`891188e`) - chore: Remove top issues Slack notification (#12565) (`49e484f`) - release(turborepo): 2.9.5-canary.2 (#12566) (`8479f02`) - feat: Add circular package dependency detection to boundaries (#12567) (`217d486`) - perf: Increase remote cache upload chunk size from 8KB to 256KB (#12568) (`374f7a7`) - release(turborepo): 2.9.5-canary.3 (#12570) (`0387bad`) - perf: Parallelize `boundaries` checking with Rayon and cache DFS traversals (#12569) (`7830df4`) - release(turborepo): 2.9.5-canary.4 (#12571) (`53eb059`) - fix: Normalize CRLF line endings in file hashing to match git (#12572) (`1403c9e`) - release(turborepo): 2.9.5-canary.5 (#12574) (`f0e18d2`) - fix: Suppress telemetry alert when running on Vercel (#12576) (`ecb1040`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CircularDependencyrule toturbo boundariesthat detects circular package dependency chains using Tarjan's SCC algorithm. Previously, cycles were only logged astracing::warn!()during package graph validation — now they surface as actionable diagnostics.vscodemodule exception to theNotTypeOnlyImportrule (matching existingbunbuiltin pattern), since VS Code extensions use@types/vscodefor type-checking butvscodeis a runtime-provided module.How to test
Build and run
turbo boundariesagainst a monorepo with circular package dependencies:Or run the new tests directly: