-
Notifications
You must be signed in to change notification settings - Fork 643
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
Fixing popularity transfer download count bug, surfacing additional validation info #9710
Conversation
@erdembayar Thanks for pointing this out, I've fixed it now |
b8aa851
@@ -23,6 +23,17 @@ public IReadOnlyList<PackageRename> GetPackageRenames(PackageRegistration packag | |||
{ | |||
return _packageRenameRepository.GetAll() | |||
.Where(pr => pr.FromPackageRegistrationKey == packageRegistration.Key) | |||
.Include(pr => pr.FromPackageRegistration) | |||
.Include(pr => pr.ToPackageRegistration) | |||
.ToList(); |
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.
.ToListAsync()
? Below, too.
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.
@advay26
Are you going to address this? After this I can approve again.
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.
.GetAll()
doesn't currently support ToListAsync()
. EF Core would allow us to use this, but regular Entity Framework doesn't. I spoke to @agr offline, and we won't look to fix this right now with this change.
For context, this is the error it throws when I tried to make the call async:
The source IQueryable doesn't implement IDbAsyncEnumerable<NuGet.Services.Entities.PackageRename>. Only sources that implement IDbAsyncEnumerable can be used for Entity Framework asynchronous operations.
The Popularity Transfer Admin Panel has a bug where it shows version-specific download counts for packages, rather than the package registration's download count, which is what we want (we transfer popularity from one package registration to another). I had to refactor some code to get that data correctly. This now works:
![image](https://private-user-images.githubusercontent.com/82980589/275712439-cfb0981a-0010-420b-95e6-4a25811e3eef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Mzc0NzksIm5iZiI6MTczOTUzNzE3OSwicGF0aCI6Ii84Mjk4MDU4OS8yNzU3MTI0MzktY2ZiMDk4MWEtMDAxMC00MjBiLTk1ZTYtNGEyNTgxMWUzZWVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDEyNDYxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI4Y2NhMTk1MDhhZDAwOGYxYTQ0MTgzZGFkOWNiNDY5NDYwMmIyNmJkMDlmMjgyNGM5MDg4ODQwYjlmMjBhNTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.g44tFyxyhrXkzQ_TmYb5BWT_T2S-HukM8gz023r_5CE)
(DEV packages: https://dev.nugettest.org/packages/Newtonsoft.Json/)
I also added some more validation info to the Admin Panel page, which should save us from having to go look in the SQL DB manually every time every time:
![image](https://private-user-images.githubusercontent.com/82980589/275682430-2650b9a4-7113-429b-8f71-1dcf02f1f2a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1Mzc0NzksIm5iZiI6MTczOTUzNzE3OSwicGF0aCI6Ii84Mjk4MDU4OS8yNzU2ODI0MzAtMjY1MGI5YTQtNzExMy00MjliLThmNzEtMWRjZjAyZjFmMmE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDEyNDYxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmOWNlYjVkZGU2MWU2NWJiZjk1NjYyMmQwZWZlMmU5ZjBhMGY1Y2M0YzlkNDQ2Yjc1NTgwM2ZiMTNmNTk0NzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QX8rsG6wKyQ3MUQFNIVGcnjUyLKOd9c4vugV4hb7_w4)