From 55bbe40a9118cf43688504dfee66b19688dec629 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Mon, 1 Feb 2021 17:15:11 -0800 Subject: [PATCH 1/8] Support sub directory for artifact location --- eng/common/scripts/Create-APIReview.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 210b82d4f6..e496326068 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -8,7 +8,8 @@ Param ( [string] $APIKey, [Parameter(Mandatory=$True)] [string] $APILabel, - [string] $PackageName = "" + [string] $PackageName, + [string] $ArtifactSubDir = "" ) @@ -56,7 +57,12 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel) $packages = @{} if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) { - $packages = &$FindArtifactForApiReviewFn $ArtifactPath $PackageName + $artifactLoc = $ArtifactPath + if ($ArtifactSubDir) + { + $artifactLoc = Join-Path -Path $artifactLoc $ArtifactSubDir + } + $packages = &$FindArtifactForApiReviewFn $artifactLoc $PackageName } else { From 753c1b3e24840d2cb0770010f0257154673b37de Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 2 Feb 2021 09:27:27 -0800 Subject: [PATCH 2/8] Fix as per review comment to avoid artifact sub path --- eng/common/scripts/Create-APIReview.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index e496326068..63d3e754cb 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -9,7 +9,7 @@ Param ( [Parameter(Mandatory=$True)] [string] $APILabel, [string] $PackageName, - [string] $ArtifactSubDir = "" + [string] $ConfigFileDir = "" ) @@ -57,12 +57,7 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel) $packages = @{} if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) { - $artifactLoc = $ArtifactPath - if ($ArtifactSubDir) - { - $artifactLoc = Join-Path -Path $artifactLoc $ArtifactSubDir - } - $packages = &$FindArtifactForApiReviewFn $artifactLoc $PackageName + $packages = &$FindArtifactForApiReviewFn $ArtifactPath $PackageName } else { @@ -88,7 +83,12 @@ else } $FoundFailure = $False -$pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo" +# Default config file path to artifact path to support backward compatibility until those scripts are modified +if (-not $ConfigFileDir) +{ + $ConfigFileDir = $ArtifactPath +} +$pkgInfoPath = Join-Path -Path $ConfigFileDir "PackageInfo" foreach ($pkgName in $responses.Keys) { $respCode = $responses[$pkgName] From 43ff9d4689c04966e4964fca0234168785356f6e Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 2 Feb 2021 09:33:13 -0800 Subject: [PATCH 3/8] Package property file is not created for track1 and management pacakges. --- eng/common/scripts/Create-APIReview.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 63d3e754cb..b5a6626093 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -98,7 +98,6 @@ foreach ($pkgName in $responses.Keys) if (-Not (Test-Path $pkgPropPath)) { Write-Host " Package property file path $($pkgPropPath) is invalid." - $FoundFailure = $True } else { From 7b41a90a118c8acd214690bab4befa7fb9b2a9c0 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 2 Feb 2021 14:00:08 -0800 Subject: [PATCH 4/8] Fix property name case --- eng/common/scripts/Save-Package-Properties.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index b78e3342ef..a433b32d80 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -13,7 +13,7 @@ if ($allPackageProperties) New-Item -ItemType Directory -Force -Path $outDirectory foreach($pkg in $allPackageProperties) { - if ($pkg.IsNewSDK) + if ($pkg.IsNewSdk) { Write-Host "Package Name: $($pkg.Name)" Write-Host "Package Version: $($pkg.Version)" From b496c61da2d59f5a5eee117426dc712df86e4955 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 2 Feb 2021 23:49:30 -0800 Subject: [PATCH 5/8] Fix as per review comments --- eng/common/scripts/Create-APIReview.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index b5a6626093..e195a3f73e 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -84,11 +84,11 @@ else $FoundFailure = $False # Default config file path to artifact path to support backward compatibility until those scripts are modified -if (-not $ConfigFileDir) +$pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo" +if ($ConfigFileDir) { - $ConfigFileDir = $ArtifactPath + $pkgInfoPath = Join-Path -Path $ConfigFileDir "PackageInfo" } -$pkgInfoPath = Join-Path -Path $ConfigFileDir "PackageInfo" foreach ($pkgName in $responses.Keys) { $respCode = $responses[$pkgName] From 451ab458f7f5c80b7663c311470d106719d0b33f Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Tue, 2 Feb 2021 23:53:10 -0800 Subject: [PATCH 6/8] Fix as per review comments --- eng/common/scripts/Create-APIReview.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index e195a3f73e..13cddce3e0 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -83,7 +83,6 @@ else } $FoundFailure = $False -# Default config file path to artifact path to support backward compatibility until those scripts are modified $pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo" if ($ConfigFileDir) { From ef57649314eaf33f8272ef03da182122d814ee99 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Wed, 3 Feb 2021 09:58:51 -0800 Subject: [PATCH 7/8] Use Config File param value as is --- eng/common/scripts/Create-APIReview.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 13cddce3e0..5675614402 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -83,17 +83,16 @@ else } $FoundFailure = $False -$pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo" -if ($ConfigFileDir) +if (-not $ConfigFileDir) { - $pkgInfoPath = Join-Path -Path $ConfigFileDir "PackageInfo" + $ConfigFileDir = Join-Path -Path $ArtifactPath "PackageInfo" } foreach ($pkgName in $responses.Keys) { $respCode = $responses[$pkgName] if ($respCode -ne '200') { - $pkgPropPath = Join-Path -Path $pkgInfoPath ($PackageName + ".json") + $pkgPropPath = Join-Path -Path $ConfigFileDir ($PackageName + ".json") if (-Not (Test-Path $pkgPropPath)) { Write-Host " Package property file path $($pkgPropPath) is invalid." From 43eae7bed17bf79daee249727863a957b7eb8954 Mon Sep 17 00:00:00 2001 From: praveenkuttappan Date: Wed, 3 Feb 2021 10:44:57 -0800 Subject: [PATCH 8/8] Change to make path joineasily readable --- eng/common/scripts/Create-APIReview.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 5675614402..1cef314133 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -92,7 +92,7 @@ foreach ($pkgName in $responses.Keys) $respCode = $responses[$pkgName] if ($respCode -ne '200') { - $pkgPropPath = Join-Path -Path $ConfigFileDir ($PackageName + ".json") + $pkgPropPath = Join-Path -Path $ConfigFileDir "$PackageName.json" if (-Not (Test-Path $pkgPropPath)) { Write-Host " Package property file path $($pkgPropPath) is invalid."