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

Fixing popularity transfer download count bug, surfacing additional validation info #9710

Merged
merged 6 commits into from
Nov 17, 2023

Conversation

advay26
Copy link
Member

@advay26 advay26 commented Oct 17, 2023

  1. 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:
    (DEV packages: https://dev.nugettest.org/packages/Newtonsoft.Json/)
    image

  2. 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

@advay26 advay26 marked this pull request as ready for review October 20, 2023 07:18
@advay26 advay26 requested a review from a team as a code owner October 20, 2023 07:18
@erdembayar
Copy link
Contributor

Not blocking, 1 improvement idea. Could we have , separator for thousand/millions, same as we doing for user facing UI.
If someone is doing visual verification then it's hard to read numbers when it has many digits.
image

@advay26
Copy link
Member Author

advay26 commented Oct 20, 2023

Not blocking, 1 improvement idea. Could we have , separator for thousand/millions, same as we doing for user facing UI. If someone is doing visual verification then it's hard to read numbers when it has many digits.

@erdembayar Thanks for pointing this out, I've fixed it now
image

erdembayar
erdembayar previously approved these changes Oct 20, 2023
mariaghiondea
mariaghiondea previously approved these changes Oct 24, 2023
@advay26 advay26 dismissed stale reviews from mariaghiondea and erdembayar via b8aa851 October 27, 2023 01:32
@@ -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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ToListAsync()? Below, too.

Copy link
Contributor

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.

Copy link
Member Author

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.

@advay26 advay26 requested review from erdembayar and agr November 17, 2023 01:57
@advay26 advay26 merged commit 7561582 into dev Nov 17, 2023
@advay26 advay26 deleted the advay26-pop-transfer-bug branch November 17, 2023 19:13
@advay26 advay26 mentioned this pull request Dec 13, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants