Skip to content

Fix PMC publishing script and mapping#1635

Merged
SteveL-MSFT merged 10 commits into
PowerShell:mainfrom
SteveL-MSFT:pmc-path
Jul 23, 2026
Merged

Fix PMC publishing script and mapping#1635
SteveL-MSFT merged 10 commits into
PowerShell:mainfrom
SteveL-MSFT:pmc-path

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

  • disable color, appears that NO_COLOR is no longer working
  • package name should just be dsc as the preview is part of the version
  • fix mapping for rpm which should be a period between version and arch

Copilot AI review requested due to automatic review settings July 17, 2026 19:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 PackageFormat in the PMC mapping to use the correct .arch separator (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_COLOR to 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).

Comment thread .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1
Copilot AI review requested due to automatic review settings July 20, 2026 18:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.OutputRendering is not available in older pwsh versions; assigning it unconditionally can throw (e.g., when $PSStyle is $null) and abort the EV2 deployment. Guard this assignment so the script still runs on older PowerShell while keeping NO_COLOR as a fallback.
$PSStyle.OutputRendering = 'PlainText'

Comment thread .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1 Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 21:27
@SteveL-MSFT
SteveL-MSFT marked this pull request as draft July 20, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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('-', '~')
        }

Comment thread .pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1
Copilot AI review requested due to automatic review settings July 20, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, so return 1 will 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 Stop and then return 1.
} catch {
    Write-Error -ErrorAction Stop (Get-Error | Out-String)
    return 1
}

Copilot AI review requested due to automatic review settings July 22, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:21

  • $PSStyle.OutputRendering is only available in PowerShell 7.2+. This script runs under pwsh, but if EV2 uses an older version (e.g., 7.0/7.1), assigning OutputRendering will throw and abort the rollout. Guard this assignment so older PowerShell versions still run with NO_COLOR/TERM fallbacks.
$env:NO_COLOR = 1
$env:TERM = 'dumb'
$PSStyle.OutputRendering = 'PlainText'

.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:323

  • In this catch block, Write-Error -ErrorAction Stop throws a terminating error, so the following return 1 is unreachable. If the goal is a non-zero process exit code, prefer writing the error and using exit 1 explicitly (or remove the unreachable return).
    Write-Error -ErrorAction Stop (Get-Error | Out-String)
    return 1

Copilot AI review requested due to automatic review settings July 22, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:21

  • $PSStyle.OutputRendering is assigned unconditionally. On pwsh versions where $PSStyle doesn't exist (or doesn't expose OutputRendering), this line will throw and stop the EV2 run before any publishing happens. Guard the assignment so the script still runs when PSStyle isn't available.
$env:NO_COLOR = 1
$env:TERM = 'dumb'
$PSStyle.OutputRendering = 'PlainText'

Copilot AI review requested due to automatic review settings July 22, 2026 23:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 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:21

  • $PSStyle is not guaranteed to be present in all pwsh versions (it was introduced later than basic pwsh support). Assigning $PSStyle.OutputRendering unconditionally can throw ("You cannot call a method on a null-valued expression") and stop the rollout before any work is done. Guard the assignment so older pwsh versions still run with NO_COLOR/TERM fallbacks.
$PSStyle.OutputRendering = 'PlainText'

.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1:326

  • This script is launched via pwsh ./Run/Run.ps1 (see UploadLinux.Rollout.json), so return 1/return 0 at script scope does not reliably set the process exit code. As a result, EV2 may treat failures as success. Use exit to set the pwsh process exit code. Also, Get-Error is not available in all pwsh versions; re-emitting the current error record is more compatible.
    Write-Error (Get-Error | Out-String)
    return 1
}

return 0

@SteveL-MSFT
SteveL-MSFT marked this pull request as ready for review July 23, 2026 00:28
@SteveL-MSFT
SteveL-MSFT merged commit 3b740aa into PowerShell:main Jul 23, 2026
20 checks passed
@SteveL-MSFT
SteveL-MSFT deleted the pmc-path branch July 23, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants