From ec38ad604d26577c04986b3b1ade3f14620b45dc Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Wed, 23 Sep 2026 04:01:16 +1000 Subject: [PATCH] test(release): the runtime image is published for a tagged release, not only an archie/v* tag TestDeployWorkflowOnlyPublishesRuntimeImageForRuntimeTag pinned the per-component contract: the agent image builds only when an archie/v* tag is at HEAD. One-stream releases create only a v* tag -- release.sh has no archie/v* arm any more -- so that selector can never fire again, and the agent image would never be rebuilt. `docker compose pull agent` would fetch an ancient image forever. The test's own subject is still right and is kept: the gateway build stays unconditional and the runtime build stays guarded. The guard now names both selectors, and the comment says why the legacy arm remains (history is not re-tagged). Caught by CI, not by me: I changed the workflow and pushed without re-running the gate on that tree. --- deploy_workflow_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/deploy_workflow_test.go b/deploy_workflow_test.go index bf6638abe..c215212a8 100644 --- a/deploy_workflow_test.go +++ b/deploy_workflow_test.go @@ -8,15 +8,16 @@ import ( "testing" ) -func TestDeployWorkflowOnlyPublishesRuntimeImageForRuntimeTag(t *testing.T) { +func TestDeployWorkflowOnlyPublishesRuntimeImageForTaggedRelease(t *testing.T) { source := readDeploymentFile(t, ".github/workflows/deploy.yml") // The fallback remains necessary because Dockerfile.archied accepts a // runtime version, but it must not be used as the image-publish selector. for _, required := range []string{ `RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"`, + `RELEASE_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -1)"`, `echo "runtime_tag=$RUNTIME_TAG" >> "$GITHUB_OUTPUT"`, - "if: steps.versions.outputs.runtime_tag != ''", + `echo "release_tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"`, } { if !strings.Contains(source, required) { t.Errorf("deploy workflow is missing runtime-image guard %q", required) @@ -24,13 +25,18 @@ func TestDeployWorkflowOnlyPublishesRuntimeImageForRuntimeTag(t *testing.T) { } // The gateway build remains unconditional, while the runtime build is - // guarded. This verifies both sides of the gateway-only/dual-tag contract. + // guarded. Both selectors are required. A one-stream release creates only a + // `v*` tag -- release.sh has no archie/v* arm any more -- so a + // runtime_tag-only condition would mean the agent image is never rebuilt + // again, and `docker compose pull agent` would fetch an ancient image + // forever. The legacy archie/v* arm stays because history is not re-tagged. agentMarker := " - name: Build and push archie-agent\n" agentStart := strings.Index(source, agentMarker) if agentStart < 0 { t.Fatal("deploy workflow has no archie-agent build step") } - if !strings.Contains(source[agentStart:], agentMarker+" if: steps.versions.outputs.runtime_tag != ''\n") { + agentIf := " if: steps.versions.outputs.runtime_tag != '' || steps.versions.outputs.release_tag != ''\n" + if !strings.Contains(source[agentStart:], agentMarker+agentIf) { t.Fatal("archie-agent build step is not conditionally enabled") }