Update getResolverStrategy for rootRequirements - #3670
Merged
Conversation
When root requirement, us the resolver strategy for direct dependencies. Even if it also has other requirements
…File These should not be considered as "top level"
BlythMeister
force-pushed
the
topLevelMin
branch
from
September 27, 2019 11:21
79a7982 to
12748c2
Compare
These dependencies are specified in the dependencies file As a result, we should get the latest version of them
Contributor
Author
|
@forki this change does update tests...but i think that the tests contradict the documented behaviour. In these tests, the dependencies are specified in the paket.dependencies file |
…quirements is treated like a direct
Contributor
Author
|
Is there anything more needed from me to get this merged? |
forki
reviewed
Oct 2, 2019
| DependenciesFile.FromSource(config) | ||
| |> resolve graph2 UpdateMode.UpdateAll | ||
| getVersion resolved.[PackageName "Castle.Windsor"] |> shouldEqual "3.2.1" | ||
| getVersion resolved.[PackageName "Castle.Windsor"] |> shouldEqual "3.3.0" |
Member
There was a problem hiding this comment.
why is this increased? I thought we use min strategy?
Contributor
Author
There was a problem hiding this comment.
this test:
let graph2 =
OfSimpleGraph [
"Nancy.Bootstrappers.Windsor","0.23",["Castle.Windsor",VersionRequirement(VersionRange.AtLeast "3.2.1",PreReleaseStatus.No)]
"Castle.Windsor","3.2.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Windsor","3.2.1",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Windsor","3.3.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.3.0",PreReleaseStatus.No)]
"Castle.Windsor-NLog","3.2.0.1",["Castle.Core-NLog",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Windsor-NLog","3.3.0",["Castle.Core-NLog",VersionRequirement(VersionRange.AtLeast "3.3.0",PreReleaseStatus.No)]
"Castle.Core-NLog","3.2.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.2.0",PreReleaseStatus.No)]
"Castle.Core-NLog","3.3.0",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.3.0",PreReleaseStatus.No)]
"Castle.Core-NLog","3.3.1",["Castle.Core",VersionRequirement(VersionRange.AtLeast "3.3.1",PreReleaseStatus.No)]
"Castle.Core","3.2.0",[]
"Castle.Core","3.2.1",[]
"Castle.Core","3.2.2",[]
"Castle.Core","3.3.0",[]
"Castle.Core","3.3.1",[]
]
.....
[<Test>]
let ``should favor strategy from parent that overrides strategy``() =
let config = """
strategy max
source http://www.nuget.org/api/v2
nuget Nancy.Bootstrappers.Windsor !~> 0.23
nuget Castle.Windsor
nuget Castle.Windsor-NLog !> 0
"""
let resolved =
DependenciesFile.FromSource(config)
|> resolve graph2 UpdateMode.UpdateAll
getVersion resolved.[PackageName "Castle.Windsor"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Castle.Windsor-NLog"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Castle.Core-NLog"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Castle.Core"] |> shouldEqual "3.3.0"
getVersion resolved.[PackageName "Nancy.Bootstrappers.Windsor"] |> shouldEqual "0.23"
is set to max but more importantly has Castle.Windsor as a top level dependency. So should take the latest version
Member
|
thank you |
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.
When root requirement, us the resolver strategy for direct dependencies.
Even if it also has other requirements
Attempted fix for #3669
And meaning that the statement
that all direct dependencies will still get their latest matching versions, no matter the value of the strategy option. If you want to influence the resolution of direct dependencies then read about the lowest_matching option.in the docs is actually correct