From 720956e9f1ad165e2bd6852466838182dca44b46 Mon Sep 17 00:00:00 2001 From: Gabriel Vanca Date: Fri, 6 Sep 2024 06:44:32 +0100 Subject: [PATCH 1/3] Fix Azure Dev Ops startup error --- .../Internal/AzureDevOpsPullRequestService.cs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/RepoM.Plugin.AzureDevOps/Internal/AzureDevOpsPullRequestService.cs b/src/RepoM.Plugin.AzureDevOps/Internal/AzureDevOpsPullRequestService.cs index 009677de..a1cc2168 100644 --- a/src/RepoM.Plugin.AzureDevOps/Internal/AzureDevOpsPullRequestService.cs +++ b/src/RepoM.Plugin.AzureDevOps/Internal/AzureDevOpsPullRequestService.cs @@ -42,12 +42,21 @@ public AzureDevOpsPullRequestService(IAzureDevopsConfiguration configuration, IL try { - _connection = new VssConnection( - _configuration.AzureDevOpsBaseUrl, - new VssBasicCredential(string.Empty, _configuration.AzureDevOpsPersonalAccessToken)); - _httpClient.BaseAddress = _configuration.AzureDevOpsBaseUrl; - _httpClient.DefaultRequestHeaders.Accept.Add(new("application/json")); - _httpClient.DefaultRequestHeaders.Authorization = new("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($":{_configuration.AzureDevOpsPersonalAccessToken}"))); + if (string.IsNullOrEmpty(configuration.AzureDevOpsPersonalAccessToken)) + { + //throw new ArgumentNullException(nameof(configuration.AzureDevOpsPersonalAccessToken)); + _logger.LogInformation("No Azure configuration present"); + } + else + { + _connection = new VssConnection( + _configuration.AzureDevOpsBaseUrl, + new VssBasicCredential(string.Empty, _configuration.AzureDevOpsPersonalAccessToken)); + _httpClient.BaseAddress = _configuration.AzureDevOpsBaseUrl; + _httpClient.DefaultRequestHeaders.Accept.Add(new("application/json")); + _httpClient.DefaultRequestHeaders.Authorization = new("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($":{_configuration.AzureDevOpsPersonalAccessToken}"))); + } + } catch (Exception e) { @@ -515,4 +524,4 @@ private static string GetRepositorySearchUrl(IRepository repository) var searchRepoUrl = url.Scheme + "://" + url.Host + url.LocalPath; return searchRepoUrl; } -} \ No newline at end of file +} From 9acce09881d39e7636e2aee674e122b07c65ab2b Mon Sep 17 00:00:00 2001 From: Gabriel Vanca Date: Fri, 6 Sep 2024 19:22:31 +0100 Subject: [PATCH 2/3] global sort --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 41336fb9..31836933 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.401", - "rollForward": "latestFeature" + "rollForward": "latestFeature", + "version": "8.0.401" } } \ No newline at end of file From a9c0bf4adeb43858ddbc712b3c4af50fab468264 Mon Sep 17 00:00:00 2001 From: Gabriel Vanca Date: Fri, 6 Sep 2024 20:16:31 +0100 Subject: [PATCH 3/3] Nerdbank.GitVersioning update --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9ac5d6c2..f6813da5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ - 3.6.141 + 3.6.143 all