feat(fast-deploy): target the live deployment id for content-push sync#29
Merged
Conversation
nicacioliveira
previously approved these changes
Jul 9, 2026
Content is now keyed per deployment in KV (decofile:<id>). A content-only fast-deploy must write to whichever version is currently live, so before creating the sync Job the tanstack-kv reconciler resolves the site's index:live pointer (Cloudflare KV REST GET) and passes it to the Job as DEPLOYMENT_ID. When index:live is unset (no code deploy has run yet) it reports a Waiting condition and requeues rather than syncing blind. The live-id resolver is injectable so tests avoid real HTTP. No CR schema change — the live id is resolved at reconcile time. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Document that content is keyed per deployment and the reconciler resolves index:live (Waiting + requeue when unset) and passes DEPLOYMENT_ID to the sync Job; note the CF creds are also used for the live-id REST lookup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5133f7b to
045ee22
Compare
The framework repo went monorepo: the runtime is @decocms/tanstack / @decocms/blocks and the CLI bin (deco-sync/migrate-blocks-to-kv) is @decocms/blocks-cli — the old @decocms/start package is gone. Update the onboarding runbook + the cfkv.go source pointer, and fold in the per-deployment model: per-deployment keys (decofile:<id> / index:revision:<id> / index:live), the build/deploy command flow (seed at build with --deployment-id, set-live post-deploy), and the "index:live must be set before content pushes work" Waiting state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What
Content is now keyed per deployment in KV (
decofile:<id>). A content-only fast-deploy must write to whichever version is currently live, so thetanstack-kvreconciler resolves the site'sindex:livepointer (Cloudflare KV REST GET) before creating the sync Job and passes it asDEPLOYMENT_ID.Behavior
cfkv.go:fetchKVLiveIDreadsindex:livefor the site's namespace.DEPLOYMENT_ID=<liveId>to the Job (syncer runsdeco-sync-blocks-to-kv --deployment-id "$DEPLOYMENT_ID").index:liveunset (no code deploy yet) →Synced=Unknown/ reasonWaiting+ requeue; no Job created.Spec.DeploymentIdis the unrelated ConfigMap/Knative pod-label field).Depends on
decofile-syncerimage passing--deployment-id(infra PR).@decocms/startper-deployment keying (blocks PR). Inert until a site has deployed once and setindex:live.Test
go build/go test ./internal/deploy/.../go vetpass. 3 new tests: buildJob env carriesDEPLOYMENT_ID; Waiting-when-pointer-absent; Job targets the live id.🤖 Generated with Claude Code
Summary by cubic
Fast-deploy now writes content to the currently live deployment by resolving
index:livein Cloudflare KV and passing that id to the sync Job. This aligns content pushes with the live site and avoids updating the wrong version.New Features
index:livevia Cloudflare REST using the operator’s CF creds and passes it to the Job asDEPLOYMENT_ID(syncer runs with--deployment-id).index:liveis unset, markSynced=Unknownwith reasonWaiting, requeue, and skip Job creation.internal/deploy/cfkv.goand an injectable live-id resolver; tests cover waiting behavior, Job env, and targeting the live id.@decocms/tanstack,@decocms/blocks,@decocms/blocks-cli), including build/deploy commands to seed and flipindex:live, and how to verifyDEPLOYMENT_ID.Dependencies
decofile-syncermust support--deployment-id.@decocms/tanstackwith per-deployment keying; CLI is@decocms/blocks-cli. A site must have setindex:livevia a prior code deploy.Written for commit f65e80d. Summary will update on new commits.