From 49c1d6061722b1fccc216099b4dada1538de90ae Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Fri, 17 Jul 2026 12:54:49 -0700 Subject: [PATCH 1/8] Fix PMC publishing script and mapping --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 4 ++-- tools/packages.microsoft.com/mapping.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index f4036c2d8..b34ae6d14 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -16,7 +16,7 @@ - PMC_METADATA: URL to the pmcMetadata.json file #> -$env:NO_COLOR = 1 +$PSStyle.OutputRendering = 'PlainText' function Get-MappedRepositoryIds { param( @@ -277,7 +277,7 @@ try { $skipPublish = $metadataContent.SkipPublish $channel = if ($releaseVersion.Contains('-')) { 'preview' } else { 'stable' } - $packageName = $channel -eq 'preview' ? 'dsc-preview' : 'dsc' + $packageName = 'dsc' Write-Verbose "Release version: $releaseVersion, Channel: $channel" -Verbose diff --git a/tools/packages.microsoft.com/mapping.json b/tools/packages.microsoft.com/mapping.json index bd2d77421..e11cb72fc 100644 --- a/tools/packages.microsoft.com/mapping.json +++ b/tools/packages.microsoft.com/mapping.json @@ -5,28 +5,28 @@ "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1_x86_64.rpm" + "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.x86_64.rpm" }, { "url": "microsoft-rhel9.0-prod", "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1_x86_64.rpm" + "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.x86_64.rpm" }, { "url": "microsoft-rhel8.0-prod", "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1_aarch64.rpm" + "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.aarch64.rpm" }, { "url": "microsoft-rhel9.0-prod", "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1_aarch64.rpm" + "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.aarch64.rpm" }, { "url": "microsoft-debian-bullseye-prod", From f7edcf987b51e6f7150c0ea4e3fdf01998f94220 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Fri, 17 Jul 2026 13:00:58 -0700 Subject: [PATCH 2/8] put back NO_COLOR --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index b34ae6d14..29b7b4fc1 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -16,6 +16,7 @@ - PMC_METADATA: URL to the pmcMetadata.json file #> +$env:NO_COLOR = 1 $PSStyle.OutputRendering = 'PlainText' function Get-MappedRepositoryIds { From 1143028528dba988cfd241df0128fb8ac3dbcfd4 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 20 Jul 2026 11:37:39 -0700 Subject: [PATCH 3/8] Fix rpm pkg name --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 4 ---- tools/packages.microsoft.com/mapping.json | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index 29b7b4fc1..1c28a915b 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -105,10 +105,6 @@ function Get-PackageObjects { $pkgName = $pkg.PackageFormat.Replace('PACKAGE_NAME', $PackageName).Replace('RELEASE_VERSION', $ReleaseVersion) - if ($pkgName.EndsWith('.rpm')) { - $pkgName = $pkgName.Replace($ReleaseVersion, $ReleaseVersion.Replace('-', '_')) - } - $packagePath = "$script:dscPackagesFolder/$pkgName" if (-not (Test-Path -Path $packagePath)) { throw "Package path $packagePath does not exist" diff --git a/tools/packages.microsoft.com/mapping.json b/tools/packages.microsoft.com/mapping.json index e11cb72fc..2a657062f 100644 --- a/tools/packages.microsoft.com/mapping.json +++ b/tools/packages.microsoft.com/mapping.json @@ -5,28 +5,28 @@ "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.x86_64.rpm" + "PackageFormat": "PACKAGE_NAME-RELEASE_VERSION-1.x86_64.rpm" }, { "url": "microsoft-rhel9.0-prod", "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.x86_64.rpm" + "PackageFormat": "PACKAGE_NAME-RELEASE_VERSION-1.x86_64.rpm" }, { "url": "microsoft-rhel8.0-prod", "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.aarch64.rpm" + "PackageFormat": "PACKAGE_NAME-RELEASE_VERSION-1.aarch64.rpm" }, { "url": "microsoft-rhel9.0-prod", "distribution": [ "stable" ], - "PackageFormat": "PACKAGE_NAME_RELEASE_VERSION-1.aarch64.rpm" + "PackageFormat": "PACKAGE_NAME-RELEASE_VERSION-1.aarch64.rpm" }, { "url": "microsoft-debian-bullseye-prod", From 82807c5808cdf032e0e6918f16799f50a4b1cd01 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 20 Jul 2026 11:59:07 -0700 Subject: [PATCH 4/8] fix RPM version string --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index 1c28a915b..54b544da3 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -103,6 +103,11 @@ function Get-PackageObjects { $pkgRepo = $pkg.RepoId | Select-Object -First 1 $pkgDistribution = $pkg.Distribution | Select-Object -First 1 + if ($pkgName.EndsWith('.rpm')) { + # RPM requires no dashes in the version string, so replace any dashes with tildes + $ReleaseVersion = $ReleaseVersion.Replace('-', '~') + } + $pkgName = $pkg.PackageFormat.Replace('PACKAGE_NAME', $PackageName).Replace('RELEASE_VERSION', $ReleaseVersion) $packagePath = "$script:dscPackagesFolder/$pkgName" From d74eb1e91c826a1319e0339aebcf8f55baa60c18 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 20 Jul 2026 14:27:07 -0700 Subject: [PATCH 5/8] Fix detection of rpm --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index 54b544da3..80c41fafe 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -103,7 +103,7 @@ function Get-PackageObjects { $pkgRepo = $pkg.RepoId | Select-Object -First 1 $pkgDistribution = $pkg.Distribution | Select-Object -First 1 - if ($pkgName.EndsWith('.rpm')) { + if ($pkg.PackageFormat.EndsWith('.rpm')) { # RPM requires no dashes in the version string, so replace any dashes with tildes $ReleaseVersion = $ReleaseVersion.Replace('-', '~') } @@ -299,7 +299,7 @@ try { Write-Verbose "SkipPublish: $skipPublish" -Verbose Publish-PackageToPMC -PackageObject $packageObjects -ConfigPath $configPath -SkipPublish $skipPublish } catch { - Write-Error -ErrorAction Stop $_.Exception.Message + Write-Error -ErrorAction Stop (Get-Error | Out-String) return 1 } From 0eadba10598be46d04fda9108b095ae9aa84ffaf Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 20 Jul 2026 14:45:25 -0700 Subject: [PATCH 6/8] fix to not mutate original $packageVersion --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index 80c41fafe..677c86670 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -103,12 +103,13 @@ function Get-PackageObjects { $pkgRepo = $pkg.RepoId | Select-Object -First 1 $pkgDistribution = $pkg.Distribution | Select-Object -First 1 + $pkgReleaseVersion = $ReleaseVersion if ($pkg.PackageFormat.EndsWith('.rpm')) { # RPM requires no dashes in the version string, so replace any dashes with tildes - $ReleaseVersion = $ReleaseVersion.Replace('-', '~') + $pkgReleaseVersion = $pkgReleaseVersion.Replace('-', '~') } - $pkgName = $pkg.PackageFormat.Replace('PACKAGE_NAME', $PackageName).Replace('RELEASE_VERSION', $ReleaseVersion) + $pkgName = $pkg.PackageFormat.Replace('PACKAGE_NAME', $PackageName).Replace('RELEASE_VERSION', $pkgReleaseVersion) $packagePath = "$script:dscPackagesFolder/$pkgName" if (-not (Test-Path -Path $packagePath)) { From 5a8ebc7632a6839c9c070a9978ff1923673215ab Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 21 Jul 2026 16:07:27 -0700 Subject: [PATCH 7/8] add more test tracing --- .../ServiceGroupRoot/Shell/Run/Run.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index 677c86670..2c562bf33 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -17,6 +17,7 @@ #> $env:NO_COLOR = 1 +$env:TERM = 'dumb' $PSStyle.OutputRendering = 'PlainText' function Get-MappedRepositoryIds { @@ -152,6 +153,9 @@ function Publish-PackageToPMC { $packageType = $extension -replace '^\.' $packageListJson = pmc --config $ConfigPath package $packageType list --file $packagePath + if ($LASTEXITCODE -ne 0) { + throw "pmc package $packageType list failed with exit code $LASTEXITCODE; --config '$ConfigPath' package $packageType list --file '$packagePath'" + } $list = $packageListJson | ConvertFrom-Json $packageId = @() @@ -163,6 +167,9 @@ function Publish-PackageToPMC { $uploadResult = $null try { $uploadResult = pmc --config $ConfigPath package upload $packagePath --type $packageType + if ($LASTEXITCODE -ne 0) { + throw "pmc package upload failed with exit code $LASTEXITCODE; --config '$ConfigPath' package upload '$packagePath' --type '$packageType'" + } } catch { $errorMessages.Add("Uploading package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") continue @@ -181,8 +188,14 @@ function Publish-PackageToPMC { try { if ($packageType -eq 'rpm') { $rawUpdateResponse = pmc --config $ConfigPath repo package update $pkgRepo --add-packages $packageId + if ($LASTEXITCODE -ne 0) { + throw "pmc repo package update failed with exit code $LASTEXITCODE; --config '$ConfigPath' repo package update '$pkgRepo' --add-packages '$packageId'" + } } elseif ($packageType -eq 'deb') { $rawUpdateResponse = pmc --config $ConfigPath repo package update $pkgRepo $distribution --add-packages $packageId + if ($LASTEXITCODE -ne 0) { + throw "pmc repo package update failed with exit code $LASTEXITCODE; --config '$ConfigPath' repo package update '$pkgRepo' '$distribution' --add-packages '$packageId'" + } } else { throw "Unsupported package type: $packageType" } @@ -201,6 +214,9 @@ function Publish-PackageToPMC { $rawPublishResponse = $null try { $rawPublishResponse = pmc --config $ConfigPath repo publish $pkgRepo + if ($LASTEXITCODE -ne 0) { + throw "pmc repo publish failed with exit code $LASTEXITCODE; --config '$ConfigPath' repo publish '$pkgRepo'" + } } catch { $errorMessages.Add("Final publish for package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") continue @@ -287,6 +303,9 @@ try { # Get PMC repository list Write-Verbose "Getting PMC repository list" -Verbose $rawResponse = pmc --config $configPath repo list --limit 800 + if ($LASTEXITCODE -ne 0) { + throw "pmc repo list failed with exit code $LASTEXITCODE; --config '$configPath' repo list --limit 800" + } $response = $rawResponse | ConvertFrom-Json Write-Verbose "PMC repo list: limit=$($response.limit), count=$($response.count)" -Verbose $repoList = $response.results From e552c013e1f1335121c950173a4759d7b64d1480 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 21 Jul 2026 16:12:15 -0700 Subject: [PATCH 8/8] address feedback --- .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 index 2c562bf33..f63bf1ed8 100644 --- a/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 +++ b/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 @@ -171,7 +171,7 @@ function Publish-PackageToPMC { throw "pmc package upload failed with exit code $LASTEXITCODE; --config '$ConfigPath' package upload '$packagePath' --type '$packageType'" } } catch { - $errorMessages.Add("Uploading package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") + $errorMessages.Add("Uploading package $($finalPackage.PackageName) to $pkgRepo failed: $($_.Exception.Message)") continue } @@ -200,7 +200,7 @@ function Publish-PackageToPMC { throw "Unsupported package type: $packageType" } } catch { - $errorMessages.Add("Update for package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") + $errorMessages.Add("Update for package $($finalPackage.PackageName) to $pkgRepo failed: $($_.Exception.Message)") continue } @@ -218,7 +218,7 @@ function Publish-PackageToPMC { throw "pmc repo publish failed with exit code $LASTEXITCODE; --config '$ConfigPath' repo publish '$pkgRepo'" } } catch { - $errorMessages.Add("Final publish for package $($finalPackage.PackageName) to $pkgRepo failed. See errors above for details.") + $errorMessages.Add("Final publish for package $($finalPackage.PackageName) to $pkgRepo failed: $($_.Exception.Message)") continue }