[release/v7.6.1] Download PMC Packages through `TemplateContext` by jshigetomi · Pull Request #27331 · PowerShell/PowerShell · GitHub
Skip to content

[release/v7.6.1] Download PMC Packages through TemplateContext#27331

Merged
jshigetomi merged 1 commit intoPowerShell:release/v7.6.1from
jshigetomi:backport/release/v7.6.1/27326-63544d18b
Apr 22, 2026
Merged

[release/v7.6.1] Download PMC Packages through TemplateContext#27331
jshigetomi merged 1 commit intoPowerShell:release/v7.6.1from
jshigetomi:backport/release/v7.6.1/27326-63544d18b

Conversation

@jshigetomi
Copy link
Copy Markdown
Collaborator

Backport of #27326 to release/v7.6.1

Triggered by @jshigetomi on behalf of @jshigetomi

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. Modifies the Azure DevOps release pipeline templates that publish PowerShell packages to PMC (packages.microsoft.com) via Ev2. Without this change, the v7.6.1 release pipeline cannot publish packages because the Ev2 environment has disallowed the previously-used DownloadPipelineArtifact task in the publish stage. The PR migrates artifact download to templateContext.inputs, parameterizes the publish stage (releaseEnvironment / approvalServiceEnvironment / stagePrefix / skipEv2Push), and adds a NonOfficial dry-run path that validates the new artifact download approach without performing the actual Ev2 push.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Verified by:

  1. Cherry-picking the merge commit cleanly onto release/v7.6.1 with no conflicts.
  2. Pipeline-level validation will occur via the NonOfficial dry-run pipeline once this PR's CI runs (the original PR specifically added a NonOfficial path that exercises templateContext.inputs artifact download with skipEv2Push: true).

Functional verification of PMC publishing will happen during the actual v7.6.1 release using the publish stage with production parameters.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

High risk because this modifies the release publishing pipeline (Ev2 push to PMC) on the live release branch. However, not taking this change blocks the v7.6.1 PMC release entirely — the Ev2 pipeline has disallowed the previous DownloadArtifacts task, so the existing pipeline cannot run. The change has been validated in master and is the explicit reason the original PR was authored ("PR was made to unblock 7.4.15 and 7.6.1 PMC releases"). Note: original PR currently has Backport-7.6.x-Consider (not Approved) — proceeding at user request given the unblock-release justification stated in the PR body.

Co-authored-by: Justin Chung <chungjustin@microsoft.com>
@jshigetomi jshigetomi requested a review from a team as a code owner April 22, 2026 20:30
@jshigetomi jshigetomi added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 22, 2026
Copilot AI review requested due to automatic review settings April 22, 2026 20:30
@jshigetomi jshigetomi merged commit 57a6c42 into PowerShell:release/v7.6.1 Apr 22, 2026
37 checks passed
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

Backport to release/v7.6.1 that updates the PMC (packages.microsoft.com) EV2 publishing pipeline to download artifacts via OneBranch templateContext.inputs instead of DownloadPipelineArtifact, and adds parameters to support non-prod/dry-run execution.

Changes:

  • Refactor EV2 prep/publish templates to use templateContext.inputs for pipeline artifact acquisition.
  • Parameterize the PMC publish stage (environment/stage prefix) and add skipEv2Push for dry-runs.
  • Update the NonOfficial release pipeline to run a Test-prefixed publish stage with skipEv2Push: true.

Reviewed changes

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

File Description
.pipelines/templates/release-publish-pmc.yml Adds stage/job parameterization, uses templateContext.inputs for artifact download, and gates EV2 push behind skipEv2Push.
.pipelines/templates/release-prep-for-ev2.yml Switches package artifact downloads to templateContext.inputs and adjusts the copy logic to match the new download layout.
.pipelines/PowerShell-Release-Official-Azure.yml Updates TSA options file path for the OneBranch global SDL configuration.
.pipelines/NonOfficial/PowerShell-Release-Azure-NonOfficial.yml Updates TSA options file path and adds a dry-run PMC publish stage invocation.

policheck:
break: true # always break the build on policheck issues. You can disable it by setting to 'false'
tsaOptionsFile: .config\tsaoptions.json
tsaOptionsFile: $(Build.SourcesDirectory)\.config\tsaoptions.json
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

tsaOptionsFile now points to $(Build.SourcesDirectory)\.config\tsaoptions.json, but in these OneBranch pipelines the repo content is typically under $(Build.SourcesDirectory)\PowerShell (for example, templates default REPOROOT to that). This path will likely not resolve and can break TSA upload. Update this to $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json (or revert to the prior repo-relative .config\tsaoptions.json if that’s what OneBranch expects).

Suggested change
tsaOptionsFile: $(Build.SourcesDirectory)\.config\tsaoptions.json
tsaOptionsFile: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json

Copilot uses AI. Check for mistakes.
policheck:
break: true # always break the build on policheck issues. You can disable it by setting to 'false'
tsaOptionsFile: .config\tsaoptions.json
tsaOptionsFile: $(Build.SourcesDirectory)\.config\tsaoptions.json
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

tsaOptionsFile now points to $(Build.SourcesDirectory)\.config\tsaoptions.json, but these OneBranch pipelines commonly have the repo under $(Build.SourcesDirectory)\PowerShell (templates default REPOROOT accordingly). This path may not exist and can break TSA upload. Update to $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json (or use a repo-relative .config\tsaoptions.json if required by the governed template).

Suggested change
tsaOptionsFile: $(Build.SourcesDirectory)\.config\tsaoptions.json
tsaOptionsFile: $(Build.SourcesDirectory)\PowerShell\.config\tsaoptions.json

Copilot uses AI. Check for mistakes.
- job: ${{ parameters.stagePrefix }}_ReleaseJob
displayName: Publish to PMC
pool:
type: release
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The release pool here doesn’t specify os: windows, while other release templates in this repo consistently set it (for example release-githubNuget.yml and release-MSIX-Publish.yml). Since the EV2 task is Windows-only, explicitly set pool.os: windows to avoid the job landing on an incompatible release agent.

Suggested change
type: release
type: release
os: windows

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +56
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

When skipEv2Push is true, this job expands to having no steps at all (the only step is conditionally omitted). That makes the NonOfficial “dry-run” stage less useful for validating the downloaded EV2 payload and can also be brittle for pipeline diagnostics. Consider adding a lightweight validation/logging step (e.g., list $(Pipeline.Workspace)/EV2Specs or assert RolloutSpec.json exists) that runs when skipEv2Push is true (or always).

Copilot uses AI. Check for mistakes.
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.

2 participants