Skip to content

fix(core): resolve highest version when multiple versions exist in lock file#56

Merged
bug-ops merged 3 commits intomainfrom
fix/resolved-packages-duplicate-versions
Feb 16, 2026
Merged

fix(core): resolve highest version when multiple versions exist in lock file#56
bug-ops merged 3 commits intomainfrom
fix/resolved-packages-duplicate-versions

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 16, 2026

Summary

  • ResolvedPackages now stores all versions per package name internally (HashMap<String, Vec<ResolvedPackage>>)
  • get(), get_version(), iter(), into_map() return the highest semver version
  • Added best_package() helper with semver comparison and string fallback for non-semver versions
  • Added get_all() method to access all stored versions
  • All public API signatures preserved, no consumer changes needed

Fixes incorrect outdated status when both direct and transitive dependency versions of the same package coexist in the lock file. Affects all ecosystems (cargo, npm, pypi, go, bundler).

Test plan

  • cargo nextest run -p deps-core (203 tests pass)
  • cargo nextest run --workspace (977 tests pass)
  • cargo clippy --workspace -- -D warnings clean
  • New tests: multiple versions, non-semver fallback, semver preferred over non-semver

…ck file

ResolvedPackages now stores all versions per package name and returns
the highest semver version through public API. Fixes incorrect outdated
status when both direct and transitive dependency versions coexist in
the lock file.
@github-actions github-actions bot added rust Rust code changes needs-review Needs review size: M 50-200 lines changed labels Feb 16, 2026
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 16, 2026
@bug-ops bug-ops merged commit 0248f0d into main Feb 16, 2026
20 checks passed
@bug-ops bug-ops deleted the fix/resolved-packages-duplicate-versions branch February 16, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs-review Needs review rust Rust code changes size: M 50-200 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant