Skip to content

test(e2e): delivery CDN stub server - #7841

Closed
tlgimenes wants to merge 74 commits into
split/41-hosted-publishfrom
split/42-delivery-stub
Closed

tlgimenes wants to merge 74 commits into
split/41-hosted-publishfrom
split/42-delivery-stub

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Part of the v8 Studio stack, split from #7728, #7770 and #7766 (closed). Base: #7796. The top of the stack, #7843, has the same code as those three PRs combined.

Adds an in-memory stand-in for the hosted Deco CMS delivery bucket/CDN (packages/e2e/fixtures/delivery-stub-server.ts), wires it into the Playwright web-server env, and registers it as a knip entry.

Merge after the API, daemon and web stacks. This branch is cut from the top of the web stack (#7840), which already sits on the sandbox daemon PR (#7877). It also contains the API stack (#7825) through a normal merge commit, because the e2e specs drive all three. GitHub therefore shows the API stack's changes in this PR's diff; this PR's own change is only the last commit (test(e2e): delivery CDN stub server, 3 files, +251/-3). Once the API stack is merged, the diff shrinks to that commit.

What to look at

  • Stub fidelity to R2/CDN: paths, status codes and headers the hosted delivery code expects.

Stack

e2e track: previous: #7840 (web track top; also merges #7825; the daemon comes in through #7877 at the base) · next: #7842

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig


Summary by cubic

Adds an in-memory stand-in for the hosted Deco CMS delivery bucket/CDN so the e2e specs can exercise the hosted content-protocol flows end to end.

  • packages/e2e/fixtures/delivery-stub-server.ts serves the S3 API Studio writes through (PUT/GET/HEAD/DELETE, list), the public origin sites read (with ETag and Cache-Control), and a __admin endpoint for assertions.
  • The Playwright web-server env starts the stub with a per-run site-token signing key, and the stub is registered as a knip entry.

Also adds Publish's "Try again" recovery: when changes were committed but didn't go live, releases/current { head: true } writes a missing companion release for main's head and makes it current, so a failed release write is no longer a dead end.

This branch carries the API and daemon stacks as merges because the e2e specs drive all three; the stub server itself is the last non-merge commit, and the diff shrinks to it once those merges land. The carried merge removes the sandbox asset upload proxy — PUT /api/:org/sandbox/:projectId/:branch/assets/:name is gone, since project assets now go to Studio's file storage and the daemon no longer takes uploads.

Written for commit a33191b. Summary will update on new commits.

View guided diff Turn on auto-fix

tlgimenes and others added 14 commits October 8, 2026 14:55
…escer

Moves regenerateGenArtifact and decofileCommitMessage out of commit-coalescer.ts into decofile/gen-artifact.ts so the hosted publish path (later in this stack) can reuse them. No behavior change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds `@decocms/[email protected]` to apps/api (the hosted path uses its decofile/release helpers). The Dockerfile and the tarball smoke test now start Studio by the path of its CLI, and a test pins the v7 secret-loader exemption.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds the hosted delivery bucket settings (R2/S3), `deliveryStore` (read/write release objects with ETag handling) and `deliveryPurge` (CDN purge with one retry), plus shared test helpers. Nothing calls them yet; the routes land in #10/#11. A temporary knip `ignoreIssues` entry for `apps/api/src/hosted/*.ts` (unused exports only) is removed in PR 11 of this track.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds the CDN draft store and a content storage that layers the draft over the repo main branch (read-only repo storage underneath), so a hosted v8 project can be edited without a running sandbox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds release objects and `publishDraft`: commits the draft to main, writes the release to the CDN bucket, updates latest.json and purges it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
…cope, draft publish status

Adds the `site_editor_content_protocol` org flag (off by default; `tool-io.ts` regenerated, flag hunks only), the releases timeline, the project-to-site scope helper and the draft publish status loader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds Ed25519-signed site tokens for hosted v8 sites (issue and verify).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
When a project is created for a deco.cx site, claims that site slug for the project's org (bounded deco.cx lookup), so later hosted routes can scope by org-owns-site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds an admin-only route that backfills site claims for existing projects, using the claim logic from the previous PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Wires the hosted modules into routes: the decofile `/rpc` endpoint, the v8 draft pointer and publish on the session routes, the hosted routes (releases, site tokens), all behind the `site_editor_content_protocol` flag and scoped to the org that owns the site.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Proxies the content protocol `/_sandbox/rpc` to the sandbox daemon with the same auth and site claim as the other sandbox routes, and reports the draft publish status. Removes the temporary knip ignore for `apps/api/src/hosted/*.ts` added in PR 3 of this track; every hosted export now has a consumer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
The e2e specs exercise the hosted API routes, so this branch carries the API stack (plan PRs 1-11) as a normal merge.

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

Carries the daemon stack (plan PRs 12-19) as a normal merge so the e2e branch holds all three tracks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
Adds an in-memory stand-in for the hosted Deco CMS delivery bucket/CDN and wires it into the Playwright web server env, registered as a knip entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes and others added 8 commits October 9, 2026 12:06
Publish's "Try again" when its changes were committed but didn't go live
(release "created" or "none"): main's head gets its companion release
when it is missing and is made current. The head holds every published
change, so a retry never rolls back a newer Publish; its schema is main's
own, so there is nothing to confirm. Before this, a Publish whose release
write failed had no way back: Make current needs a companion, and the next
Publish with an empty draft is up to date and leaves latest.json alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes and others added 26 commits October 12, 2026 16:11
`PUT /api/:org/sandbox/:projectId/:branch/assets/:name` is gone: project
assets (hosted and sandbox) go to Studio's file storage
(`/file-configs/:id/upload`), and the daemon no longer takes uploads.
`proxyDaemon` loses the binary-body option that only this route used.

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

Copy link
Copy Markdown
Contributor Author

Folded into #7887 (API) / #7888 (web, stacked on #7887). The tree of #7888 equals this stack's top (split/51-v8-per-site). The branch is kept.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig

@tlgimenes tlgimenes closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant