Download PMC Packages through `TemplateContext` by jshigetomi · Pull Request #27326 · PowerShell/PowerShell · GitHub
Skip to content

Download PMC Packages through TemplateContext#27326

Merged
jshigetomi merged 12 commits intoPowerShell:masterfrom
jshigetomi:PMCFix
Apr 22, 2026
Merged

Download PMC Packages through TemplateContext#27326
jshigetomi merged 12 commits intoPowerShell:masterfrom
jshigetomi:PMCFix

Conversation

@jshigetomi
Copy link
Copy Markdown
Collaborator

@jshigetomi jshigetomi commented Apr 22, 2026

PR Summary

This pull request improves the Azure pipeline release process by enhancing flexibility and maintainability, especially for non-official (dry-run/test) releases. The main changes introduce parameterization for release environments, refactor artifact download steps to use templateContext.inputs, and add logic to optionally skip the Ev2 push step during test runs.

Key improvements include:

Pipeline parameterization and flexibility:

  • Added new parameters (releaseEnvironment, approvalServiceEnvironment, stagePrefix, skipEv2Push) to release-publish-pmc.yml, allowing the pipeline to target different environments (Production, PPE, Test) and to skip the Ev2 push step for dry-run scenarios.
  • Updated the non-official pipeline (PowerShell-Release-Azure-NonOfficial.yml) to run the publish stage with test parameters and skip the actual Ev2 push, enabling artifact download validation without affecting production.

Artifact download and handling improvements:

  • Refactored artifact download logic in release-prep-for-ev2.yml to use templateContext.inputs for specifying artifacts, replacing multiple explicit download steps with a more maintainable and declarative approach. [1] [2]
  • Updated the publish stage in release-publish-pmc.yml to use templateContext.inputs for artifact retrieval, ensuring consistency and simplifying artifact management.

Stage and job naming standardization:

  • Made stage and job names dynamic based on the stagePrefix parameter, improving clarity and compatibility with OneBranch requirements.

These changes collectively make the pipeline more robust, easier to test in non-production environments, and simpler to maintain.

PR Context

This PR was made to unblock 7.4.15 and 7.6.1 PMC releases after EV2 pipeline decided to disallow the DownloadArtifacts task.

PR Checklist

@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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think we have remove PowerShell here as well... Running one more time to confirm

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The fix here was to add tsa to the release-prep template

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Apr 22, 2026
Copy link
Copy Markdown
Member

@anamnavi anamnavi left a comment

Choose a reason for hiding this comment

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

LGTM

@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Apr 22, 2026
@jshigetomi jshigetomi marked this pull request as ready for review April 22, 2026 19:38
@jshigetomi jshigetomi requested a review from a team as a code owner April 22, 2026 19:38
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

This PR updates the Azure DevOps EV2/PMC release pipelines to use OneBranch templateContext.inputs for artifact downloads (avoiding disallowed download tasks) and to make the publish stage configurable for non-official/dry-run scenarios.

Changes:

  • Refactors EV2 prep + publish templates to download artifacts via templateContext.inputs instead of explicit download tasks.
  • Adds publish-stage parameters to support non-production environments and an option to skip the Ev2 push during dry-runs.
  • Updates official/non-official Azure release pipelines to run the publish stage in non-official mode and to use an explicit TSA options path.

Reviewed changes

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

File Description
.pipelines/templates/release-publish-pmc.yml Parameterizes PMC publish stage and switches artifact retrieval to templateContext.inputs; adds optional Ev2 push skip.
.pipelines/templates/release-prep-for-ev2.yml Moves PSPackagesOfficial artifact downloads into templateContext.inputs and adjusts package discovery accordingly; adds TSA config variable.
.pipelines/PowerShell-Release-Official-Azure.yml Updates tsaOptionsFile to an explicit path for TSA configuration.
.pipelines/NonOfficial/PowerShell-Release-Azure-NonOfficial.yml Updates tsaOptionsFile path and runs PMC publish stage in “Test” mode with Ev2 push skipped.

Comment on lines +16 to +20
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.

stagePrefix and releaseEnvironment can be set inconsistently (e.g., releaseEnvironment: PPE but leaving stagePrefix at default Prod), which would produce a stage name that doesn't match the actual release environment and can fail OneBranch environment/stage-name validation. Consider deriving the stage prefix from releaseEnvironment inside the template (e.g., map Production -> Prod, else use the environment name) so callers only need to set releaseEnvironment (and optionally override if there’s a true exception).

Copilot uses AI. Check for mistakes.
@jshigetomi jshigetomi merged commit 63544d1 into PowerShell:master Apr 22, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.4.x-Done Backport-7.5.x-Done Backport-7.6.x-Done 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.

5 participants