Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit 6ffabba

Browse files
Fix the symbols FindPackageByKey to get the package details. (#607)
1 parent 61dc5b4 commit 6ffabba

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/NuGet.Services.Validation.Orchestrator/Services/SymbolEntityService.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Data.Entity;
56
using System.Linq;
67
using System.Threading.Tasks;
78
using NuGetGallery;
@@ -42,7 +43,9 @@ public IValidatingEntity<SymbolPackage> FindPackageByKey(int key)
4243
{
4344
var symbolPackage = _symbolsPackageRepository
4445
.GetAll()
45-
.SingleOrDefault(p => p.Key == key);
46+
.Include(sp => sp.Package)
47+
.Include(sp => sp.Package.PackageRegistration)
48+
.SingleOrDefault(sp => sp.Key == key);
4649
return symbolPackage == null ? null : new SymbolPackageValidatingEntity(symbolPackage);
4750
}
4851

src/NuGet.Services.Validation.Orchestrator/Services/SymbolsMessageService.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public async Task SendPublishedMessageAsync(SymbolPackage symbolPackage)
4343
packageSupportUrl,
4444
_serviceConfiguration.EmailConfiguration.EmailSettingsUrl,
4545
Array.Empty<string>());
46+
47+
_logger.LogInformation("The publish email will be sent for the symbol {SymbolId} {SymbolVersion}",
48+
symbolPackage.Id,
49+
symbolPackage.Version);
4650
await _messageService.SendMessageAsync(symbolPackageAddedMessage);
4751
}
4852

@@ -66,6 +70,10 @@ public async Task SendValidationFailedMessageAsync(SymbolPackage symbolPackage,
6670
_serviceConfiguration.EmailConfiguration.AnnouncementsUrl,
6771
_serviceConfiguration.EmailConfiguration.TwitterUrl);
6872

73+
_logger.LogInformation("The validation failed email will be sent for the symbol {SymbolId} {SymbolVersion} and ValidationSetKey {ValidationSetKey}",
74+
symbolPackage.Id,
75+
symbolPackage.Version,
76+
validationSet.Key);
6977
await _messageService.SendMessageAsync(symbolPackageValidationFailedMessage);
7078
}
7179

@@ -80,6 +88,9 @@ public async Task SendValidationTakingTooLongMessageAsync(SymbolPackage symbolPa
8088
symbolPackage,
8189
_serviceConfiguration.GalleryPackageUrl(symbolPackage.Package.PackageRegistration.Id, symbolPackage.Package.NormalizedVersion));
8290

91+
_logger.LogInformation("The validation failed email will be sent for the symbol {SymbolId} {SymbolVersion}.",
92+
symbolPackage.Id,
93+
symbolPackage.Version);
8394
await _messageService.SendMessageAsync(symbolPackageValidationTakingTooLongMessage);
8495
}
8596
}

0 commit comments

Comments
 (0)