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

Commit 9accd1f

Browse files
author
Scott Bommarito
authored
Merge pull request #670 from NuGet/sb-emailhotfixdev
FI of master into dev for NuGet.Jobs
2 parents 763f5d0 + d6c3b87 commit 9accd1f

11 files changed

Lines changed: 41 additions & 19 deletions

File tree

src/Gallery.CredentialExpiration/Gallery.CredentialExpiration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<Version>9.0.1</Version>
104104
</PackageReference>
105105
<PackageReference Include="NuGet.Services.Messaging.Email">
106-
<Version>2.33.0</Version>
106+
<Version>2.36.0</Version>
107107
</PackageReference>
108108
<PackageReference Include="NuGet.Services.Storage">
109109
<Version>2.1.3</Version>

src/Gallery.CredentialExpiration/Job.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public override void Init(IServiceContainer serviceContainer, IDictionary<string
4545
var serializer = new ServiceBusMessageSerializer();
4646
var topicClient = new TopicClientWrapper(InitializationConfiguration.EmailPublisherConnectionString, InitializationConfiguration.EmailPublisherTopicName);
4747
var enqueuer = new EmailMessageEnqueuer(topicClient, serializer, LoggerFactory.CreateLogger<EmailMessageEnqueuer>());
48-
EmailService = new AsynchronousEmailMessageService(enqueuer);
48+
EmailService = new AsynchronousEmailMessageService(enqueuer, LoggerFactory.CreateLogger<AsynchronousEmailMessageService>());
4949

5050
FromAddress = new MailAddress(InitializationConfiguration.MailFrom);
5151

src/NuGet.Services.Validation.Orchestrator/NuGet.Services.Validation.Orchestrator.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
<PrivateAssets>all</PrivateAssets>
168168
</PackageReference>
169169
<PackageReference Include="NuGet.Services.Messaging.Email">
170-
<Version>2.33.0</Version>
170+
<Version>2.36.0</Version>
171171
</PackageReference>
172172
</ItemGroup>
173173
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

src/NuGet.SupportRequests.Notifications/NuGet.SupportRequests.Notifications.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<Version>9.0.1</Version>
112112
</PackageReference>
113113
<PackageReference Include="NuGet.Services.Messaging.Email">
114-
<Version>2.33.0</Version>
114+
<Version>2.36.0</Version>
115115
</PackageReference>
116116
</ItemGroup>
117117
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

src/NuGet.SupportRequests.Notifications/Tasks/SupportRequestsNotificationScheduledTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected SupportRequestsNotificationScheduledTask(
3939
var serializer = new ServiceBusMessageSerializer();
4040
var topicClient = new TopicClientWrapper(configuration.EmailPublisherConnectionString, configuration.EmailPublisherTopicName);
4141
var enqueuer = new EmailMessageEnqueuer(topicClient, serializer, loggerFactory.CreateLogger<EmailMessageEnqueuer>());
42-
var messageService = new AsynchronousEmailMessageService(enqueuer);
42+
var messageService = new AsynchronousEmailMessageService(enqueuer, loggerFactory.CreateLogger<AsynchronousEmailMessageService>());
4343
_messagingService = new MessagingService(messageService, loggerFactory.CreateLogger<MessagingService>());
4444

4545
_supportRequestRepository = new SupportRequestRepository(loggerFactory, openSupportRequestSqlConnectionAsync);

src/StatusAggregator/Factory/AggregationProvider.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,31 @@ public async Task<TAggregationEntity> GetAsync(ParsedIncident input)
4343

4444
var possiblePath = _aggregationPathProvider.Get(input);
4545
// Find an aggregation to link to
46-
var possibleAggregations = _table
46+
var possibleAggregationsQuery = _table
4747
.CreateQuery<TAggregationEntity>()
4848
.Where(e =>
4949
// The aggregation must affect the same path
5050
e.AffectedComponentPath == possiblePath &&
5151
// The aggregation must begin before or at the same time
52-
e.StartTime <= input.StartTime &&
53-
// The aggregation must cover the same time period
54-
(
55-
// If the aggregation is active, it covers the same time period
56-
e.IsActive ||
57-
// Otherwise, if the child is not active, and the aggregation ends after it ends, it covers the same time period
58-
(!input.IsActive && e.EndTime >= input.EndTime)
59-
))
52+
e.StartTime <= input.StartTime);
53+
54+
// The aggregation must cover the same time period
55+
if (input.IsActive)
56+
{
57+
// An active input can only be linked to an active aggregation
58+
possibleAggregationsQuery = possibleAggregationsQuery
59+
.Where(e => e.IsActive);
60+
}
61+
else
62+
{
63+
// An inactive input can be linked to an active aggregation or an inactive aggregation that ends after it
64+
possibleAggregationsQuery = possibleAggregationsQuery
65+
.Where(e =>
66+
e.IsActive ||
67+
e.EndTime >= input.EndTime);
68+
}
69+
70+
var possibleAggregations = possibleAggregationsQuery
6071
.ToList();
6172

6273
_logger.LogInformation("Found {AggregationCount} possible aggregations to link entity to with path {AffectedComponentPath}.", possibleAggregations.Count(), possiblePath);

src/StatusAggregator/Factory/IncidentFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public async Task<IncidentEntity> CreateAsync(ParsedIncident input)
4242
input.Id,
4343
groupEntity,
4444
affectedPath,
45-
(ComponentStatus)input.AffectedComponentStatus,
45+
input.AffectedComponentStatus,
4646
input.StartTime,
4747
input.EndTime);
4848

src/Validation.Common.Job/Validation.Common.Job.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,21 @@
9999
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
100100
<PrivateAssets>all</PrivateAssets>
101101
</PackageReference>
102+
<PackageReference Include="NuGet.Packaging">
103+
<Version>5.0.0-preview1.5665</Version>
104+
</PackageReference>
102105
<PackageReference Include="NuGet.Services.ServiceBus">
103106
<Version>2.33.0</Version>
104107
</PackageReference>
105108
<PackageReference Include="NuGet.Services.Storage">
106109
<Version>2.33.0</Version>
107110
</PackageReference>
111+
<PackageReference Include="NuGet.Services.Validation">
112+
<Version>2.33.0</Version>
113+
</PackageReference>
114+
<PackageReference Include="NuGet.Services.Validation.Issues">
115+
<Version>2.33.0</Version>
116+
</PackageReference>
108117
<PackageReference Include="NuGetGallery.Core">
109118
<Version>4.4.5-dev-2193892</Version>
110119
</PackageReference>

src/Validation.Symbols/SymbolsValidatorService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public async Task<IValidationResult> ValidateSymbolsAsync(SymbolsValidatorMessag
6666
{
6767
orphanSymbolFiles.ForEach((symbol) =>
6868
{
69-
_telemetryService.TrackSymbolsAssemblyValidationResultEvent(message.PackageId, message.PackageNormalizedVersion, ValidationStatus.Failed, nameof(ValidationIssue.SymbolErrorCode_MatchingPortablePDBNotFound), assemblyName: symbol);
69+
_telemetryService.TrackSymbolsAssemblyValidationResultEvent(message.PackageId, message.PackageNormalizedVersion, ValidationStatus.Failed, nameof(ValidationIssue.SymbolErrorCode_MatchingAssemblyNotFound), assemblyName: symbol);
7070
});
7171
_telemetryService.TrackSymbolsValidationResultEvent(message.PackageId, message.PackageNormalizedVersion, ValidationStatus.Failed);
72-
return ValidationResult.FailedWithIssues(ValidationIssue.SymbolErrorCode_MatchingPortablePDBNotFound);
72+
return ValidationResult.FailedWithIssues(ValidationIssue.SymbolErrorCode_MatchingAssemblyNotFound);
7373
}
7474
var targetDirectory = Settings.GetWorkingDirectory();
7575
try
@@ -231,8 +231,8 @@ private bool IsChecksumMatch(string peFilePath, string packageId, string package
231231
}
232232
}
233233
}
234-
_telemetryService.TrackSymbolsAssemblyValidationResultEvent(packageId, packageNormalizedVersion, ValidationStatus.Failed, nameof(ValidationIssue.SymbolErrorCode_MatchingPortablePDBNotFound), assemblyName: Path.GetFileName(peFilePath));
235-
validationResult = ValidationResult.FailedWithIssues(ValidationIssue.SymbolErrorCode_MatchingPortablePDBNotFound);
234+
_telemetryService.TrackSymbolsAssemblyValidationResultEvent(packageId, packageNormalizedVersion, ValidationStatus.Failed, nameof(ValidationIssue.SymbolErrorCode_PdbIsNotPortable), assemblyName: Path.GetFileName(peFilePath));
235+
validationResult = ValidationResult.FailedWithIssues(ValidationIssue.SymbolErrorCode_PdbIsNotPortable);
236236
return false;
237237
}
238238

tests/NuGet.Services.Validation.Orchestrator.Tests/SymbolValidationMessageHandlerFacts.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public MessageWithCustomDeliveryCount(IBrokeredMessage inner, int deliveryCount)
122122
public DateTimeOffset ScheduledEnqueueTimeUtc { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
123123
public DateTimeOffset ExpiresAtUtc => throw new NotImplementedException();
124124
public DateTimeOffset EnqueuedTimeUtc => throw new NotImplementedException();
125+
public TimeSpan TimeToLive { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
125126

126127
public string MessageId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
127128

0 commit comments

Comments
 (0)