dotnet / dotnet/docker-tools

Publish pipeline should fail early when source build produced no images

Open
#2,025 1 comment 0 reactions 1 assignee Claimed by @lbussell View on GitHub
area-infrastructure
Dominant language
C#
Stars
181
Forks
67
Avg merge
2d 15h
Merged PRs (30d)
10

Description

## 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.