Skip to content

[release/v7.6.1] Correct Variable Template Reference in NonOfficial Pipeline Templates#27317

Merged
jshigetomi merged 1 commit intoPowerShell:release/v7.6.1from
adityapatwardhan:backport/release/v7.6.1/27275-d50bc2cb7
Apr 21, 2026
Merged

[release/v7.6.1] Correct Variable Template Reference in NonOfficial Pipeline Templates#27317
jshigetomi merged 1 commit intoPowerShell:release/v7.6.1from
adityapatwardhan:backport/release/v7.6.1/27275-d50bc2cb7

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

Backport of #27275 to release/v7.6.1

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)

Corrects broken template references in NonOfficial pipeline YAML files. These fixes are required for NonOfficial pipelines to execute properly in the 7.6.1 release branch.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

The fix corrects relative paths in NonOfficial pipeline YAML configuration files. Testing involves verifying that NonOfficial pipelines can be executed without template reference errors. Changes are straightforward path corrections with no logic modifications.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Changes affect CI/CD infrastructure (NonOfficial pipelines). However, these are straightforward relative path corrections with no behavioral changes to PowerShell itself. Risk is mitigated by the small scope of changes and clear fix rationale.

Copilot AI review requested due to automatic review settings April 21, 2026 20:32
@adityapatwardhan adityapatwardhan requested review from a team and jshigetomi as code owners April 21, 2026 20:32
@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 21, 2026
@jshigetomi jshigetomi merged commit 8140b68 into PowerShell:release/v7.6.1 Apr 21, 2026
37 checks passed
@adityapatwardhan adityapatwardhan deleted the backport/release/v7.6.1/27275-d50bc2cb7 branch April 21, 2026 20:36
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 fixes to release/v7.6.1 to correct broken Azure DevOps YAML template references (primarily for NonOfficial pipelines) by standardizing on repo-root-anchored template paths.

Changes:

  • Updated NonOfficial pipeline YAMLs to reference shared templates via absolute /.pipelines/...@self paths.
  • Fixed an in-template include in PowerShell-vPack-Stages.yml to avoid incorrect relative resolution.
  • Updated the Split ADO Pipelines agent documentation to describe the intended template reference convention (and added a Windows host version pin in one NonOfficial pipeline).

Reviewed changes

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

Show a summary per file
File Description
.pipelines/templates/stages/PowerShell-vPack-Stages.yml Anchors SetVersionVariables.yml include to repo root to prevent path composition errors.
.pipelines/NonOfficial/PowerShell-vPack-NonOfficial.yml Switches variables/stages template references to /.pipelines/...@self.
.pipelines/NonOfficial/PowerShell-Release-NonOfficial.yml Switches variables/stages template references to /.pipelines/...@self.
.pipelines/NonOfficial/PowerShell-Release-Azure-NonOfficial.yml Switches variables template reference to /.pipelines/...@self.
.pipelines/NonOfficial/PowerShell-Packages-NonOfficial.yml Switches variables/stages template references to /.pipelines/...@self.
.pipelines/NonOfficial/PowerShell-Coordinated_Packages-NonOfficial.yml Switches variables/stages template references to /.pipelines/...@self and adds WindowsHostVersion.Version: 2022.
.github/agents/SplitADOPipelines.agent.md Updates guidance/examples to use .pipelines and absolute template references.

Comment on lines +28 to +42
## Template Reference Convention (MUST follow)

All `- template:` references to files **inside this repo** must use the **absolute** form anchored at the repo root, with the `@self` suffix:

```yaml
- template: /.pipelines/templates/<path>/<file>.yml@self
```

Do **not** use relative paths such as `templates/...`, `../templates/...`, or bare filenames. Rationale:

- Absolute paths resolve identically regardless of where the referring file lives, so moving a pipeline file between directories (for example, into `.pipelines/NonOfficial/`) does not silently break includes.
- Relative paths are resolved by Azure DevOps against the directory of the referring file, which has caused real outages in this repo when a relative include was composed into a nonexistent nested path like `.pipelines/templates/stages/.pipelines/templates/...`.
- The majority of existing includes already use the absolute form; keeping new work consistent reduces review burden.

The only acceptable non-absolute references are to external repositories resolved via the `resources.repositories` block, for example `v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates`.
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The new guidance says all in-repo - template: references must use the absolute /.pipelines/...@self form and that relative/bare filenames are not acceptable. This isn’t currently true in this repo (e.g., .pipelines/templates/linux-package-build.yml and .pipelines/templates/mac-package-build.yml use - template: SetVersionVariables.yml@self and other relative includes). Please either (a) narrow the guidance to entrypoint pipeline YAMLs and templates expected to be referenced from multiple directories, or (b) update the existing templates to match the stated convention so the doc doesn’t mislead future changes.

Copilot uses AI. Check for mistakes.
Comment on lines 63 to 65
WindowsHostVersion:
Version: 2022
Network: KS3
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

This adds WindowsHostVersion.Version: 2022, which changes the build host selection (behavioral pipeline change) beyond the PR description’s claim of “straightforward path corrections with no logic modifications”. If this host version pin is required, please call it out in the PR description/testing notes (or drop it from this backport if it wasn’t intended).

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.

3 participants