Skip to content

[release/v7.4] Fix macOS preview package identifier detection to use version string#26774

Merged
TravisEz13 merged 2 commits intoPowerShell:release/v7.4from
TravisEz13:backport/release/v7.4/26690-5fdc2a023
Feb 10, 2026
Merged

[release/v7.4] Fix macOS preview package identifier detection to use version string#26774
TravisEz13 merged 2 commits intoPowerShell:release/v7.4from
TravisEz13:backport/release/v7.4/26690-5fdc2a023

Conversation

@TravisEz13
Copy link
Member

Backport of #26690 to release/v7.4

Triggered by @TravisEz13 on behalf of @app/copilot-swe-agent

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Updates macOS packaging identifier detection so preview packages install to the correct preview location.

Customer Impact

  • Customer reported
  • Found internally

Fixes #26673 where preview packages installed to the stable path; expected preview installs to /usr/local/microsoft/powershell/7-preview.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

Regression introduced in PR #26268 when native macOS packaging tools replaced fpm.

Testing

Original PR added/updated unit tests in test/packaging/packaging.tests.ps1 covering preview, stable, and LTS scenarios, including the reported bug case.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Scoped change to macOS packaging identifier logic with unit test coverage, but it affects install paths for preview packages.

@TravisEz13 TravisEz13 requested a review from a team as a code owner February 10, 2026 17:06
Copilot AI review requested due to automatic review settings February 10, 2026 17:06
@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Feb 10, 2026
Copy link
Contributor

Copilot AI left a comment

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 backports the fix for issue #26673 from the main branch (PR #26690) to the release/v7.4 branch. The issue caused macOS preview packages to install to the stable location instead of the preview location, preventing users from having both stable and preview versions installed simultaneously.

Changes:

  • Replaced incorrect preview detection logic based on package name with correct version string-based detection
  • Centralized package identifier determination in new Get-MacOSPackageIdentifierInfo function
  • Added comprehensive unit tests covering preview, stable, and LTS scenarios

Reviewed changes

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

File Description
tools/packaging/packaging.psm1 Fixed preview detection in New-MacOSPackage and New-MacOSLauncher by using new Get-MacOSPackageIdentifierInfo function; inlined simple identifier logic in New-MacOsDistributionPackage; added LTS parameter to New-MacOSPackage
test/packaging/packaging.tests.ps1 Added comprehensive unit tests for Test-IsPreview and Get-MacOSPackageIdentifierInfo functions, including specific test case documenting the bug fix

@TravisEz13 TravisEz13 enabled auto-merge (squash) February 10, 2026 17:26
@TravisEz13
Copy link
Member Author

I ran the unit tests

@TravisEz13
Copy link
Member Author

Created #26776 to automatically run the unit tests

@TravisEz13 TravisEz13 merged commit 8bd316f into PowerShell:release/v7.4 Feb 10, 2026
38 checks passed
@TravisEz13 TravisEz13 deleted the backport/release/v7.4/26690-5fdc2a023 branch February 10, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants