-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use package tracking data to correlate in CompositeSource #1671
Conversation
This comment has been minimized.
This comment has been minimized.
static PackageTrackingCatalog CreateForSource(const Source& source); | ||
|
||
// Removes the package tracking catalog for a given source. | ||
// Removes the package tracking catalog for a given source identifier. | ||
static void RemoveForSource(const std::string& identifier); |
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.
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.
Not sure, but since I wanted to use it in the tests I implemented it here. We could call it as part of removing a source, but I wasn't sure if that was the right thing to do.
{ | ||
auto compositePackage = std::make_shared<CompositePackage>( | ||
std::move(installedPackage), | ||
GetTrackedPackageFromAvailableSource(result, source, match.Package->GetProperty(PackageProperty::Id))); |
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.
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.
Actually, this might cause some upgrade cases to report "no applicable upgrades found" incorrectly. Looks like we may want to fix the 1 -> n mapping sooner.
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.
We need to think about the behavior in that case. We haven't really laid down how the association will work. In my opinion, we should not attempt to upgrade in the case that the original source no longer contains the package, but another one does. We should instead inform the user of that fact so that they can decide what to do. If they did install/upgrade into the other source, then the association would be updated and we would start upgrading from the new location in the future.
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.
Change
This change leverages the tracking data that is stored per source to correlate installed packages to available packages. This will currently provide no additional benefit with the
winget
source, as we aren't doing the work yet to determine the best fit system artifact when none of our current correlation attempts succeed. It will help themsstore
source to correlate as that is currently lacking in support to search system references.Validation
Existing regression tests and new tests added for the tracking catalog. Modified the tracking catalog to enable the existing test infrastructure to inject custom data.
Microsoft Reviewers: Open in CodeFlow