From eb2bf0c448da2dfc109a03b2002342d24cb5526d Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 23 Jan 2025 17:22:10 -0500 Subject: [PATCH] [release/v7.4]PMC parse state correctly from update command's response (#24860) --- .../EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index fc00c871c9..25a5686b33 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -226,8 +226,9 @@ function Publish-PackageToPMC() { continue } - $state = $rawUpdateResponse.state - if ($state -ne 'Completed') { + $state = ($rawUpdateResponse | ConvertFrom-Json).state + Write-Verbose -Verbose "update response state: $state" + if ($state -ne 'completed') { $errorMessage.Add("Publishing package $($finalPackage.PackageName) to $pkgRepo failed: $rawUpdateResponse") continue } @@ -242,11 +243,19 @@ function Publish-PackageToPMC() { # At this point, the changes are staged and will eventually be publish. # Running publish, causes them to go live "immediately" + $rawPublishResponse = $null try { - pmc --config $ConfigPath repo publish $pkgRepo + $rawPublishResponse = pmc --config $ConfigPath repo publish $pkgRepo } catch { - $errorMessage.Add("Running final publish for package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") + $errorMessage.Add("Invoking final publish for package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") + continue + } + + $publishState = ($rawPublishResponse | ConvertFrom-Json).state + Write-Verbose -Verbose "publish response state: $publishState" + if ($publishState -ne 'completed') { + $errorMessage.Add("Final publishing of package $($finalPackage.PackageName) to $pkgRepo failed: $rawPublishResponse") continue } } else {