Fix PMC publishing script and mapping#1635
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the EV2 publishing workflow for DSC Linux packages uploaded to packages.microsoft.com, correcting RPM filename mapping and aligning the published package name with the current versioning scheme while attempting to suppress colored output in logs.
Changes:
- Update RPM
PackageFormatin the PMC mapping to use the correct.archseparator (e.g.,-1.x86_64.rpm). - Adjust the publishing script to force package name to
dsc(preview/stable distinction is now carried in the version). - Switch from
NO_COLORto PowerShell output rendering controls to reduce ANSI color output in logs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/packages.microsoft.com/mapping.json | Fix RPM package filename format to match standard RPM naming (release.arch). |
| .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 | Update publishing behavior (color suppression approach + package naming). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:20
$PSStyle.OutputRenderingis not available in olderpwshversions; assigning it unconditionally can throw (e.g., when$PSStyleis$null) and abort the EV2 deployment. Guard this assignment so the script still runs on older PowerShell while keepingNO_COLORas a fallback.
$PSStyle.OutputRendering = 'PlainText'
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:20
- $PSStyle.OutputRendering is set unconditionally. $PSStyle (and/or the OutputRendering property) is not available in older pwsh versions, so this line can throw at script start and fail the EV2 run. Guard the assignment so it only runs when supported.
$PSStyle.OutputRendering = 'PlainText'
.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:110
- Get-PackageObjects mutates the function parameter $ReleaseVersion inside the foreach loop when handling RPM. Because the mapping lists RPM packages before DEB packages, this will also change the version string used to construct subsequent DEB filenames (e.g., preview versions will incorrectly use '~' instead of '-'), causing package path lookup failures.
if ($pkg.PackageFormat.EndsWith('.rpm')) {
# RPM requires no dashes in the version string, so replace any dashes with tildes
$ReleaseVersion = $ReleaseVersion.Replace('-', '~')
}
| } catch { | ||
| Write-Error -ErrorAction Stop $_.Exception.Message | ||
| Write-Error -ErrorAction Stop (Get-Error | Out-String) | ||
| return 1 | ||
| } |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:20
- $PSStyle.OutputRendering is assigned unconditionally. On older PowerShell versions where $PSStyle (or the OutputRendering property) isn't available, this will throw and can fail the EV2 deployment script early. Guard the assignment based on the PowerShell version so the script still runs when OutputRendering isn't supported.
$env:NO_COLOR = 1
$PSStyle.OutputRendering = 'PlainText'
.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:305
- In the catch block,
Write-Error -ErrorAction Stop ...raises a new terminating error, soreturn 1will never execute (the script will terminate with the new error instead). If the intent is to log the detailed error and exit with a non-zero code, write the error without-ErrorAction Stopand then return 1.
} catch {
Write-Error -ErrorAction Stop (Get-Error | Out-String)
return 1
}
PR Summary