Skip to content

Skip Store Publish when No Channel Seleceted#27334

Open
jshigetomi wants to merge 1 commit into
PowerShell:masterfrom
jshigetomi:channelSelectionFix
Open

Skip Store Publish when No Channel Seleceted#27334
jshigetomi wants to merge 1 commit into
PowerShell:masterfrom
jshigetomi:channelSelectionFix

Conversation

@jshigetomi
Copy link
Copy Markdown
Collaborator

@jshigetomi jshigetomi commented Apr 22, 2026

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:

  • Updated the channel selection logic in .pipelines/templates/package-store-package.yml and .pipelines/templates/release-MSIX-Publish.yml to skip Store package creation/publish with a warning when no valid channel is detected, rather than causing the pipeline to fail. [1] [2]
  • Set the SkipStorePublish variable and related channel flags to ensure any downstream tasks conditioned on these are properly skipped.
  • Added a condition to the 'Upload StoreBroker Package' step so it only runs if SkipStorePublish is not set to true.

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

@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
@jshigetomi jshigetomi marked this pull request as ready for review April 22, 2026 21:02
@jshigetomi jshigetomi requested a review from a team as a code owner April 22, 2026 21:02
Copilot AI review requested due to automatic review settings April 22, 2026 21:02
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 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 SkipStorePublish variable 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.

Comment on lines +84 to +91
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
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.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 83 to +91
$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
}
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 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.

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

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