Skip Store Publish when No Channel Seleceted#27334
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Store package creation and Store publish pipeline templates to behave gracefully when no release channel (LTS/Stable/Preview) is selected, avoiding hard failures and skipping Store-related work.
Changes:
- Adjusted channel selection handling to warn and early-exit instead of erroring when all channel flags are false.
- Introduced/used a
SkipStorePublishvariable to skip downstream StoreBroker artifact upload when Store package creation is skipped. - Added a condition to the “Upload StoreBroker Package” step to avoid failing when expected outputs aren’t present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.pipelines/templates/release-MSIX-Publish.yml |
Changes channel validation to warn/return when no channel is selected. |
.pipelines/templates/package-store-package.yml |
Skips Store package creation when no channel is selected, sets SkipStorePublish, and conditions the StoreBroker upload step. |
| if (-not $currentChannel) { | ||
| Write-Host "##[warning]No release channel selected (LTS/Stable/Preview all false). Skipping Store package creation." | ||
| Write-Host "##vso[task.setvariable variable=SkipStorePublish]true" | ||
| # Set channel flags so any downstream conditioned tasks evaluate to skip. | ||
| Write-Host "##vso[task.setvariable variable=LTS]false" | ||
| Write-Host "##vso[task.setvariable variable=STABLE]false" | ||
| Write-Host "##vso[task.setvariable variable=PREVIEW]false" | ||
| return |
There was a problem hiding this comment.
In the no-channel path you return before any step creates $(ob_outputDirectory) or copies anything into it. In this pipeline, job artifacts are typically gathered from ob_outputDirectory; if the directory is never created, artifact publishing (and downstream downloads like drop_store_package_CreateStorePackage) can fail or produce no artifact. Ensure the output directory exists and (ideally) publish a small placeholder/marker file when skipping so downstream stages/jobs can reliably handle the skip case.
| $currentChannel = if ($IsLTS) { 'LTS' } | ||
| elseif ($IsStable) { 'Stable' } | ||
| elseif ($IsPreview) { 'Preview' } | ||
| else { | ||
| Write-Error "No valid channel detected" | ||
| exit 1 | ||
| } | ||
| else { $null } | ||
|
|
||
| if (-not $currentChannel) { | ||
| Write-Host "##[warning]No release channel selected (LTS/Stable/Preview all false). Skipping Store publish." | ||
| return | ||
| } |
There was a problem hiding this comment.
The warning/return here only affects the later “Validate Channel Selection” step, but the job still downloads the drop_store_package_CreateStorePackage artifact and runs earlier steps (notably the SBJSON update that reads $(Pipeline.Workspace)\SBOutDir\PowerShellStorePackage.json). If no channel is selected and store package creation is skipped upstream, this job can still fail before reaching this guard. Consider adding a job-level (or per-task) condition based on LTS/STABLE/PREVIEW so the job/tasks that depend on SBOutDir are skipped entirely when all channels are false.
PR Summary
This pull request updates the release pipeline scripts to improve handling when no release channel (LTS, Stable, or Preview) is selected. Instead of failing the pipeline, the scripts now skip the Store package creation and publish steps gracefully, and set variables to ensure downstream tasks are also skipped.
Pipeline robustness and conditional execution:
.pipelines/templates/package-store-package.ymland.pipelines/templates/release-MSIX-Publish.ymlto skip Store package creation/publish with a warning when no valid channel is detected, rather than causing the pipeline to fail. [1] [2]SkipStorePublishvariable and related channel flags to ensure any downstream tasks conditioned on these are properly skipped.SkipStorePublishis not set totrue.PR Context
This is to prevent pipeline failure when a channel like preview, LTS, or stable isn't selected, like for v7.5.X
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header