From 07dadb736567c06ceb2ebbdc7e9cfbf0e73f58dc Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:47:59 -0400 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 7977 (#1745) * Skip API review package name approval for management plane packages --- eng/common/scripts/Create-APIReview.ps1 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index cdf467180..246a87be6 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -153,6 +153,13 @@ function Submit-APIReview($packageInfo, $packagePath) } } +function IsApiviewStatusCheckRequired($packageInfo) +{ + if (($packageInfo.SdkType -eq "client" -or $packageInfo.SdkType -eq "spring") -and $packageInfo.IsNewSdk) { + return $true + } + return $false +} function ProcessPackage($packageName) { @@ -234,8 +241,14 @@ function ProcessPackage($packageName) # Check if package name is approved. Preview version cannot be released without package name approval if (!$pkgNameStatus.IsApproved) { - Write-Error $($pkgNameStatus.Details) - return 1 + if (IsApiviewStatusCheckRequired $pkgInfo) + { + Write-Error $($pkgNameStatus.Details) + return 1 + } + else{ + Write-Host "Package name is not approved for package $($packageName), however it is not required for this package type so it can still be released without API review approval." + } } # Ignore API review status for prerelease version Write-Host "Package version is not GA. Ignoring API view approval status" @@ -245,7 +258,7 @@ function ProcessPackage($packageName) # Return error code if status code is 201 for new data plane package # Temporarily enable API review for spring SDK types. Ideally this should be done be using 'IsReviewRequired' method in language side # to override default check of SDK type client - if (($pkgInfo.SdkType -eq "client" -or $pkgInfo.SdkType -eq "spring") -and $pkgInfo.IsNewSdk) + if (IsApiviewStatusCheckRequired $pkgInfo) { if (!$apiStatus.IsApproved) {