fix(config): preserve broad dependency aliases#15872
Open
mablr wants to merge 1 commit into
Open
Conversation
Keep broader auto-detected dependency remappings when a narrower project remapping already covers part of the namespace. Root mappings remain authoritative over equal or more specific dependency aliases.
mablr
requested review from
0xrusowsky,
DaniPopes,
figtracer,
grandizzy,
mattsse and
stevencartavia
as code owners
July 23, 2026 19:03
mablr
marked this pull request as draft
July 23, 2026 19:03
mablr
marked this pull request as ready for review
July 24, 2026 07:51
mablr
enabled auto-merge (squash)
July 24, 2026 11:01
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.
Motivation
Close OSS-581
This preserves broader auto-detected dependency remappings when the root project defines a narrower alias in the same namespace. The narrower root mapping remains authoritative through longest-prefix resolution, while the broader dependency mapping provides a fallback for imports outside that subtree. Root mappings still suppress equal or more specific dependency aliases, preserving the existing protection against dependencies overriding project code. Carefully assessed it will not reopen #9146.
For example,
pkg/sub/=src/local/can now coexist withpkg/=lib/pkg/src/: imports underpkg/sub/resolve locally, while otherpkg/imports resolve from the dependency.