-
Notifications
You must be signed in to change notification settings - Fork 906
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
(#508) Fix some files not being removed during uninstall/upgrade #3151
(#508) Fix some files not being removed during uninstall/upgrade #3151
Conversation
src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs
Outdated
Show resolved
Hide resolved
src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs
Outdated
Show resolved
Hide resolved
5fc7bcd
to
fbdb577
Compare
@vexx32 thanks for catching those, I have updated the PR to fix the missing usage of throwError and using the correct parameter when formatting versions. |
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.
Just a few comments about the Pester tests.
src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs
Show resolved
Hide resolved
…tion This commit updates the file snapshot service to honor version normalization with fallbacks to old version methods. This is done as we are moving towards normalizing version numbers in most of the code, which causes a conflict when installing, upgrading or uninstalling packages that sometimes it would use non-normalized version number, and other times it would use normalized version numbers. Now with this change it will prefer to use normalized version number, but will continue to read/update package versions that was installed using non-normalized version numbers.
This commit updates the uninstall process to ensure that the nupkg file is removed, even in the cases where only partial file removals has happened. This will prevent the package from being listed as installed when partial removal is done. While the original code does not pose any problems with normal usage of CLI, it will not remove the nuget packages when the package has been modified, like what Licensed Extension does when optimizing installations.
There are several tests that are fixed by the changes in a previous commit, and in commits made in other projects. As such we need to remove the tag FossOnly from these tests.
fbdb577
to
12bf790
Compare
Switch to use `--no-reduce` to prevent all reduction instead of just reducing the nupkg.
12bf790
to
7cb721a
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.
Looks good to me, great work Kim! And thanks to Cory for fixing up the last few little things.
Description Of Changes
This pull request makes changes to normalize the version number when creating file snapshots, and still support legacy version numbers. This fixes issues in licensed extension that would result in the file snapshot being null when trying to uninstall or upgrade packages.
Changes to ensure removal of nupkg files has also been added as if the nupkg file has been modified either manually, or by Chocolatey Licensed Extension it would be kept on disk during uninstalls and not removed.
Motivation and Context
To have uninstall and upgrade reliably works similar to how open source works.
Testing
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue