ci(publish): gate kaniko image builds + publish on changed paths (CI throughput) #619
Reference in New Issue
Block a user
Delete Branch "feat/ci-publish-path-gating"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ci(publish): gate kaniko image builds + publish on changed paths
The bottleneck. Every
mainmerge runspublish.yml, which unconditionally rebuilds the three kaniko images (gateway/appservice/web, ~25 min); each Dockerfile'sCOPY . .busts kaniko's cache on any change. But none of those apps depend on@mosaicstack/mosaic— so the entire constitution + fleet PR stream (allpackages/mosaic/**+docs/**) rebuilds all three images for nothing, saturating the runners.Change (minimal —
publish.ymlwhen:pathonly)build-gateway/build-appservice/build-web— step-levelwhen(shared anchor): build on tag always; on amainpush, build unless the changed files are onlypackages/mosaic/**,docs/**,**/*.md,.woodpecker/**.publish-npm— run only whenpackages/**changed (or on tag); a pure-docs merge runs no publish.install/buildunchanged.Why exclude-list (not per-image include-lists)
My proposal floated per-image include-lists, but those risk under-including an app's transitive package closure → a needed image silently skipped → stale deploy. An exclude-list is correctness-safe: the default is to build; only the known npm-only/docs change classes skip. Same waste elimination, no staleness risk.
Woodpecker semantics (docs-confirmed)
Per the Woodpecker workflow-syntax docs:
whenlist entries are OR'd ("if at least one of the conditions … evaluates true the step is executed"); sub-conditions within an entry are AND'd.pathconditions apply topush/pull_requestonly — not tag events — which is exactly why each gated step has a separateevent: tagentry so releases always build.whengoverns the step independently of the file-levelwhen(the file-levelwhengates whether the workflow runs; ungated steps still inherit it).Validation & safety
apps/gateway/**change should still build gateway.:latest/:sha-*images remain; nothing is deleted, deploys still pull the last good image.Deferred (follow-up PRs, per Lead)
Dockerfile
COPY . .tightening (better cache reuse for builds that do run); scopingpublish-npm's build dependency to--filter "@mosaicstack/*". Not adopting tag-gate-everything (publish-on-merge → publish-on-tag is a deploy-workflow change = Jason's call).🤖 Generated with Claude Code