Skip to content

fix: emit and declare preflight source_image_tag for promote deploys - #144

Merged
joshua-temple merged 1 commit into
mainfrom
fix/promote-source-image-tag
Jun 13, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
fix/promote-source-image-tag

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Promote deploy jobs pass image_tag: ${{ needs.preflight.outputs.source_image_tag }}, and the generator maps the deploy image_tag input to preflight.outputs.source_image_tag. But the preflight job never declared a source_image_tag output and the preflight CLI never emitted it. On real GitHub the reference resolved to an empty string, so deploys silently received a blank image tag. actionlint also flagged the property as undefined on the preflight outputs object.

Fix

The promoted artifact version is the canonical image tag for a promotion. So:

  • The preflight CLI now emits source_image_tag set to the source version, alongside source_version and with identical availability semantics.
  • The generated preflight job declares the matching source_image_tag: ${{ steps.preflight.outputs.source_image_tag }} output.

The existing promote.go references (input mapping, deploy passthrough, prod deploy passthrough) become valid once the output is declared and produced; no reference changes were needed.

Verification

  • New unit test TestPromoteGenerator_PreflightDeclaresSourceImageTag asserts the preflight outputs block declares source_image_tag.
  • Extended TestPreflightCommand_GHAOutput asserts the CLI emits source_image_tag=v1.0.0-rc.1 (mirroring the source version).
  • New e2e scenario 18-promote-source-image-tag.yaml asserts the generated promote.yaml contains both the preflight output declaration and the deploy with: passthrough. The deploy stub now declares the standard environment/sha/image_tag callback inputs so the generator discovers and threads them.
  • go build ./... && go test ./... && golangci-lint run ./... pass on both the main and e2e modules. The new e2e scenario plus the two-env, rollback, and inline-run promote scenarios pass.

Promote deploy jobs reference needs.preflight.outputs.source_image_tag
for their image_tag input, but the preflight job never declared that
output and the preflight CLI never emitted it, so on real GitHub the
reference resolved to an empty string and deploys received a blank image
tag (actionlint also flagged the undefined property).

The promoted artifact version is the canonical image tag, so the
preflight CLI now emits source_image_tag set to the source version, with
the same availability as source_version, and the generated preflight job
declares the matching output.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 1739820 into main Jun 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant