-
Notifications
You must be signed in to change notification settings - Fork 8.1k
[release/v7.6] Update the macos package name for preview releases to match the previous pattern #26576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/v7.6] Update the macos package name for preview releases to match the previous pattern #26576
Conversation
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
There was a problem hiding this 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 name validation pattern in the test file to align with the pipeline validation logic. The change removes support for the -preview prefix in package names (e.g., powershell-preview-7.6.0-...), as preview releases now use version strings instead (e.g., powershell-7.6.0-preview.6-...). This ensures test validation correctly matches the actual package naming convention used in the build pipeline.
Key changes:
- Updated regex pattern to remove
-previewprefix option while keeping-ltsprefix support - Revised example comments to reflect actual package naming patterns (version string for previews vs package name prefix)
- Added reference comment linking to pipeline validation pattern
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # - powershell-7.6.0-preview.6-osx-x64.pkg (Preview version string) | ||
| # - powershell-7.4.13-rebuild.5-osx-arm64.pkg (Rebuild version) | ||
| # - powershell-lts-7.4.13-osx-arm64.pkg (LTS package) | ||
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern has an unescaped dot in the preview/rebuild version capture group ([a-z]*.\d+\-)?. The dot should be escaped as \. to match a literal dot character, not any character.
Current: ([a-z]*.\d+\-)?
Should be: ([a-z]*\.\d+\-)?
Without escaping, the pattern would incorrectly match strings like "preview6" or "previewX6" instead of only matching "preview.6".
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' | |
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*\.\d+\-)?osx\-(x64|arm64)\.pkg$' |
| # - powershell-7.6.0-preview.6-osx-x64.pkg (Preview version string) | ||
| # - powershell-7.4.13-rebuild.5-osx-arm64.pkg (Rebuild version) | ||
| # - powershell-lts-7.4.13-osx-arm64.pkg (LTS package) | ||
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preview/rebuild version capture group uses [a-z]* which allows zero or more letters, making the entire prerelease identifier optional even when present. This would incorrectly match malformed names like "7.6.0-.6-osx-x64.pkg" (missing the word before the dot).
Current: ([a-z]*\.\d+\-)?
Should be: ([a-z]+\.\d+\-)?
Using [a-z]+ (one or more) ensures that if a prerelease identifier is present, it must have at least one letter before the dot.
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' | |
| $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]+\.\d+\-)?osx\-(x64|arm64)\.pkg$' |
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
Fixes test validation for macOS package naming convention. Required to ensure tests correctly validate that preview packages use version string instead of -preview prefix.
Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
Verified the regex pattern matches the validation used in .pipelines/templates/release-validate-packagenames.yml. Updated comments to reflect correct naming convention. No functional testing needed as this is a test pattern fix.
Risk
REQUIRED: Check exactly one box.
Low risk as this only fixes a test validation pattern. Does not affect actual package building or runtime behavior, only test validation to ensure package names follow correct convention.