From a251a80f25a2cb3771dd576fdf2281d73ec173f9 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 26 Aug 2026 17:10:46 -0500 Subject: [PATCH] ci: publish web+appservice sha images on next (#1407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build-web and build-appservice sat on a main-only when-anchor while build-gateway used the next-capable one, so next-lane pushes produced gateway sha images with no web/appservice counterpart — no sha-parity image set existed for next-lane containerized deploys (measured: web and appservice each had exactly one sha tag, the month-old last main build). Fix: single shared image_build_when anchor for all three image steps; web/appservice adopt the gateway-style branch guard (next = sha-only destinations, tag refused; main adds :latest; anything else requires a tag). The divergent second anchor is removed — two near-identical anchors silently drifting apart is the defect class itself. scripts/verify-release.test.mjs: 11/11 pass (SDLC-D-034 gate unchanged; depends_on untouched, publish-next-npm serialization edge intact). --- .woodpecker/publish.yml | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.woodpecker/publish.yml b/.woodpecker/publish.yml index f75e64b5..f4e99282 100644 --- a/.woodpecker/publish.yml +++ b/.woodpecker/publish.yml @@ -32,6 +32,11 @@ variables: # non-excluded change still builds, so no transitive dep can silently go stale. # (Woodpecker: `when` entries are OR'd; `path` applies to push/PR only — hence # the separate `event: tag` entry.) + # #1407: ONE shared anchor for all three image steps. A second main-only + # anchor previously gated build-web/build-appservice, so next-lane pushes + # published gateway sha images with no web/appservice counterpart — no + # sha-parity set existed for next-lane containerized deploys. Every image + # step now builds on next too (sha-only destinations, enforced per step). - &image_build_when - event: tag - event: [push, manual] @@ -44,16 +49,6 @@ variables: - '.woodpecker/**' - event: [push, manual] branch: next - - &main_image_build_when - - event: tag - - event: [push, manual] - branch: main - path: - exclude: - - 'packages/mosaic/**' - - 'docs/**' - - '**/*.md' - - '.woodpecker/**' when: - branch: [main, next] @@ -474,7 +469,7 @@ steps: build-appservice: image: gcr.io/kaniko-project/executor:debug - when: *main_image_build_when + when: *image_build_when environment: REGISTRY_USER: from_secret: REGISTRY_USERNAME @@ -488,8 +483,17 @@ steps: - echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json - | DESTINATIONS="--destination git.mosaicstack.dev/mosaicstack/stack/appservice:sha-${CI_COMMIT_SHA:0:7}" - if [ "$CI_COMMIT_BRANCH" = "main" ]; then + if [ "$CI_COMMIT_BRANCH" = "next" ]; then + if [ -n "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: next appservice publish must be sha-only; refusing tag '$CI_COMMIT_TAG'" >&2 + exit 1 + fi + echo "[publish] next appservice publish is sha-only" + elif [ "$CI_COMMIT_BRANCH" = "main" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/appservice:latest" + elif [ -z "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: appservice image publish may only run for main, next, or tag events" >&2 + exit 1 fi if [ -n "$CI_COMMIT_TAG" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/appservice:$CI_COMMIT_TAG" @@ -509,7 +513,7 @@ steps: build-web: image: gcr.io/kaniko-project/executor:debug - when: *main_image_build_when + when: *image_build_when environment: REGISTRY_USER: from_secret: REGISTRY_USERNAME @@ -523,8 +527,17 @@ steps: - echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json - | DESTINATIONS="--destination git.mosaicstack.dev/mosaicstack/stack/web:sha-${CI_COMMIT_SHA:0:7}" - if [ "$CI_COMMIT_BRANCH" = "main" ]; then + if [ "$CI_COMMIT_BRANCH" = "next" ]; then + if [ -n "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: next web publish must be sha-only; refusing tag '$CI_COMMIT_TAG'" >&2 + exit 1 + fi + echo "[publish] next web publish is sha-only" + elif [ "$CI_COMMIT_BRANCH" = "main" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/web:latest" + elif [ -z "$CI_COMMIT_TAG" ]; then + echo "[publish] FATAL: web image publish may only run for main, next, or tag events" >&2 + exit 1 fi if [ -n "$CI_COMMIT_TAG" ]; then DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaicstack/stack/web:$CI_COMMIT_TAG" -- 2.54.0