-
Notifications
You must be signed in to change notification settings - Fork 904
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
(#3237) Reduce number of queries for dependencies #3260
Conversation
595985d
to
f4f25f6
Compare
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.
few tiny things
Logic is Not Fun to look through and duplication is... well. 😔
But if it works 😁
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.
Seems to work as described. Great work figuring out a way this can be improved!
When attempting to figure out what packages need to be verified/checked during a package upgrade operation, we were previously fetching information about all package versions for all "parent packages" (i.e. packages that include a dependency on the package being acted on). This causes a problem when doing something like `choco upgrade chocolatey` when you have the chromium package installed. When in this situation, due to the high number of package versions for chromium and the fact that it takes a dependency on Chocolatey, the number of queries that are emitted for Chocolatey CLI is very large. This makes it appear as though the operation has stalled, when in actual fact it is just working its way through the queries (this can be verified by looking at the requests through fiddler when this command is running). This commit attempt to address this problem by changing to only query for the latest package version (and/or the requested package version) when attempting the look up for the parent package dependencies. This greatly reduces the number of outgoing queries, but it also means that it is possible for things to not work correctly due to not all package information being available. To guard against this, a fallback has been put in place such that if the initial attempt at resolving the solution fails, it goes back and fetches information about all package versions for the parent packages, and attempt to gather the resolve the solution again. This change has been made in a way that there is some code duplication, however, based on some discussion within the team, the way that this method is written needs to be overhauled, and now is not the right time to do this. Instead, we are accepting the duplication, until some effort can be put in to overhaul this method completely.
d6540ed
to
46edab5
Compare
@gep13 I've gone ahead and rebased this branch so we can merge it |
Description Of Changes
This commit attempt to address this problem by changing to only query for the latest package version (and/or the requested package version) when attempting the look up for the parent package dependencies. This greatly reduces the number of outgoing queries, but it also means that it is possible for things to not work correctly due to not all package information being available. To guard against this, a fallback has been put in place such that if the initial attempt at resolving the solution fails, it goes back and fetches information about all package versions for the parent packages, and attempt to gather the resolve the solution again.
This change has been made in a way that there is some code duplication, however, based on some discussion within the team, the way that this method is written needs to be overhauled, and now is not the right time to do this. Instead, we are accepting the duplication, until some effort can be put in to overhaul this method completely.
Motivation and Context
When attempting to figure out what packages need to be verified/checked during a package upgrade operation, we were previously fetching information about all package versions for all "parent packages" (i.e. packages that include a dependency on the package being acted on). This causes a problem when doing something like
choco upgrade chocolatey
when you have the chromium package installed. When in this situation, due to the high number of package versions for chromium and the fact that it takes a dependency on Chocolatey, the number of queries that are emitted for Chocolatey CLI is very large. This makes it appear as though the operation has stalled, when in actual fact it is just working its way through the queries (this can be verified by looking at the requests through fiddler when this command is running).Testing
choco upgrade chocolatey
command through Visual Studio debuggingchoco install notepadplusplus --version 8.4.5
through Visual Studio debuggingchoco upgrade notepadplusplus.install --version 8.5.1
through Visual Studio debuggingchoco upgrade notepadplusplus.install
through Visual Studio debuggingchoco upgrade chocolatey --version 2.1.0
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #3237