Skip to content

[release/v7.5.6] Create LTS pkg and non-LTS pkg for macOS for LTS releases#27162

Merged
adityapatwardhan merged 1 commit into
PowerShell:release/v7.5.6from
adityapatwardhan:backport/release/v7.5.6/27039-8c9c9e118
Apr 3, 2026
Merged

[release/v7.5.6] Create LTS pkg and non-LTS pkg for macOS for LTS releases#27162
adityapatwardhan merged 1 commit into
PowerShell:release/v7.5.6from
adityapatwardhan:backport/release/v7.5.6/27039-8c9c9e118

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

Backport of #27039 to release/v7.5.6

Triggered by @adityapatwardhan on behalf of @daxian-dbw

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)

Required tooling change for release/v7.5.6. Enables both LTS and non-LTS packages to be created for macOS in LTS releases. Previously, the pipeline could only create one type. This change separates package creation logic, allowing both package types to be built from a single pipeline run.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Original PR was verified by CI pipeline validation. Backport testing includes:

  • Cherry-pick validation: No merge conflicts detected
  • Template syntax validation: YAML structure preserved
  • Logical flow verification: Changes properly separate LTS vs non-LTS package creation
  • Metadata validation check ensures proper safeguards are in place

CI will validate the pipeline changes on the release branch.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk due to changes in macOS build pipeline. However, changes are well-scoped to the mac-package-build.yml template and primarily affect only macOS packaging for LTS releases. The added metadata.json validation improves robustness. No changes affect Windows, Linux, or other platforms. The separation of LTS and non-LTS package builds is a logical improvement that reduces complexity.

@adityapatwardhan adityapatwardhan added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 2, 2026
Copilot AI review requested due to automatic review settings April 2, 2026 21:23
@adityapatwardhan adityapatwardhan requested a review from a team as a code owner April 2, 2026 21:23
Copy link
Copy Markdown
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

Backports pipeline template changes to enable producing both non-LTS and LTS macOS installer packages from a single LTS release run, using tools/metadata.json to decide when to build the additional LTS package.

Changes:

  • Add a preflight check to fail early if tools/metadata.json is missing before reading it.
  • Always build the non-LTS .pkg, and additionally build an LTS .pkg when $metadata.LTSRelease.Package is true (and not a rebuild branch).
  • Ensure the LTS logging line is emitted with -Verbose.

Comment on lines +105 to 109
if (-not (Test-Path "$repoRoot/tools/metadata.json")) {
throw "metadata.json not found in $repoRoot/tools"
}

$metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The thrown message is a bit ambiguous: it says metadata.json not found in "$repoRoot/tools" but the check is for the specific file path "$repoRoot/tools/metadata.json". Consider including the full path you tested (and/or the resolved $repoRoot value) to make failures easier to diagnose on build agents.

Suggested change
if (-not (Test-Path "$repoRoot/tools/metadata.json")) {
throw "metadata.json not found in $repoRoot/tools"
}
$metadata = Get-Content "$repoRoot/tools/metadata.json" -Raw | ConvertFrom-Json
$metadataPath = "$repoRoot/tools/metadata.json"
if (-not (Test-Path $metadataPath)) {
throw "metadata.json not found at path: $metadataPath"
}
$metadata = Get-Content $metadataPath -Raw | ConvertFrom-Json

Copilot uses AI. Check for mistakes.
@adityapatwardhan adityapatwardhan merged commit 67f9569 into PowerShell:release/v7.5.6 Apr 3, 2026
39 checks passed
@adityapatwardhan adityapatwardhan deleted the backport/release/v7.5.6/27039-8c9c9e118 branch April 3, 2026 00:59
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