Skip to content

Commit 652b8d8

Browse files
committed
Revert "[Hotfix]Disable DownloadCount Mapping temporarily (#9150)"
This reverts commit 1dc90c2.
1 parent 1dc90c2 commit 652b8d8

5 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/NuGet.Services.Entities/Package.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public Package()
5858
/// </remarks>
5959
public string ReleaseNotes { get; set; }
6060

61-
[NotMapped]
6261
public long DownloadCount { get; set; }
6362

6463
/// <remarks>

src/NuGet.Services.Entities/PackageRegistration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Collections.Generic;
55
using System.ComponentModel.DataAnnotations;
6-
using System.ComponentModel.DataAnnotations.Schema;
76

87
namespace NuGet.Services.Entities
98
{
@@ -24,7 +23,6 @@ public PackageRegistration()
2423
[Required]
2524
public string Id { get; set; }
2625

27-
[NotMapped]
2826
public long DownloadCount { get; set; }
2927

3028
public bool IsVerified { get; set; }

src/NuGetGallery.Services/PackageManagement/PackageService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ private IReadOnlyCollection<PackageDependent> GetListOfDependents(string id)
209209
join p in _entitiesContext.Packages on pd.PackageKey equals p.Key
210210
join pr in _entitiesContext.PackageRegistrations on p.PackageRegistrationKey equals pr.Key
211211
where p.IsLatestSemVer2 && pd.Id == id
212-
group 1 by new { pr.Id, /*pr.DownloadCount,*/ pr.IsVerified, p.Description } into ng
213-
//orderby ng.Key.DownloadCount descending
214-
select new PackageDependent { Id = ng.Key.Id, /*DownloadCount = ng.Key.DownloadCount,*/ IsVerified = ng.Key.IsVerified, Description = ng.Key.Description }
212+
group 1 by new { pr.Id, pr.DownloadCount, pr.IsVerified, p.Description } into ng
213+
orderby ng.Key.DownloadCount descending
214+
select new PackageDependent { Id = ng.Key.Id, DownloadCount = ng.Key.DownloadCount, IsVerified = ng.Key.IsVerified, Description = ng.Key.Description }
215215
).Take(packagesDisplayed).ToList();
216216

217217
return listPackages;

src/NuGetGallery/Services/TyposquattingCheckListCacheService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public IReadOnlyCollection<string> GetTyposquattingCheckList(int checkListConfig
4747

4848
Cache = packageService.GetAllPackageRegistrations()
4949
.OrderByDescending(pr => pr.IsVerified)
50-
//.ThenByDescending(pr => pr.DownloadCount)
50+
.ThenByDescending(pr => pr.DownloadCount)
5151
.Select(pr => pr.Id)
5252
.Take(TyposquattingCheckListConfiguredLength)
5353
.ToList();

tests/NuGet.Services.DatabaseMigration.Facts/PendingMigrationsFacts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static IEnumerable<object[]> TestData
9494
}
9595
}
9696

97-
[Theory(Skip = "Temporary while transitioning to int64")]
97+
[Theory]
9898
[MemberData(nameof(TestData))]
9999
public async Task NoPendingMigrations(string dbName, string argumentName, MigrationContextFactory factory, IServiceProvider serviceProvider)
100100
{

0 commit comments

Comments
 (0)