Skip to content
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

Fix unable to update or consolidate packages due to downgrade package error Nu1605 #9224 #3553

Conversation

erdembayar
Copy link
Contributor

@erdembayar erdembayar commented Aug 1, 2020

Bug

Fixes: Nuget/Home#9224

Regression: No

Fix

Details: In PMUI downgrade or consolidate.
Currently Nu1605 single largest cause of nuget install to fail according to below graph, after this fix is pushed this will drop very significantly, I expect it'll go down on-par to NU1202, even less than NU1202.
image

For example in you have large solution with package reference style projects which are referencing each other.

image

ConsoleApp2(grandparent)=> ConsoleApp1(parent)=>MainApplication(child)

Now if you downgrade children and parent same time to same version or consolidate many different versions into same not highest version then it throws Nu1605 error. But still downgrade one bottom child, but not others. To finish it you have to repeat this action one by one.

Downgrade error Nu1605 demo (gif animation):
DowngradeNU1065error

Consolidate error Nu1605 demo (gif animation):

ConsolidateNU1065error

If you 30 projects and they have different versions of same package then you may need to try up to 30 times to downgrade or consolidate all of them.
With my change only 1 time try it will succeed if input are good or fail depending if input are not good.
Now we're doing smart restore let children restore first then cache needed restore result in memory, next we restore parent and parent's of parent in target group in correct order so it wouldn't fail.
Current change doesn't change this current behavior: If you only select child ( without selecting parent too) and update to higher version than parent then it'll succeed, but wouldn't build code later.
Also good thing is it doesn't update half of solution and create any undesirable state. This change will help with my next fix #6010 to make it more deterministic and instead of bubbling many times of repeated restore only 1 time pass will work.
Please review @nkolev92 @zivkan @rrelyea, I tried to make as minimal surgical change without affecting other logics, for that one I took time to understand how whole process works.

Downgrade works demo after change (gif animation):
DowngradeFixed

Consolidate works demo after change (gif animation):
ConsolidateFixed
:

Testing/Validation

Tests Added: No
Reason for not adding tests:
Validation: Manual testing

@erdembayar erdembayar force-pushed the dev-eryondon-UnableToUpdateOrConsolidatePackagesDueToDowngradeError branch from 62a81bd to 3e3a9cd Compare August 2, 2020 16:30
@erdembayar erdembayar marked this pull request as ready for review August 2, 2020 18:16
@erdembayar erdembayar marked this pull request as draft August 3, 2020 20:58
@erdembayar erdembayar changed the title Unable to update or consolidate packages due to downgrade package error NU1065 #9224 Fix unable to update or consolidate packages due to downgrade package error NU1065 #9224 Aug 9, 2020
@nkolev92
Copy link
Member

Can you please close this as it's superseded by #3559.

You should copy the description from here into the other issue.

Please make sure you update it to make it current.

@nkolev92
Copy link
Member

PR count is high...closing this to reduce noise.

@erdembayar re-open if I've made a mistake.

@nkolev92 nkolev92 closed this Aug 26, 2020
@erdembayar erdembayar changed the title Fix unable to update or consolidate packages due to downgrade package error NU1065 #9224 Fix unable to update or consolidate packages due to downgrade package error Nu1605 #9224 Sep 3, 2020
@nkolev92 nkolev92 deleted the dev-eryondon-UnableToUpdateOrConsolidatePackagesDueToDowngradeError branch January 20, 2021 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants