From 60c9a70a99522b01b707edad84b1cb2e4805d767 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 29 Apr 2025 12:25:29 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 10482 (#6548) * Properly handle error for case where no issue (pr) is found for specified commit * Use logInfo in various places * Change LogWarning to LogInfo --------- Co-authored-by: Chidozie Ononiwu --- eng/common/scripts/Helpers/ApiView-Helpers.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/Helpers/ApiView-Helpers.ps1 b/eng/common/scripts/Helpers/ApiView-Helpers.ps1 index 33c32bf11..e6283cf82 100644 --- a/eng/common/scripts/Helpers/ApiView-Helpers.ps1 +++ b/eng/common/scripts/Helpers/ApiView-Helpers.ps1 @@ -132,8 +132,9 @@ function Set-ApiViewCommentForRelatedIssues { try { $issuesForCommit = Search-GitHubIssues -CommitHash $HeadCommitish if ($issuesForCommit.items.Count -eq 0) { - LogError "No issues found for commit: $HeadCommitish" - exit 1 + LogInfo "No issues found for commit: $HeadCommitish" + Write-Host "##vso[task.complete result=SucceededWithIssues;]DONE" + exit 0 } } catch { LogError "No issues found for commit: $HeadCommitish" @@ -169,8 +170,9 @@ function Set-ApiViewCommentForPR { $commentText += "## API Change Check" try { $response = Invoke-WebRequest -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3 + LogInfo "OperationId: $($response.Headers['X-Operation-Id'])" if ($response.StatusCode -ne 200) { - LogWarning "API changes are not detected in this pull request." + LogInfo "API changes are not detected in this pull request." exit 0 } else {