Skip to content

Conversation

@adityapatwardhan
Copy link
Member

Backport of #26429 to release/v7.6

Triggered by @adityapatwardhan on behalf of @TravisEz13

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)

Fixes GitHub Actions workflow failures in release-validate-packagenames.yml by updating deprecated package naming patterns. Updates packaging module to use consistent naming convention. Essential for proper package validation and build processes.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Verified by running affected workflows in fork environment. Added comprehensive package name validation tests including regex patterns that match the pipeline validation. Confirmed the updated naming convention works correctly for stable, preview, rebuild, and LTS packages.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk as it affects build infrastructure and package validation, but the change is well-tested and follows established patterns. The fix prevents build failures and ensures consistent package naming across releases.

Merge Conflicts

Simple addition conflict in tools/packaging/releaseTests/macOSPackage.tests.ps1 - added new package name validation test cases that were missing from the release branch. Applied exact changes from original PR.

…ous pattern (PowerShell#26429)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 2, 2025 23:20
@adityapatwardhan adityapatwardhan requested review from a team and jshigetomi as code owners December 2, 2025 23:20
@adityapatwardhan adityapatwardhan added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Dec 2, 2025
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 updates the macOS package naming convention for PowerShell releases by removing the "powershell-preview" prefix and relying on the version string itself to identify preview releases (e.g., powershell-7.6.0-preview.6-osx-x64.pkg instead of powershell-preview-7.6.0-preview.6-osx-x64.pkg). This change aligns macOS package naming with other platforms and fixes validation failures in the CI/CD pipeline.

Key Changes:

  • Removed "powershell-preview" prefix from macOS package names; preview status is now indicated by the version string (e.g., "7.6.0-preview.6")
  • Updated pipeline validation regex to remove deprecated osx.10.12 support and enforce consistent dash placement between components
  • Added comprehensive test coverage to verify package naming conventions match pipeline validation rules

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tools/packaging/packaging.psm1 Simplified package naming logic to remove preview prefix, relying on version string to indicate preview status
tools/packaging/releaseTests/macOSPackage.tests.ps1 Added validation tests for package naming conventions including checks for correct format and prevention of deprecated x86_64 notation
.pipelines/templates/release-validate-packagenames.yml Updated validation regex to remove deprecated macOS 10.12 pattern and ensure consistent component separation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1150 to 1158
# Only LTS packages get a prefix in the name
# Preview versions are identified by the version string itself (e.g., 7.6.0-preview.6)
# Rebuild versions are also identified by the version string (e.g., 7.4.13-rebuild.5)
$Name = if($LTS) {
"powershell-lts"
}
elseif ($IsPreview) {
"powershell-preview"
}
else {
"powershell"
}
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

The code that sets $IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS has been removed, but $IsPreview is still referenced later in the function on lines 1170, 1186, and 1200. This will cause a runtime error when those lines are executed because $IsPreview will be undefined.

To fix this issue, add back the line that computes $IsPreview:

$IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS

This line should be added before line 1153 (before the $Name assignment), since the $IsPreview variable is needed later for determining the installation suffix and file paths.

Copilot uses AI. Check for mistakes.
@daxian-dbw daxian-dbw merged commit 47927a2 into PowerShell:release/v7.6 Dec 2, 2025
42 checks passed
@adityapatwardhan adityapatwardhan deleted the backport/release/v7.6/26429-4aa65a77b branch December 3, 2025 02:23
adityapatwardhan added a commit to adityapatwardhan/PowerShell that referenced this pull request Dec 5, 2025
Update test/packaging/macos/package-validation.tests.ps1 with correct regex pattern
for macOS package naming validation. This file was missed in the original backport
PR PowerShell#26562.

Changes:
- Remove (-preview|-lts)? pattern (no more -preview in names)
- Update to (lts-)? - only LTS gets prefix
- Update comments to reflect new naming convention
- Match validation used in release-validate-packagenames.yml
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