From da46850436ff4e27066211b8055ec60c225ffaa4 Mon Sep 17 00:00:00 2001 From: Maxwell Weru Date: Thu, 21 Sep 2023 08:30:10 +0300 Subject: [PATCH] Set api-version in query --- server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs | 3 --- server/Tingle.Dependabot/Workflow/AzureDevOpsProvider.cs | 9 +-------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs b/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs index 08e4b510..b66bf53f 100644 --- a/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs +++ b/server/Tingle.Dependabot/Extensions/ILoggerExtensions.cs @@ -5,9 +5,6 @@ namespace Microsoft.Extensions.Logging; internal static partial class ILoggerExtensions { - //[LoggerMessage(100, LogLevel.Warning, "Retrying periodic task execution {CurrentTry} of {MaxRetries}")] - //public static partial void RetryingExecutionOfPeriodicTask(this ILogger logger, Exception exception, int currentTry, int maxRetries); - #region Webhooks (2xx) [LoggerMessage(200, LogLevel.Debug, "Received {EventType} notification {NotificationId} on subscription {SubscriptionId}")] diff --git a/server/Tingle.Dependabot/Workflow/AzureDevOpsProvider.cs b/server/Tingle.Dependabot/Workflow/AzureDevOpsProvider.cs index 735b0431..7852a1d8 100644 --- a/server/Tingle.Dependabot/Workflow/AzureDevOpsProvider.cs +++ b/server/Tingle.Dependabot/Workflow/AzureDevOpsProvider.cs @@ -131,14 +131,6 @@ public async Task> CreateOrUpdateSubscriptionsAsync(Project project public async Task GetProjectAsync(Project project, CancellationToken cancellationToken) { - //// get a connection to Azure DevOps - //var url = (AzureDevOpsProjectUrl)project.Url!; - //var connection = CreateVssConnection(url, project.Token!); - - //// get the project - //var client = await connection.GetClientAsync(cancellationToken); - //return await client.GetProject(id: url.ProjectIdOrName); - var url = (AzureDevOpsProjectUrl)project.Url!; var uri = new UriBuilder { @@ -146,6 +138,7 @@ public async Task GetProjectAsync(Project project, CancellationToke Host = url.Hostname, Port = url.Port ?? -1, Path = $"{url.OrganizationName}/_apis/projects/{url.ProjectIdOrName}", + Query = "?api-version=7.0", }.Uri; var request = new HttpRequestMessage(HttpMethod.Get, uri); return (await SendAsync(project.Token!, request, cancellationToken))!;