Skip to content

feat: thread immutable image digest to deploy jobs - #152

Merged
joshua-temple merged 1 commit into
mainfrom
feat/deploy-image-digest
Jun 14, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
feat/deploy-image-digest

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Deploy jobs receive only `image_tag` (sourced from `state.Version`), a mutable tag. Operators who want to pin pulls to an immutable content digest had no way to receive one, even though the build's immutable artifact identifier is already captured into state as `artifact_id`.

Fix

Additively thread the immutable digest to deploy jobs alongside the existing tag. This follows cascade's additive-never-breaking API rule: `source_image_tag` / `image_tag` are untouched.

  • `preflight` now emits a new `source_image_digest` output, sourced from the source env build state's `artifact_id`. When the source env has multiple builds, the first build by sorted name with a non-empty `artifact_id` is used. When no build has one, the output is omitted.
  • The preflight job declares `source_image_digest` in its outputs block.
  • Deploy jobs receive `image_digest: ${{ needs.preflight.outputs.source_image_digest }}` in their `with:` block, gated on the deploy workflow declaring an `image_digest` input (mirroring the existing `image_tag` guard). Inline-run deploys receive it as an `IMAGE_DIGEST` env var.
  • `image_digest` was added to the validated set of available promote-workflow inputs so a deploy declaring it as required validates.

To use this, populate the build's `artifact_id` output with the content digest (for example a `sha256:...` image digest). cascade treats `artifact_id` as an opaque immutable identifier; it is only a content digest if the build emits one as such.

Prod-path and matrix-based deploys are not threaded in this change (no `prod_image_digest` output exists; matrix inputs come from per-promotion manifest values rather than preflight outputs). These are documented as out of scope.

Verification

  • `go build ./... && go test ./...`: 1223 passed.
  • e2e module: `go build ./...`, `go vet ./...` clean.
  • `golangci-lint run ./...` clean (both modules).
  • e2e scenario `18-promote-source-image-tag.yaml` extended to assert both `image_tag` and `image_digest` thread through plus the `source_image_digest` preflight output. Local run with Docker:
    ```
    --- PASS: TestMultiStepScenarios (0.00s)
    ok github.com/stablekernel/cascade/e2e 20.199s
    ```

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple merged commit 60ea68e into main Jun 14, 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