This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #586 from NuGet/dev
[ReleasePrep][2018.10.15]RI of dev into master
- Loading branch information
Showing
182 changed files
with
8,734 additions
and
1,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/NuGet.Services.Validation.Orchestrator/Symbols/ISymbolsIngesterMessageEnqueuer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Threading.Tasks; | ||
using NuGet.Jobs.Validation.Symbols.Core; | ||
|
||
namespace NuGet.Services.Validation.Symbols | ||
{ | ||
public interface ISymbolsIngesterMessageEnqueuer | ||
{ | ||
/// <summary> | ||
/// Enqueues a message to one of the topics used by the Symbol Ingester. | ||
/// </summary> | ||
/// <param name="request">The validation request.</param> | ||
/// <returns>A <see cref="Task"/> that will be completed when the execution is completed.</returns> | ||
Task<SymbolsIngesterMessage> EnqueueSymbolsIngestionMessageAsync(IValidationRequest request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/NuGet.Services.Validation.Orchestrator/Symbols/SymbolsIngesterMessageEnqueuer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Options; | ||
using NuGet.Jobs.Validation.Symbols.Core; | ||
using NuGet.Services.ServiceBus; | ||
|
||
namespace NuGet.Services.Validation.Symbols | ||
{ | ||
public class SymbolsIngesterMessageEnqueuer : ISymbolsIngesterMessageEnqueuer | ||
{ | ||
private readonly ITopicClient _topicClient; | ||
private readonly TimeSpan? _messageDelay; | ||
private readonly IBrokeredMessageSerializer<SymbolsIngesterMessage> _serializer; | ||
|
||
public SymbolsIngesterMessageEnqueuer( | ||
ITopicClient topicClient, | ||
IBrokeredMessageSerializer<SymbolsIngesterMessage> serializer, | ||
TimeSpan? messageDelay) | ||
{ | ||
_topicClient = topicClient ?? throw new ArgumentNullException(nameof(topicClient)); | ||
_serializer = serializer ?? throw new ArgumentNullException(nameof(serializer)); | ||
_messageDelay = messageDelay; | ||
} | ||
|
||
public async Task<SymbolsIngesterMessage> EnqueueSymbolsIngestionMessageAsync(IValidationRequest request) | ||
{ | ||
var message = new SymbolsIngesterMessage(validationId: request.ValidationId, | ||
symbolPackageKey: request.PackageKey, | ||
packageId: request.PackageId, | ||
packageNormalizedVersion: request.PackageVersion, | ||
snupkgUrl: request.NupkgUrl, | ||
requestName : SymbolsValidationEntitiesService.CreateSymbolServerRequestNameFromValidationRequest(request)); | ||
var brokeredMessage = _serializer.Serialize(message); | ||
|
||
var visibleAt = DateTimeOffset.UtcNow + (_messageDelay ?? TimeSpan.Zero); | ||
brokeredMessage.ScheduledEnqueueTimeUtc = visibleAt; | ||
|
||
await _topicClient.SendAsync(brokeredMessage); | ||
return message; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[module: SuppressMessage("Microsoft.Security.Web.Configuration", "CA3103:EnableFormsRequireSSL", Justification = "Forms authentication is not used, and this project is obsolete (Engineering#1737).")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.