Skip to content

feat(fastdeploy): treat blocks.gen.json as content in the content-only gate#28

Merged
hugo-ccabral merged 1 commit into
mainfrom
feat/content-only-blocks-gen
Jul 9, 2026
Merged

feat(fastdeploy): treat blocks.gen.json as content in the content-only gate#28
hugo-ccabral merged 1 commit into
mainfrom
feat/content-only-blocks-gen

Conversation

@hugo-ccabral

@hugo-ccabral hugo-ccabral commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Studio content commits touch two paths, not one: the decofile blocks (.deco/blocks/**) and the regenerated bundled snapshot src/server/cms/blocks.gen.json (kept in lockstep for HMR). The content-only gate only accepted the former — so every real Studio commit was classified as a code change and never fast-deployed.

Content-only now means: every changed file is under .deco/blocks/ or equals src/server/cms/blocks.gen.json.

  • internal/deploy/target.go — extracted isContentPath (prefix or exact-file match); blocksGenFile constant documents why the gen file carries no code change (it's derived from the blocks).
  • internal/deploy/target_test.go — new unit tests for isContentOnly (incl. the real Studio-commit shape and the .deco/blocks-old sibling case) and decofileName (sanitization + 63-char cap).
  • docs/fast-deploy-webhook.md — updated rule description.

Note: the KV sync itself is unchanged — the syncer reads .deco/blocks/*.json; the gen file just rides along in the commit.

🤖 Generated with Claude Code


Summary by cubic

Expand the content-only fast-deploy gate to include the generated snapshot src/server/cms/blocks.gen.json, so Studio content commits fast-deploy instead of triggering a full build. KV sync behavior is unchanged.

  • Bug Fixes
    • Content-only now accepts changes under .deco/blocks/** or exactly src/server/cms/blocks.gen.json (extracted isContentPath, added blocksGenFile).
    • Added tests for isContentOnly and decofileName (covers Studio commit shape and edge cases).
    • Updated docs/fast-deploy-webhook.md to reflect the new rule.

Written for commit 8274e2b. Summary will update on new commits.

Review in cubic

…y gate

Studio content commits touch two paths: .deco/blocks/** and the regenerated
bundled snapshot src/server/cms/blocks.gen.json (kept in lockstep for HMR).
The gate only accepted the former, so every Studio commit was classified as a
code change and skipped fast-deploy. Content-only now means: every changed
file is under .deco/blocks/ OR equals src/server/cms/blocks.gen.json.

Adds unit tests for isContentOnly and decofileName.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hugo-ccabral hugo-ccabral merged commit 727d7c7 into main Jul 9, 2026
5 checks passed
@hugo-ccabral hugo-ccabral deleted the feat/content-only-blocks-gen branch July 9, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants