-
Notifications
You must be signed in to change notification settings - Fork 909
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
(#3451) Use availablePackages in GetPackageDependencies #3471
(#3451) Use availablePackages in GetPackageDependencies #3471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks good. I have a few questions I still need to formulate around the tests, but have a few comments/suggestions here at the moment.
As well as the noted requests, it seems that the integration tests have some failures here. It looks like at least one of them is a failing due to a change in behaviour here, and we'll need to determine if this is how we'd like to proceed.
You can run the integration tests with the build script by running: ./build.bat --target=test-nunit --exclusive --testExecutionType=all --shouldRunOpenCover=false
which will run all of the tests including integration. By default just the unit tests are run as the integration tests can take 20+ minutes.
The integration tests that are failing, are:
The more I look at them, the more I'm sure they're correct, and this PR will need to address the failures before we can look to merging it. All of them are in the |
Thanks for the integration test info. I get a 'Ya!' response from the tests when I run them using the command line build script, but I'm able to reproduce failures when I run some of the tests with Visual Studio. I've debugged enough to have some idea where this is going wrong and will look at possible changes. |
I've changed NugetService to use parentPackage.Version when calling FindPackage. It was using the version from the config to find the parent version, which resulted in a mismatch when searching for dependencies. An alternative solution would be to make the NugetCommon.GetPackageDependency change work independent of the state of the arguments passed in, but the use of parentPackage.Version seemed like it matches the intent of the NugetService code. |
Thank you for submitting this PR @josh-cooley. I've done some testing, and think it is just about ready for merging. I've been writing some Pester tests to encompass the manual testing mentioned above, as well as to pick up on at least one of the integration tests that had failed previously. I've pushed up the mentioned tests to your branch, so if you have any further changes you've made, you may need to fetch the changes and rebase some things. |
465bf93
to
ae7fb56
Compare
@josh-cooley, I have rebased your PR off of the latest develop and force pushed it to your fork. I don't expect you to be making further changes to the PR, but in case you were I wanted to let you know. (Normally I would try to avoid a force push to someone else's fork if I wasn't going to be merging immediately, but I have integrations I want to run with the rebased branch) |
@corbob Thanks for the thorough review and adding the additional Pester tests. I do not have any additional changes pending. If you have additional changes you'd like me to make, please let me know. |
ae7fb56
to
fbd704a
Compare
I have converted this PR to a draft. This is because there is still some discussion to be had of if we target this as a bug or an improvement. Setting the PR to draft will prevent us from merging it until we have targetted the appropriate branch based on the classification. |
This updates the dependency handling of packages to use availablePackages when a package from the same source satisfies the dependency. This improves packages that have dependencies with many versions available, and allows less data being requested from servers in the case we have already have available packages from the source. Without this fix, the installation will be delayed with repeated resolution of the same package dependencies. Use parentPackage version when finding the parent package.
fbd704a
to
56893a2
Compare
This commit adds pester tests and files required for the pester tests. The tests include ensuring that installing a package that contains a dependency tree that spans lots of versions does not take unnecessarily long. As well as duplicating an integration test into the pester tests to provide us with some belt and suspenders to help us catch issues at both the integration and the pester test levels.
56893a2
to
9400fde
Compare
Thank you very much for getting this fixed up @josh-cooley 👍 |
Description Of Changes
This updates the dependency handling of packages to use availablePackages when a package from the same source satisfies the dependency. This improves packages that have dependencies with many versions available, and allows less data being requested from servers in the case we have already have available packages from the source.
Without this fix, the installation will be delayed with repeated resolution of the same package dependencies.
Motivation and Context
Installation of packages with many dependent versions available without reducing repeat calls to ResolvePackages
Testing
choco upgrade package-a --yes --source <path-to-demo-projects>
Repeat test with delivered chocolatey 2.3 and see that the install takes much longer.
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #3451