Add local package patterns to source-mappings for online feeds #44076
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.
Fixes: dotnet/source-build#4651
This was a bug in original implementation (ddfd74a), that was not noticed in source-build, due to limited number of repos using package source mappings. Code had a correct comment describing the behavior, and now the implementation matches that intent.
In online builds, if a repo has package source-mappings, it could cause issues in unified build due to the way we update NuGet.config to add package source mappings for all feeds. All packages built locally should also be added as package-source mapping patterns to online feeds, so any package with a different version can be resolved from those online feeds.
This code is complex. It was added to original, old, codebase with ddfd74a. Due to limited time available for that feature, new code was implemented in a way that followed the original design. This is not easy to maintain and should be refactored - I've created the issue to track that work: dotnet/source-build#4666