From aef399ef2d1592a70da1f3598b43d078b13f6c36 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Tue, 2 Jul 2019 12:43:39 -0500 Subject: [PATCH] fix GitHubClient config --- .../Extensions/ServiceCollectionExtensions.cs | 6 +++--- .../Features/Urls/CreateOrUpdateGitHubIssue.cs | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs b/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs index c9e2ef533..536d8e02e 100644 --- a/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs +++ b/src/FilterLists.Agent/Extensions/ServiceCollectionExtensions.cs @@ -28,10 +28,10 @@ public static void RegisterAgentServices(this IServiceCollection services) services.AddSingleton(); services.AddSingleton(s => { - var gitHubConfig = s.GetService(); - var client = new GitHubClient(new ProductHeaderValue(gitHubConfig.ProductHeaderValue)) + var gitHubConfig = s.GetService>(); + var client = new GitHubClient(new ProductHeaderValue(gitHubConfig.Value.ProductHeaderValue)) { - Credentials = new Credentials(gitHubConfig.OauthToken) + Credentials = new Credentials(gitHubConfig.Value.OauthToken) }; return client; }); diff --git a/src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs b/src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs index a48399021..c26c8684f 100644 --- a/src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs +++ b/src/FilterLists.Agent/Features/Urls/CreateOrUpdateGitHubIssue.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using FilterLists.Agent.Features.Urls.Models.ValidationResults; using MediatR; +using Octokit; namespace FilterLists.Agent.Features.Urls { @@ -21,6 +22,13 @@ public Command(IEnumerable dataFileUrlValidationRe public class Handler : AsyncRequestHandler { + private readonly IGitHubClient _gitHubClient; + + public Handler(IGitHubClient gitHubClient) + { + _gitHubClient = gitHubClient; + } + protected override async Task Handle(Command request, CancellationToken cancellationToken) { throw new NotImplementedException();