Skip to content

v8 N-05: telemetry (OTLP), analytics, instrumented fetch, hosted and KV loaders - #606

Closed
tlgimenes wants to merge 8 commits into
v8-04-clifrom
v8-05-telemetry-analytics-loaders
Closed

tlgimenes wants to merge 8 commits into
v8-04-clifrom
v8-05-telemetry-analytics-loaders

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

N-05: telemetry over OTLP/HTTP, @decocms/blocks/analytics, hosted remoteLoader, kvLoader

Branch is in worktree (local worktree), based on v8-02-core. It has 8 commits and is not pushed.

Summary

  • Telemetry: createCMS({ telemetry }) sends OpenTelemetry over OTLP/HTTP as gzipped JSON, with no OTel SDK and no new dependencies.
    • It accepts { site, token } (the hosted collector), { endpoint, headers? }, or false. When the option is left out it falls back to OTEL_EXPORTER_OTLP_ENDPOINT / OTEL_EXPORTER_OTLP_HEADERS.
    • Metrics are delta histograms. Error logs and traces are sampled at the rates in the Telemetry saved block, capped by telemetry.limits in code.
    • Everything is scrubbed before encoding (query strings, credentials, cookie and token values).
    • A failed send is retried once on 429/502/503/504; any other failure drops the batch.
  • @decocms/blocks/fetch: createInstrumentedFetch measures http.client.request.duration with provider, operation, status_class, cached and retries labels. Retries and the circuit breaker are off unless set.
  • @decocms/blocks/analytics: AnalyticsScript(props) renders a script tag that speaks the One Dollar Stats format, and renders nothing when enabled is false. track(name, props?) sends your own events through it.
  • Loaders:
    • remoteLoader(fallback, { site, token, interval? }) is a process-wide singleton. Requests only read memory.
    • The CMS checks for releases in the background on its existing update() scheduler, from N-02: on first use, then every interval (at least 60 s, ±10 s jitter), at an idle moment.
    • The background hook added by this PR puts that idle moment inside ctx.waitUntil on Workers.
    • A new release is checked against its content hash before it replaces the old one whole. A manifest with an older generation is ignored. Drafts are fetched with If-Match, and only from the delivery host.
  • kvLoader(namespace, { key }) comes from @decocms/tanstack.

Review fixes in this round

  • B1, a failed download blocked that release for good: removed ETag / If-None-Match / 304 handling entirely. A failed download is now retried on the next check.
  • B2, a missing kvLoader key could not be fixed by a release check: the fallback revision lookup inside update() is now best-effort, so the release still downloads.
  • G8, crash without site or token: remoteLoader now returns fallback unchanged when either is unset. Its return type is now Snapshot | Loader.
  • G1, Workers scheduling was not wired:
    • New file packages/tanstack/src/sdk/backgroundTasks.ts installs the Symbol.for("decocms.blocks.background") hook once per isolate. The queue lives on the hook itself, so two copies of the module share it.
    • createDecoWorkerEntry hands that queue to ctx.waitUntil after each response, and only calls it when something is queued.
  • G2, a telemetry batch after every request: with the hook installed, a batch now goes out once it is at least 10 s old. A younger batch stays pending until a later request's measurement schedules it.
  • S1, draft pointer text could reach a collector: LOADER_FAILED logs now send the fixed message "content loader failed" plus error.code, never error.message.
  • G7, possible double page views: the tracker sends the GET with new Image().src only; the onerror resend by beacon or POST is gone.
  • Leanness:
    • Removed the OTEL_SERVICE_NAME and NODE_ENV resource sources. service.name is the site ID, or "decocms-site", and OTEL_RESOURCE_ATTRIBUTES is the only override.
    • Removed the cf-cache-status / x-cache sniffing; cached is false for now.
    • KVNamespaceLike is no longer exported.
    • The LOADER_INTERVAL symbol is replaced by a plain read-only interval field, which createCMS reads in one place.

Docs mapping

Doc Implemented as
telemetry, hosted-telemetry, api-reference createCMS v8/telemetry.ts (resolveDestination, TelemetryPipeline), wired in v8/cms.ts
telemetry-internals: wire format, delta metrics, resource attributes, background sending, scrubbing v8/telemetry.ts, v8/background.ts
upstream-clients, api-reference createInstrumentedFetch v8/fetch.ts (@decocms/blocks/fetch)
analytics, telemetry-internals "Analytics events", api-reference Analytics v8/analytics.ts (@decocms/blocks/analytics)
hosted-publishing, hosted-releases-internals, content-delivery, api-reference Loaders v8/remoteLoader.ts, v8/cms.ts scheduling (from N-02), tanstack/src/sdk/backgroundTasks.ts
hosted-publishing "Large content on Workers", api-reference Loaders tanstack/src/kvLoader.ts
releases-and-deployment, content Revision semantics come from N-02. remoteLoader checks each release against computeContentRevision.

Deviations from the docs (smallest design chosen)

  • service.version and deployment.environment.name are only set through OTEL_RESOURCE_ATTRIBUTES. Nothing reads a commit or environment variable by default. telemetry-internals should say so.
  • Several CMS instances in one process report to the last one created, because requestScope is not allowed. The "Several CMS instances" section of telemetry-internals needs to match this.
  • A failed draft returns LOADER_FAILED and does not fall back to published content. api-reference says this; hosted-releases-internals says otherwise, and I followed api-reference.
  • The cached label is always false until the binding's upstream cache can report hits.
  • Workers timing: work queued after fetch returns (for example while SSR is still streaming) runs after the next request's response. This matches the docs' "An idle Worker checks after a subsequent response".
  • The hosted origins are placeholders: delivery.decocms.com and otel.decocms.com.
  • The OTEL_EXPORTER_OTLP_* fallback reads process.env. On Workers without nodejs_compat env population it is silently off; pass telemetry explicitly there.

Left to sites, deliberately

These are written per template:

  • image, router, device and SEO helpers
  • edge and upstream caching helpers
  • requestScope
  • Deferred<T> / <BlockList>

Test evidence

  • Tests: npx vitest run packages/blocks/src/v8 packages/tanstack/src/kvLoader.test.ts packages/tanstack/src/sdk/backgroundTasks.test.ts → 16 files, 318 of 318 pass.
    • packages/tanstack/src/sdk/workerEntry.test.ts still has the same 2 failures it has on the base branch, and nothing new.
  • New regression tests:
    • B1: a failed download is retried on the next check.
    • B2: a failing fallback is fixed by a release check.
    • G8: remoteLoader returns the fallback unchanged when site or token is unset.
    • G1: a due check runs inside ctx.waitUntil and not before the response, and waitUntil is not called when nothing is queued.
    • G2: one batch per 10 s window under the hook.
    • S1: a LOADER_FAILED log carries no pointer text.
    • G7: an onerror on the GET does not resend the page view.
    • OTEL_RESOURCE_ATTRIBUTES sets service.version and the environment.
  • Reviewer's probe (scratchpad/probe.mts), re-run against the branch:
    • It now prints update2: { updated: true } served: B (it was { updated: false } served: A).
    • It now prints kv update: { updated: true } (it was kv update threw: no key).
  • Typecheck: tsc --noEmit passes for blocks, tanstack and nextjs.
  • Lint: biome check on the changed files shows only the warning and infos already in workerEntry.ts.

Follow-ups

  • G3, the binding PR: add one minimal binding-only export so bindings can report http.server.request.duration and the edge cache metrics, for example record(name, labels, seconds).
  • Cache hits: the binding's upstream cache should report hits so cached can be true.
  • Docs edits for the deviations listed above.
  • Analytics: before release, check the tracker against the pinned stonks.js and the real d.lilstts.com response.
  • Block span durations: resolver.ts uses Date.now(). On Workers this only advances across I/O, which is the case that matters. Switching durations to performance.now() would add little there, because Workers freezes it in the same way.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig


Part of the v8 stack (spec: docs PR deco-sites/docs-tanstack#4). Draft until the docs-conformance review (keep the framework lean: anything undocumented gets cut).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig


Summary by cubic

Adds telemetry, analytics, instrumented fetch, hosted and KV loaders, and the deco CLI to the v8 core in packages/blocks and packages/tanstack.

  • createCMS({ telemetry }) sends OpenTelemetry over OTLP/HTTP as gzipped JSON with no OTel SDK and no new dependencies; destinations come from the option, the hosted collector ({ site, token }), or OTEL_EXPORTER_OTLP_* env vars. Everything is scrubbed before encoding, and failed sends retry once on 429/502/503/504.
  • createInstrumentedFetch measures each upstream request as http.client.request.duration with provider, operation, status class, cached, and retries labels; retries and the circuit breaker stay off unless set.
  • AnalyticsScript renders an inline script speaking the One Dollar Stats wire format (cookie-free page views), and track(name, props?) sends custom events through it.
  • remoteLoader(fallback, { site, token, interval? }) serves hosted releases and drafts: load() only reads memory, and the CMS checks for new releases in the background on an idle moment with ±10 s jitter. Releases are verified against their content hash before swapping; older generations are ignored.
  • kvLoader(namespace, { key }) reads the content snapshot from Workers KV once per isolate for large sites, and createDecoWorkerEntry runs background work after each response inside ctx.waitUntil.
  • The new deco command ships in @decocms/blocks/cli, with the secret built-in and @decocms/blocks/secrets; a legacy v7 alias bridge lets v7 content resolve without a block-map entry.

New Features

  • deco schema reads the block map with the app's own typescript peer and writes deco-meta@1; deco content writes .deco/blocks.gen.ts; deco check validates saved blocks against the schema without loading TypeScript; deco serve runs the content-protocol server (JSON-RPC, uploads, CORS and Host checks) over the protocol's fs storage. The bin runs TypeScript sources directly under Bun and via tsx under Node.
  • Block resolution and upstream calls produce spans and error logs sampled per the Telemetry saved block, capped by telemetry.limits in code. Metrics are delta histograms batched once per 10 s window under a host hook.
  • Drafts are fetched exactly with If-Match and only from the delivery host; the production channel manifest is fetched on first use and then every interval (minimum 60 s).

Bug Fixes

  • Failed release downloads are retried on the next check instead of being blocked forever (ETag/304 handling dropped).
  • A missing kvLoader key is fixed by the next release check: the fallback revision lookup is now best-effort.
  • remoteLoader returns the fallback unchanged when site or token is unset instead of crashing.
  • LOADER_FAILED logs carry a fixed message and error.code, never the draft pointer text.
  • Page view tracking sends each GET once with new Image().src; the onerror resend via beacon or POST is removed.
  • Telemetry batches leave once at least 10 s old under a host hook instead of after every request.

Written for commit 932a455. Summary will update on new commits.

Review in cubic

Stack: v8 ← 01 ← 02 ← 03 ← 04 ← 05 ← 08 ← 09

tlgimenes and others added 8 commits October 3, 2026 11:54
createCMS with site and token now wraps its content in remoteLoader, the
hosted releases and drafts loader (hosted-releases-internals.mdx):

- load() reads memory only: the newest fetched release, or the fallback
  (the content module or any loader) until one is fetched.
- update() fetches the production channel manifest (ETag-aware), ignores
  older generations, serves a release with the fallback's revision from
  the fallback without downloading, and otherwise fetches the immutable
  revision asset, verifies it against computeContentRevision and swaps
  it in whole. Any error leaves memory as it was.
- load(pointer) fetches a draft only from the delivery host, with the
  site token and If-Match on the pointer's version.
- In development (NODE_ENV=development) releases stay on local files.
- Instances are process-wide singletons keyed like createCMS's.

The CMS scheduler now checks an updatable source on first use and then
every interval +-10 s, at an idle moment (a binding's background hook,
requestIdleCallback, scheduler.postTask, or an unref'd timer), and warns
when it raises an interval below the 60 s minimum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
createCMS({ telemetry }) sends OpenTelemetry over OTLP/HTTP JSON, gzipped,
with no OTel SDK (telemetry.mdx, telemetry-internals.mdx):

- Destination: { endpoint, headers? }, { site, token } (hosted
  collector), false, or OTEL_EXPORTER_OTLP_ENDPOINT/_HEADERS when left
  out. Top-level site and token never turn it on; unset values turn it
  off instead of throwing.
- Settings come from the served release's Telemetry block (enabled,
  metrics, errorSampleRate 0.05, traceSampleRate 0), with the sample
  rates capped by telemetry.limits (0.1 and 0 by default).
- Metrics: delta histograms aggregated in memory. Error logs: sampled,
  from failed blocks (code and block type) and other resolution errors
  once per client, never NOT_FOUND. Traces: block-resolution and upstream
  spans at traceSampleRate.
- Batches go out in the background (a binding's hook after the response
  on Workers, an unref'd 10 s timer elsewhere), retried once on
  429/502/503/504, otherwise dropped. Text is scrubbed of query strings,
  credentials, cookies and token values before encoding.

createInstrumentedFetch({ provider, fetch?, retry?, circuitBreaker? })
measures each upstream request once as http.client.request.duration with
provider, operation, status_class, cached and retries labels, reporting
to the process's CMS telemetry; retries are off unless set and only
repeat idempotent methods.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
AnalyticsScript(props) renders one inline script with the resolved
analytics block's settings, or nothing when enabled is false. The script
sends cookie-free page views in the One Dollar Stats tracker's wire
format (pinned against stonks.js): { u, e: [{ t, h, r, p }], debug },
with the URL's query string dropped, as base64 JSON in GET ?data= when
it fits 1500 characters and through sendBeacon or POST otherwise. It
counts the first view once the page is visible and every pushState or
popstate that changes the path. track(name, props?) sends custom events
through it and does nothing without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
kvLoader(namespace, { key }) is a Loader that reads the content snapshot
the deploy wrote to a Workers KV key, once per isolate, so large sites
bundle no copy of their content (api-reference#loaders). It ignores
draft pointers; a missing key fails with LOADER_FAILED and is retried on
the next load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…lback in remoteLoader

Drop ETag/If-None-Match handling: storing the ETag before the download let a
failed download 304 forever. Make the fallback revision lookup best-effort so
a missing kvLoader key is fixed by the first release check. Return the
fallback unchanged when site or token is unset. Expose the loader's interval
as a plain field read in one place by createCMS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…o loader messages

With a background hook, a batch leaves once it is 10 s old instead of after
every request. LOADER_FAILED logs carry a fixed message, never the draft
pointer. Drop undocumented OTEL_SERVICE_NAME/NODE_ENV resource sources and
cache-header sniffing; OTEL_RESOURCE_ATTRIBUTES is the single override.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…itUntil

Install the decocms.blocks.background hook once per isolate and drain its
queue after each response, so release checks and telemetry batches never
rely on timers Workers don't run. Keep KVNamespaceLike internal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
@tlgimenes
tlgimenes force-pushed the v8-05-telemetry-analytics-loaders branch from 9f1a23d to 932a455 Compare October 3, 2026 14:55
@tlgimenes
tlgimenes changed the base branch from v8-02-core to v8-04-cli October 3, 2026 15:01
tlgimenes added a commit that referenced this pull request Oct 12, 2026
The whole v8 stack as **one squash commit** onto main. Merging it
publishes **8.1.0 on npm `latest`** for the 8 v8 packages, so `npm
install @decocms/blocks` gives v8. v7 keeps releasing from the `7.x`
branch.

**Draft until release day.** Don't mark it ready or merge it outside the
runbook below; the product owner names this PR when approving the merge.
Nothing has been merged, tagged or published yet.

## What's in it

The tree of this branch is exactly the top of the v8 stack, #669
(`v8-19-port-main-fixes` at `bbb4e36e`): `git diff bbb4e36
v8-release-squash` is empty. The branch is two commits on main's head
`0d125f10` (`blocks-v7.78.0`): the squash of the stack (`e151895d`), and
`ab3d3864`, which brings its tree up to #669's latest head without
rewriting history. Squash and merge folds both into one commit.

- **@decocms/blocks is one package:** the content protocol, the core SDK
(`createCMS`, resolver, lazy, built-ins, `matchRoute`, drafts), the
`deco` CLI (schema, content, check, serve), OTLP telemetry, analytics,
instrumented fetch and hosted mode (CDN releases, CDN drafts, site token
telemetry). Published as per-file tsc output, with no bundler.
- **The commerce apps are thin clients:** apps-shopify, apps-vtex (with
retry and a circuit breaker), apps-wake, apps-magento, apps-algolia,
apps-resend and apps-sfmc-personalization.
- **What v7's framework packages did is now site code.** TanStack Start
and Next.js sites follow the guides, and the `deco-v7-to-v8-migration`
skill moves a v7 site over.
- **The v7-only packages leave main:** tanstack, nextjs, blocks-admin,
blocks-cli, eitri, apps-commerce, apps-blog, apps-website,
apps-salesforce and apps-nuvemshop. They keep releasing from `7.x` on
`latest`, since they have no 8.x.
- **Fixes main gained after the branch point are ported** (#669):
apps-vtex sends `sc` on every orderForm call; the schema keeps
`_`-prefixed props, gives a string `const` a `default`, keeps a hidden
prop with a default in `required`, and turns recursive types into
`$ref`s; `matchRoute` drops a redirect to the path it matches and
matches query-scoped redirect sources (`/calcados?map=c,ft`) as #647
does on v7: the request's query string must equal the source's exactly,
and a scoped source wins over a path-only one (docs:
deco-sites/docs-tanstack#9). apps-nuvemshop stays v7-only.
- **Release config:** the `7.x` entry in `.releaserc.json` now has
`"channel": "latest-7"`. Without it the channel defaults to the branch
name `7.x`, which npm refuses as a dist-tag. `release.yml` triggers on
main again (#670 pauses it for the cut).

- **Skills:** the skills check from #621 is ported (`skills:check`,
`skills:readme`, `skills-check.yml`, `.agents/skill-template`, the
`.claude/skills` symlink), and it passes: one skill,
`deco-v7-to-v8-migration`, now an index of 9.9 KB with its gotchas split
into subject files.

**Leaves main with it:** main's v7 skills (`apps-vtex`,
`apps-nuvemshop`, `deco-caching`, `deco-cms-route-config`,
`deco-server-functions-invoke`, `deco-storefront-egress-guardrails`,
`deco-migrate-script`, `run-migration`) and v7 docs. They describe
packages that leave main, so they stay on `7.x`.

### Folded PRs

Each one gets closed with a pointer here after the merge.

| PR | What |
|---|---|
| #602 | N-01: content protocol |
| #603 | N-02: core SDK (createCMS, resolver, lazy, built-ins,
matchRoute, drafts) |
| #605 | N-03: secret built-in and the legacy v7 alias bridge |
| #604 | N-04: the deco CLI (schema, content, check, serve) |
| #606 | N-05: telemetry (OTLP), analytics, instrumented fetch, hosted
and KV loaders |
| #607 | N-08: TanStack binding and the descriptor-guide example |
| #608 | N-09: Next.js example rebuilt from the guide |
| #609 | N-10a: Shopify thin client |
| #610 | N-10b: VTEX thin client with retry and circuit breaker |
| #611 | N-10c: apps-blog and apps-website are v7-only |
| #612 | N-10d: Wake and Magento thin clients |
| #613 | N-10e: Algolia, Resend and Marketing Cloud Personalization
clients |
| #614 | N-11: v7 to v8 migration tool |
| #615 | N-12: docs-conformance gate |
| #616 | N-13: v7 leaves the v8 line (one package, thin clients,
migration is a skill) |
| #617 | N-14: per-file tsc output (TypeScript 7, no bundler) |
| #618 | N-15: preview a forced variant through the draft pointer |
| #619 | N-16: drafts are the fast-preview pointer |
| #634 | N-17: hosted mode (CDN releases, CDN drafts, site token
telemetry) |
| #668 | colour `deco check` output |
| #669 | N-19: port the v7-line fixes from main (including #647's
query-scoped redirects), the skills check from #621, the `latest-7`
channel and main's CHANGELOG entries |

## Release mechanics

The version comes from semantic-release (`.releaserc.json`, angular
preset, one shared tag `blocks-v${version}` for every package). Three
facts decide it, and each was reproduced with semantic-release 25.0.5
dry runs in a local sandbox (no tokens, nothing pushed):

- **A seed tag is required.** Without one, this `feat:` squash computes
**7.79.0** on `latest`. A major marker would compute 8.0.0, which npm
refuses (E403) because a deprecated 8.0.0 already exists.
- **The seed goes on #670's merge commit**, not on today's head. With
the lightweight tag `blocks-v8.0.0` there, this squash computes
**8.1.0**, channel `latest`, and publishes `blocks apps-algolia
apps-magento apps-resend apps-sfmc-personalization apps-shopify
apps-vtex apps-wake` with `--tag latest`. On today's head the tag would
also sit in `7.x`'s history, and every 7.x release would fail with
`EINVALIDMAINTENANCEMERGE`.
- **#670 pauses main's release trigger** between the seed and this
merge. Otherwise any v7 `fix:` merged to main in that window would ship
as **8.0.1** on `latest`.

**v7 after the cut:** `7.x` is cut from today's main, plus four commits:
the release config; the migrator fix that keeps newly migrated sites on
7.x (it also refuses an 8.x answer from npm); and v7 install docs that
ask for `@decocms/blocks@latest-7`, since a plain `@decocms/blocks` next
to `@decocms/tanstack` would install two copies of it. @decocms/blocks
and the six apps that also ship in v8 publish on the dist-tag
**`latest-7`**. npm refuses `v7` and `7.x` as dist-tags, because they
read as version ranges. The ten v7-only packages keep `latest`. The
first 7.x release is **7.78.1**.

**The squash commit message is this PR's title and body** (repo setting:
PR title + PR body). This body therefore contains no major-version
marker and no CI-skip token; keep it that way when editing.

**Publishing** goes through npm Trusted Publishing (OIDC) from
`release.yml`, with no stored token. **apps-sfmc-personalization has
never been published by the workflow**, only by hand, so check its
trusted publisher on npmjs.com before merging. If that check is skipped
and its publish fails, the tag already exists and a re-run releases
nothing; see "If it goes wrong".

## Merge-day runbook

Run it in one sitting, with merges to main frozen. Each step has a
check; stop at the first one that fails.

| # | Step | Command | Check | Rollback |
|---|---|---|---|---|
| 0 | Before the day: trusted publishers for all 18 packages
(`decocms/blocks`, `release.yml`, no environment); the PO names #670 and
this PR | npmjs.com → package → Settings → Trusted publishing | every
package lists `release.yml` | — |
| 1 | Freeze merges to main | announce | `git describe --exact-match
--tags origin/main` prints the latest `blocks-v7.*` (today
`blocks-v7.78.0`) | unfreeze |
| 2 | Cut `7.x` at main's head (fast-forward from `762d99c7`) |
`M0=$(git rev-parse origin/main); git merge-base --is-ancestor
origin/7.x $M0 && git push origin $M0:refs/heads/7.x` | no Release run
starts (that commit's workflow triggers only on main) | nothing to undo
|
| 3 | Merge #670 (pause) as a squash, title unchanged | GitHub | no
Release run; `M1=$(git rev-parse origin/main)` | revert as `chore:`,
after step 5's rollback |
| 4 | M1 is main-only | `! git merge-base --is-ancestor $M1 origin/7.x`
| exits 0 | — |
| 5 | Push the seed | `git tag blocks-v8.0.0 $M1 && git push origin
refs/tags/blocks-v8.0.0` | `git ls-remote --tags origin blocks-v8.0.0`
shows `$M1`. Optional: Actions → Release → Run on main, dry run, logs
`Found git tag blocks-v8.0.0` | `git push origin
:refs/tags/blocks-v8.0.0` |
| 6 | Turn on 7.x: push the four prepared commits | `git push origin
<prepared 7.x head>:refs/heads/7.x` | Release run on 7.x publishes
**7.78.1**: `npm view @decocms/blocks dist-tags` shows `latest-7:
7.78.1`, `latest: 7.78.0`; `npm view @decocms/blocks-cli dist-tags`
shows `latest: 7.78.1`. Expected side effect: the run first adds 7.78.0
to the `latest-7` channel (a git note and a bot comment on #655),
publishing nothing | a failed run publishes nothing; fix on 7.x |
| 7 | Retarget the open v7 PRs to `7.x`; protect `7.x` like main (a
ruleset with the deletion, force-push and pull-request rules) | `gh pr
edit <n> --base 7.x` | none of them targets main | — |
| 8 | Bring this branch onto main without changing its tree | `git merge
-s ours --no-edit origin/main && git diff --quiet bbb4e36 HEAD && git
push` | the PR diff restores `release.yml`'s `main` trigger; without `-s
ours`, git silently keeps #670's pause | — |
| 9 | Final dry run on this exact tree | semantic-release `--dry-run` in
a local sandbox (a `file://` copy of the repo with #670's merge, the
seed and this tree squashed on top; no tokens) | `next=8.1.0
channel=null`, `--tag latest`, the 8 packages, and the real
`blocks-v8.0.0` on GitHub equals #670's merge commit (the sandbox adds
its own seed, so it checks the real one separately) | stop |
| 10 | Mark ready; an engineering-deco member who did not push step 8
approves (the ruleset dismisses earlier approvals on push and requires
approval of the last push); resolve every review thread; **Squash and
merge** (not merge or rebase) with the title `feat: Deco CMS v8 — one
squash of the v8 stack` | `gh pr ready <this PR>` | Release run: tag
`blocks-v8.1.0`, 8 × `npm publish --tag latest`, GitHub release Latest |
see below |
| 11 | Verify npm | `for p in blocks
apps-{algolia,magento,resend,sfmc-personalization,shopify,vtex,wake}; do
npm view @decocms/$p dist-tags; done` | `latest: 8.1.0` for all 8;
v7-only packages still have `latest: 7.78.1` | see below |
| 12 | Unfreeze; close the folded PRs | `gh pr close <n> --comment
"Folded into #<this PR>, released as 8.1.0"` | — | — |
| 13 | Bump Studio's pins to `8.1.0` exactly; docs and the serve command
go back to plain `@decocms/blocks`; move `next` to 8.1.0; reword 8.0.0's
deprecation | see the runbook | — | — |
| 14 | Communicate | — | — | — |

**If it goes wrong:**

- **Wrong version in step 9:** don't merge. Re-check the seed (`git
ls-remote --tags origin blocks-v8.0.0` must equal #670's merge commit)
and this body (no marker).
- **Wrong version published in step 10** (7.79.0, 8.0.1, 9.0.0…):
  1. Stop all merges.
2. Point `latest` back for each of the 8 packages: `npm dist-tag add
@decocms/<pkg>@7.78.1 latest`.
3. Deprecate the bad version: `npm deprecate @decocms/<pkg>@<bad>
"Published by mistake; use 7.78.1 or 8.1.0+"`.
4. Don't unpublish, and don't `git revert` on main: a revert is itself a
`revert:` commit and would release.
5. Pause main again (#670's change as a new `chore:` PR) before fixing
forward.
- **One package failed to publish** (for example
apps-sfmc-personalization without a trusted publisher): the tag exists,
so a re-run releases nothing. Fix the trust, then publish that one
package by hand from the tag: `git checkout blocks-v8.1.0 &&
VERSION=8.1.0 node scripts/sync-versions.mjs && bun install && bun run
build && cd packages/<pkg> && npm publish --access public --tag latest`.
That copy has no provenance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Ships Deco CMS v8 as one squash commit onto main. Merging publishes
8.1.0 on npm `latest` for the eight v8 packages, and v7 keeps releasing
from the `7.x` branch. The PR stays a draft until release day and merges
only through the runbook in the body.

**What changes**
- `@decocms/blocks` becomes one package: content protocol, core SDK
(`createCMS`, resolver, lazy, built-ins, `matchRoute`, drafts), `deco`
CLI, telemetry, analytics, instrumented fetch and hosted mode —
published as per-file tsc output with no bundler.
- The commerce apps become thin clients: apps-shopify, apps-vtex (retry,
circuit breaker), apps-wake, apps-magento, apps-algolia, apps-resend and
apps-sfmc-personalization.
- v7's framework packages become site code; sites follow the
TanStack/Next.js guides, and the `deco-v7-to-v8-migration` skill moves a
v7 site over.
- The v7-only packages (tanstack, nextjs, blocks-admin, blocks-cli,
eitri, apps-commerce, apps-blog, apps-website, apps-salesforce,
apps-nuvemshop) leave main and keep releasing from `7.x`; their agent
skills are dropped from the tree, and the skills-check gate stays on
main.
- Ports the v7-line fixes from main: apps-vtex sends `sc` on every
orderForm call, the schema keeps `_`-prefixed props and turns recursive
types into `$ref`s, and `matchRoute` drops a redirect to the path it
matches, including the query-scoped redirect sources.

**Migration and release**
- Releases 8.1.0 on `latest`: the `blocks-v8.0.0` seed tag sits on the
merge commit that pauses main's release trigger, and the squashed commit
message carries no version marker — anything else publishes a wrong
version.
- The `7.x` branch is cut from main with the config for the `latest-7`
dist-tag on `@decocms/blocks` and the six shared apps; the v7-only
packages keep `latest`.
- Sites move with `deco-v7-to-v8-migration`: a one-time script rewrites
content (block map with legacy aliases, vendored app loaders, secret
re-encryption, import report) and then lists the manual steps it can't
do.

<sup>Written for commit ab3d386.
Summary will update on new commits.</sup>

<a href="https://cubic.dev/pr/decocms/blocks/pull/671?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/decocms/blocks/671?returnTo=https%3A%2F%2Fgithub.com%2Fdecocms%2Fblocks%2Fpull%2F671&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@tlgimenes

Copy link
Copy Markdown
Contributor Author

Released in 8.1.0 via #671 (one squash of the v8 stack).

@tlgimenes tlgimenes closed this Oct 12, 2026
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.

1 participant