fix(update-deps): pick highest version when source workspace has duplicate package names - #11
Closed
pyramation wants to merge 1 commit into
Closed
fix(update-deps): pick highest version when source workspace has duplicate package names#11pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
…icate package names
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
update-depsbuilds asourceMapfrom allpackage.jsonfiles in the source workspace, keyed by package name. When the same package name appears multiple times — for examplepgsql-deparserinpackages/deparserpluspackages/deparser/versions/{13,14,15,16}— the last entry in the discovery order overwrote the map entry. That causedavailableVersionto be a stale version (e.g.13.19.1) even though the latest version (18.1.1) existed in the same workspace.Now
sourceMapselects the highest semver version per package name, so^18.1.1dependencies correctly resolve to18.1.1instead of a legacy version from a versioned subdirectory.Also added
compareSemverand reused it insideisOutdatedto keep version comparison in one place. A test now covers the duplicate-name case.Link to Devin session: https://app.devin.ai/sessions/170bdcd5135649468b4bd7d1074f36be
Requested by: @pyramation