Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix floating version functionality for FloatingBehavior.AbsoluteLatest in new dependency graph resolver #6070

Merged
merged 7 commits into from
Oct 3, 2024

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Oct 1, 2024

Bug

Fixes: NuGet/Home#13830

Description

RemoteDependencyWalker.IsEqualToOrGreaterThan() is calculating whether or not a VersionRange is equal to or greater than another VersionRange incorrectly in the case of * or *-*. For ranges like 1.* or 1.0.*, it treats the star as "highest possible" by converting the version range to use Int.MaxValue for the parts of the version that are floating. However, for something like * or *-*, it falls back to just using the specified values and it uses 0.0.0.0 instead which is always treated as lower. This makes the new dependency resolver pick the wrong versions or improperly detect downgrades.

The change is to treat * or *-* as Int.MaxValue.Int.MaxValue.Int.MaxValue.Int.MaxValue, essentially the highest possible version range.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@jeffkl jeffkl self-assigned this Oct 1, 2024
@jeffkl jeffkl force-pushed the dev-jeffkl-dependency-resolver-floating-versions branch from 4704217 to 2964cf1 Compare October 2, 2024 17:32
@jeffkl jeffkl marked this pull request as ready for review October 2, 2024 18:59
@jeffkl jeffkl requested a review from a team as a code owner October 2, 2024 18:59
@jeffkl jeffkl changed the title Fix floating version functionality in new dependency graph resolver Fix floating version functionality for FloatingBehavior.AbsoluteLatest in new dependency graph resolver Oct 2, 2024
@jeffkl jeffkl force-pushed the dev-jeffkl-dependency-resolver-floating-versions branch from f60415b to 00e6f96 Compare October 3, 2024 16:57
@jeffkl jeffkl force-pushed the dev-jeffkl-dependency-resolver-floating-versions branch from 00e6f96 to 247f36b Compare October 3, 2024 17:39
@jeffkl jeffkl enabled auto-merge (squash) October 3, 2024 18:13
@jeffkl jeffkl merged commit 0cccbcb into dev Oct 3, 2024
28 checks passed
@jeffkl jeffkl deleted the dev-jeffkl-dependency-resolver-floating-versions branch October 3, 2024 18:36
jeffkl added a commit that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New dependency resolver does not properly handle floating versions representing AbsoluteLatest
2 participants