Skip to content

Fail fast when no packages selected for manual release build#48465

Open
raych1 wants to merge 2 commits intomainfrom
fail-fast-no-package-selected
Open

Fail fast when no packages selected for manual release build#48465
raych1 wants to merge 2 commits intomainfrom
fail-fast-no-package-selected

Conversation

@raych1
Copy link
Member

@raych1 raych1 commented Mar 18, 2026

Problem

When manually triggering a release pipeline, users often forget to check any release_* parameters. This is especially common since 112 of 156 service CI files have all release parameters defaulting to f alse. The pipeline runs through expensive build, signing, and publishing steps before eventually failing at Create-APIReview.ps1 with:

No package information provided. Please provide either 'PackageName', 'ArtifactList', or 'PackageInfoFiles' parameters.

This issue happened quite often by service teams.

Solution

Added a compile-time validation step as the first step of the Build job in eng/pipelines/templates/jobs/ci.yml. It checks three conditions at template expansion time:

  1. System.TeamProject == 'internal' — only internal builds do releases
  2. Build.Reason == 'Manual' — only manually triggered builds filter by releaseInBatch
  3. length(parameters.ReleaseArtifacts) == 0 — no packages were selected

When all three are true, the step is injected and immediately fails with a clear error message — before any checkout, Maven build, signing, or publishing steps run.

Impact

Scenario Affected?
PR builds ❌ No
CI push builds ❌ No
Scheduled builds ❌ No
Patch release pipeline ❌ No
Manual build with packages selected ❌ No
Manual build with no packages ✅ Fails fast with clear error

raych1 and others added 2 commits March 18, 2026 15:59
When manually triggering a release pipeline, if no release_* parameters
are checked, the pipeline would run through expensive build and signing
steps before eventually failing at Create-APIReview.ps1. This is common
since 112 of 156 service CI files have all release parameters defaulting
to false.

Add a compile-time validation step as the first step of the Build job
that immediately fails with a clear error message when all three
conditions are met: internal project, manual trigger, and no release
artifacts selected. The step is not injected for PR, CI push, or
scheduled builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@raych1 raych1 marked this pull request as ready for review March 18, 2026 23:15
@raych1 raych1 requested review from benbp and weshaggard as code owners March 18, 2026 23:16
Copilot AI review requested due to automatic review settings March 18, 2026 23:16
@raych1 raych1 self-assigned this Mar 18, 2026
@raych1 raych1 moved this from 🤔 Triage to 🔬 Dev in PR in Azure SDK EngSys 🖥️🖱️⌨️👨‍💻🤯 Mar 18, 2026
Copy link
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

Adds an early validation guard to Azure DevOps CI job templating to prevent manual internal release runs from proceeding when no release packages were selected, avoiding wasted build/sign/publish work and surfacing a clearer error sooner.

Changes:

  • Injects a conditional first step in the Build job that fails when the run is internal + Manual + ReleaseArtifacts is empty.
  • Emits a clearer, actionable error message for the “no packages selected” scenario.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants