From c6d72b5fb3e824f3289d5b5d43283017526ea212 Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Wed, 23 Jun 2021 14:15:58 -0400 Subject: [PATCH 1/2] Check for API review status only if release date is set in changelog --- eng/common/scripts/Create-APIReview.ps1 | 4 ++++ eng/common/scripts/Package-Properties.ps1 | 7 +++++++ eng/common/scripts/Save-Package-Properties.ps1 | 1 + 3 files changed, 12 insertions(+) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 0ef5e0ba68..66f1f3bb46 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -121,6 +121,10 @@ if ($packages) # Ignore API review status for prerelease version Write-Host "Package version is not GA. Ignoring API view approval status" } + elseif (!$pkgInfo.ReleaseDate -or $pkgInfo.ReleaseDate -eq "Unreleased") + { + Write-Host "Release date is not set for current version in change log file for package. Ignoring API review approval status since package is not yet ready for release." + } else { # Return error code if status code is 201 for new data plane package diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 64698a181b..f0c077c04a 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -13,6 +13,7 @@ class PackageProps [string]$SdkType [boolean]$IsNewSdk [string]$ArtifactName + [string]$ReleaseDate PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory) { @@ -48,6 +49,12 @@ class PackageProps if (Test-Path (Join-Path $directoryPath "CHANGELOG.md")) { $this.ChangeLogPath = Join-Path $directoryPath "CHANGELOG.md" + # Get release date for current version and set in package property + $changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $this.ChangeLogPath -VersionString $this.Version + if ($changeLogEntry -and ![System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) + { + $this.ReleaseDate = $changeLogEntry.ReleaseStatus.Trim().Trim("()") + } } else { diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index 3de8943490..e4a1e96f26 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -22,6 +22,7 @@ if ($allPackageProperties) Write-Host "Package Version: $($pkg.Version)" Write-Host "Package SDK Type: $($pkg.SdkType)" Write-Host "Artifact Name: $($pkg.ArtifactName)" + Write-Host "Release date: $($pkg.ReleaseDate)" $configFilePrefix = $pkg.Name if ($pkg.ArtifactName) { From 6c4525c88eebf75c0bd3a1629a55af166b59dd8d Mon Sep 17 00:00:00 2001 From: Praveen Kuttappan Date: Thu, 24 Jun 2021 12:02:12 -0400 Subject: [PATCH 2/2] Change property name to ReleaseStatus --- eng/common/scripts/Create-APIReview.ps1 | 2 +- eng/common/scripts/Package-Properties.ps1 | 6 +++--- eng/common/scripts/Save-Package-Properties.ps1 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index 66f1f3bb46..456d249c9c 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -121,7 +121,7 @@ if ($packages) # Ignore API review status for prerelease version Write-Host "Package version is not GA. Ignoring API view approval status" } - elseif (!$pkgInfo.ReleaseDate -or $pkgInfo.ReleaseDate -eq "Unreleased") + elseif (!$pkgInfo.ReleaseStatus -or $pkgInfo.ReleaseStatus -eq "Unreleased") { Write-Host "Release date is not set for current version in change log file for package. Ignoring API review approval status since package is not yet ready for release." } diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index f0c077c04a..e00ea7bb9e 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -13,7 +13,7 @@ class PackageProps [string]$SdkType [boolean]$IsNewSdk [string]$ArtifactName - [string]$ReleaseDate + [string]$ReleaseStatus PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory) { @@ -51,9 +51,9 @@ class PackageProps $this.ChangeLogPath = Join-Path $directoryPath "CHANGELOG.md" # Get release date for current version and set in package property $changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $this.ChangeLogPath -VersionString $this.Version - if ($changeLogEntry -and ![System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) + if ($changeLogEntry -and !$changeLogEntry.ReleaseStatus) { - $this.ReleaseDate = $changeLogEntry.ReleaseStatus.Trim().Trim("()") + $this.ReleaseStatus = $changeLogEntry.ReleaseStatus.Trim().Trim("()") } } else diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index e4a1e96f26..26f4f17c88 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -22,7 +22,7 @@ if ($allPackageProperties) Write-Host "Package Version: $($pkg.Version)" Write-Host "Package SDK Type: $($pkg.SdkType)" Write-Host "Artifact Name: $($pkg.ArtifactName)" - Write-Host "Release date: $($pkg.ReleaseDate)" + Write-Host "Release date: $($pkg.ReleaseStatus)" $configFilePrefix = $pkg.Name if ($pkg.ArtifactName) {