From b51039d6f1edbb51e03a604fab6e3619d7f4591c Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Tue, 2 Jul 2019 15:20:28 -0500 Subject: [PATCH] stub close issue command --- .../Features/Urls/CloseUrlValidationIssue.cs | 30 +++++++++++++++++++ ...cs => CreateOrUpdateUrlValidationIssue.cs} | 2 +- .../Features/Urls/ValidateAllUrls.cs | 4 +-- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/FilterLists.Agent/Features/Urls/CloseUrlValidationIssue.cs rename src/FilterLists.Agent/Features/Urls/{CreateOrUpdateGitHubIssue.cs => CreateOrUpdateUrlValidationIssue.cs} (98%) diff --git a/src/FilterLists.Agent/Features/Urls/CloseUrlValidationIssue.cs b/src/FilterLists.Agent/Features/Urls/CloseUrlValidationIssue.cs new file mode 100644 index 000000000..3c0ce3929 --- /dev/null +++ b/src/FilterLists.Agent/Features/Urls/CloseUrlValidationIssue.cs @@ -0,0 +1,30 @@ +using System.Threading; +using System.Threading.Tasks; +using FilterLists.Agent.Infrastructure.Clients; +using MediatR; + +namespace FilterLists.Agent.Features.Urls +{ + public static class CloseUrlValidationIssue + { + public class Command : IRequest + { + } + + public class Handler : AsyncRequestHandler + { + private const string AgentBotLabel = "agent bot"; + private const string IssueTitle = "Url Validation Errors"; + private readonly IAgentGitHubClient _gitHubClient; + + public Handler(IAgentGitHubClient agentGitHubClient) + { + _gitHubClient = agentGitHubClient; + } + + protected override async Task Handle(Command request, CancellationToken cancellationToken) + { + } + } + } +} \ No newline at end of file diff --git a/src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs b/src/FilterLists.Agent/Features/Urls/CreateOrUpdateUrlValidationIssue.cs similarity index 98% rename from src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs rename to src/FilterLists.Agent/Features/Urls/CreateOrUpdateUrlValidationIssue.cs index e5ed5444f..cb2fab2c4 100644 --- a/src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs +++ b/src/FilterLists.Agent/Features/Urls/CreateOrUpdateUrlValidationIssue.cs @@ -9,7 +9,7 @@ namespace FilterLists.Agent.Features.Urls { - public static class CreateOrUpdateGitHubIssue + public static class CreateOrUpdateUrlValidationIssue { public class Command : IRequest { diff --git a/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs b/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs index 186fc7908..4d937534e 100644 --- a/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs +++ b/src/FilterLists.Agent/Features/Urls/ValidateAllUrls.cs @@ -56,8 +56,8 @@ protected override async Task Handle(Command request, CancellationToken cancella results.Add(new DataFileUrlValidationResults("Syntax.json", syntaxUrlErrors)); if(results.Any()) - await _mediator.Send(new CreateOrUpdateGitHubIssue.Command(results), cancellationToken); - //TODO: else, close issue + await _mediator.Send(new CreateOrUpdateUrlValidationIssue.Command(results), cancellationToken); + await _mediator.Send(new CloseUrlValidationIssue.Command(), cancellationToken); } } }