fix: emit and declare preflight source_image_tag for promote deploys - #144
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Promote deploy jobs pass
image_tag: ${{ needs.preflight.outputs.source_image_tag }}, and the generator maps the deployimage_taginput topreflight.outputs.source_image_tag. But the preflight job never declared asource_image_tagoutput 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:
source_image_tagset to the source version, alongsidesource_versionand with identical availability semantics.source_image_tag: ${{ steps.preflight.outputs.source_image_tag }}output.The existing
promote.goreferences (input mapping, deploy passthrough, prod deploy passthrough) become valid once the output is declared and produced; no reference changes were needed.Verification
TestPromoteGenerator_PreflightDeclaresSourceImageTagasserts the preflight outputs block declaressource_image_tag.TestPreflightCommand_GHAOutputasserts the CLI emitssource_image_tag=v1.0.0-rc.1(mirroring the source version).18-promote-source-image-tag.yamlasserts the generated promote.yaml contains both the preflight output declaration and the deploywith:passthrough. The deploy stub now declares the standardenvironment/sha/image_tagcallback 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.