Skip to content

Publish pipeline should fail early when source build produced no images #2025

@lbussell

Description

@lbussell

Problem

When manually running only the Publish stage with a sourceBuildPipelineRunId that refers to a build where no images were built (i.e. the Build stage did not run), the pipeline silently continues past the image info download step due to continueOnError being set. All downstream steps no-op until the final "close issue" step, which then fails — making it hard to understand what went wrong.

See: https://github.com/dotnet/dotnet-docker-internal/issues/10211

Expected behavior

The pipeline should distinguish between two cases:

  1. Publish-only run pointing to a build with no images — This is a user error and should fail early at the image info download step with a clear error message (e.g. "No image info artifacts found in the referenced build").

  2. Normal build where the Build stage ran but produced no images (e.g. all images were cached) — This is expected and the pipeline should continue gracefully:

    • continueOnError in the download step is appropriate here
    • IngestKustoImageInfo should no-op when there is no image info file or the file is empty

Suggested approach

  • Add validation after the download step to check whether the referenced build actually produced image info artifacts
  • If sourceBuildPipelineRunId was explicitly provided and no artifacts exist, fail the build immediately
  • Ensure IngestKustoImageInfo handles empty/missing image info gracefully

Metadata

Metadata

Assignees

Type

Projects

Status

Current Release

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions