Skip to content

[release/v7.5.6] Separate Official and NonOfficial templates for ADO pipelines#27155

Merged
adityapatwardhan merged 1 commit intoPowerShell:release/v7.5.6from
adityapatwardhan:backport/release/v7.5.6/26897-f9be17e6b
Apr 3, 2026
Merged

[release/v7.5.6] Separate Official and NonOfficial templates for ADO pipelines#27155
adityapatwardhan merged 1 commit intoPowerShell:release/v7.5.6from
adityapatwardhan:backport/release/v7.5.6/26897-f9be17e6b

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

Backport of #26897 to release/v7.5.6

Triggered by @adityapatwardhan 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)

Separates official and non-official ADO pipeline templates and shared stage/variable templates so release/v7.5.6 pipeline definitions follow current structure and remain maintainable.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Verified the backport by successful cherry-pick onto release/v7.5.6, resolving YAML conflicts in three official pipeline files, and confirming the resulting commit contains the expected file adds/renames/template references from the original PR.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

This is a broad pipeline refactor affecting multiple YAML definitions, but the changes are a direct backport of a merged PR and conflicts were resolved by taking the original PR intent/template-based structure.

Merge Conflicts

Resolved conflicts in .pipelines/PowerShell-Coordinated_Packages-Official.yml, .pipelines/PowerShell-Release-Official.yml, and .pipelines/PowerShell-vPack-Official.yml by accepting the incoming template-based sections from PR #26897 to preserve backport intent.

…hell#26897)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adityapatwardhan adityapatwardhan requested a review from a team as a code owner April 2, 2026 20:30
@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 20:30
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 of #26897 to release/v7.5.6, restructuring Azure DevOps pipeline definitions to split Official vs NonOfficial pipelines and extracting shared variables/stages into reusable templates to align with current OneBranch template patterns.

Changes:

  • Added shared variable/stage templates for Packages, Coordinated Packages, Release, and vPack pipelines.
  • Refactored Official pipeline YAMLs to reference the extracted templates instead of inlining variables/stages.
  • Added new NonOfficial pipeline YAMLs that reuse the same shared templates while hardcoding NonOfficial governed templates.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
.pipelines/templates/variables/release-shared.yml New shared variable set for release publishing jobs (GH/NuGet/MSIX).
.pipelines/templates/variables/PowerShell-vPack-Variables.yml Extracted vPack pipeline variables into a template.
.pipelines/templates/variables/PowerShell-Release-Variables.yml Extracted Release pipeline variables into a template.
.pipelines/templates/variables/PowerShell-Release-Azure-Variables.yml Extracted Release-Azure pipeline variables into a template.
.pipelines/templates/variables/PowerShell-Packages-Variables.yml Extracted Packages pipeline variables into a template.
.pipelines/templates/variables/PowerShell-Coordinated_Packages-Variables.yml Extracted Coordinated Packages variables and adds CodeQL gating variables.
.pipelines/templates/stages/PowerShell-vPack-Stages.yml Extracted vPack stages/jobs into a template.
.pipelines/templates/stages/PowerShell-Release-Stages.yml Extracted Release stage orchestration into a template.
.pipelines/templates/stages/PowerShell-Packages-Stages.yml Extracted Packages stages into a template.
.pipelines/templates/stages/PowerShell-Coordinated_Packages-Stages.yml Extracted Coordinated Packages stages into a template.
.pipelines/templates/release-MSIX-Publish.yml Updates shared variable template reference path.
.pipelines/templates/release-githubNuget.yml Updates shared variable template reference path (and relies on stage output variables).
.pipelines/PowerShell-vPack-Official.yml Refactors Official vPack pipeline to use shared variable/stage templates.
.pipelines/PowerShell-Release-Official.yml Refactors Official Release pipeline to use shared variable/stage templates.
.pipelines/PowerShell-Release-Official-Azure.yml Refactors Official Release-Azure pipeline to use shared variables template.
.pipelines/PowerShell-Packages-Official.yml Refactors Official Packages pipeline to use shared variable/stage templates.
.pipelines/PowerShell-Coordinated_Packages-Official.yml Refactors Official Coordinated Packages pipeline to use shared templates and new CodeQL wiring.
.pipelines/NonOfficial/PowerShell-vPack-NonOfficial.yml Adds NonOfficial vPack pipeline using shared templates.
.pipelines/NonOfficial/PowerShell-Release-NonOfficial.yml Adds NonOfficial Release pipeline using shared templates and NonOfficial artifact sources.
.pipelines/NonOfficial/PowerShell-Release-Azure-NonOfficial.yml Adds NonOfficial Release-Azure pipeline wiring.
.pipelines/NonOfficial/PowerShell-Packages-NonOfficial.yml Adds NonOfficial Packages pipeline using shared templates.
.pipelines/NonOfficial/PowerShell-Coordinated_Packages-NonOfficial.yml Adds NonOfficial Coordinated Packages pipeline using shared templates and CodeQL wiring.
.github/agents/SplitADOPipelines.agent.md Adds an internal guide/agent spec documenting the split/templating process.

- template: ./variable/release-shared.yml@self
- template: ./variables/release-shared.yml@self
parameters:
VERSION: $[ stageDependencies.setReleaseTagAndChangelog.SetTagAndChangelog.outputs['OutputVersion.Version'] ]
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.

In NuGetPublish, the stageDependencies reference uses SetTagAndChangelog (capital S/T/C), but the job name in release-SetTagAndChangelog.yml is setTagAndChangelog. This will fail to resolve OutputVersion.Version. Update the reference to use the correct job name casing.

Suggested change
VERSION: $[ stageDependencies.setReleaseTagAndChangelog.SetTagAndChangelog.outputs['OutputVersion.Version'] ]
VERSION: $[ stageDependencies.setReleaseTagAndChangelog.setTagAndChangelog.outputs['OutputVersion.Version'] ]

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +58
- ${{ if eq(parameters['FORCE_CODEQL'],'true') }}:
# Cadence is hours before CodeQL will allow a re-upload of the database
- name: CodeQL.Cadence
value: 1
- name: CODEQL_ENABLED
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(parameters['FORCE_CODEQL'],'true')) }}:
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.

FORCE_CODEQL is declared as a boolean parameter, but the condition compares it to the string 'true'. This prevents the CodeQL.Cadence override from ever being set when the parameter is true. Compare against the boolean true (or use an if parameters.FORCE_CODEQL check).

Suggested change
- ${{ if eq(parameters['FORCE_CODEQL'],'true') }}:
# Cadence is hours before CodeQL will allow a re-upload of the database
- name: CodeQL.Cadence
value: 1
- name: CODEQL_ENABLED
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(parameters['FORCE_CODEQL'],'true')) }}:
- ${{ if eq(parameters['FORCE_CODEQL'], true) }}:
# Cadence is hours before CodeQL will allow a re-upload of the database
- name: CodeQL.Cadence
value: 1
- name: CODEQL_ENABLED
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(parameters['FORCE_CODEQL'], true)) }}:

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +58
- ${{ if eq(parameters['FORCE_CODEQL'],'true') }}:
# Cadence is hours before CodeQL will allow a re-upload of the database
- name: CodeQL.Cadence
value: 1
- name: CODEQL_ENABLED
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(parameters['FORCE_CODEQL'],'true')) }}:
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.

FORCE_CODEQL is a boolean parameter, but CODEQL_ENABLED is computed by comparing it to the string 'true', so forcing CodeQL on won't work. Use a boolean comparison (and consider whether refs/heads/master is the only branch that should enable CodeQL).

Suggested change
- ${{ if eq(parameters['FORCE_CODEQL'],'true') }}:
# Cadence is hours before CodeQL will allow a re-upload of the database
- name: CodeQL.Cadence
value: 1
- name: CODEQL_ENABLED
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(parameters['FORCE_CODEQL'],'true')) }}:
- ${{ if eq(parameters.FORCE_CODEQL, true) }}:
# Cadence is hours before CodeQL will allow a re-upload of the database
- name: CodeQL.Cadence
value: 1
- name: CODEQL_ENABLED
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(parameters.FORCE_CODEQL, true)) }}:

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +45
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase

- pwsh: |
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: Capture environment variables
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
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.

This job explicitly disables OneBranch signing setup (ob_signing_setup_enabled: false), but the following steps still force ob_restore_phase: true. Per OneBranch signing guidance, restore phase is only useful when signing is enabled; otherwise it adds overhead/confusion. Remove ob_restore_phase from these steps (or re-enable signing setup if this stage actually needs signing).

Suggested change
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
- pwsh: |
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: Capture environment variables
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
- pwsh: |
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: Capture environment variables

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +45
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase

- pwsh: |
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: Capture environment variables
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
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.

This PowerShell step also runs in ob_restore_phase even though the job has signing setup disabled. If this stage is build-only (no signing), drop ob_restore_phase here as well to avoid running a restore phase without signing.

Suggested change
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
- pwsh: |
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: Capture environment variables
env:
ob_restore_phase: true # This ensures checkout is done at the beginning of the restore phase
- pwsh: |
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: Capture environment variables

Copilot uses AI. Check for mistakes.
throw "No files found in $(Pipeline.Workspace)\Symbols_$(Architecture)"
}
$vpackFiles
displayName: Debug Output Directory and Version
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.

These two debug steps use the same display name (Debug Output Directory and Version). Duplicate display names make logs harder to interpret; rename one (for example, clarify which step is validating file presence vs printing versions).

Suggested change
displayName: Debug Output Directory and Version
displayName: Validate vPack Output Files

Copilot uses AI. Check for mistakes.
ob_createvpack_verbose: true
ob_createvpack_packagename: '${{ parameters.vPackName }}.$(architecture)'
ob_createvpack_description: PowerShell $(architecture) $(version)
# I think the variables reload after we transition back to the host so this works. 🤷‍♂️
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.

This comment indicates uncertainty about behavior and includes an emoji. Please replace it with a deterministic explanation of why this works (or remove it) so future maintainers don't have to guess about variable evaluation behavior.

Suggested change
# I think the variables reload after we transition back to the host so this works. 🤷‍♂️
# These values use Azure Pipelines macro syntax, so they are expanded at runtime
# from variables set earlier in the job by SetVersionVariables.yml.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +10
This agent will implement and restructure the repository's existing ADO pipelines into Official and NonOfficial pipelines.

A repository will have under the ./pipelines directory a series of yaml files that define the ADO pipelines for the repository.

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.

This agent guide refers to a ./pipelines directory, but this repository uses .pipelines/. Update the paths/examples so they match the actual repo layout.

Copilot uses AI. Check for mistakes.
disableNetworkIsolation: ${{ variables.disableNetworkIsolation }}
globalSdl:
disableLegacyManifest: true
# disabled Armorty as we dont have any ARM templates to scan. It fails on some sample ARM templates.
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.

Typo in comment: Armorty should be Armory (and consider "don't" instead of "dont").

Suggested change
# disabled Armorty as we dont have any ARM templates to scan. It fails on some sample ARM templates.
# disabled Armory as we don't have any ARM templates to scan. It fails on some sample ARM templates.

Copilot uses AI. Check for mistakes.
incrementalSDLBinaryAnalysis: true
globalSdl:
disableLegacyManifest: true
# disabled Armorty as we dont have any ARM templates to scan. It fails on some sample ARM templates.
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.

Typo in comment: Armorty should be Armory (and consider "don't" instead of "dont").

Suggested change
# disabled Armorty as we dont have any ARM templates to scan. It fails on some sample ARM templates.
# disabled Armory as we don't have any ARM templates to scan. It fails on some sample ARM templates.

Copilot uses AI. Check for mistakes.
@adityapatwardhan adityapatwardhan merged commit ddf6107 into PowerShell:release/v7.5.6 Apr 3, 2026
39 checks passed
@adityapatwardhan adityapatwardhan deleted the backport/release/v7.5.6/26897-f9be17e6b branch April 3, 2026 00:56
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.

4 participants