From 9954fe04cb14d35af8764da20e3af1f27711471e Mon Sep 17 00:00:00 2001 From: Dax Date: Mon, 9 Nov 2026 13:47:36 -0500 Subject: [PATCH] chore(infra): drop SiteDomain and retain zen buckets and trust dns before untracking (#62938) --- infra/console.ts | 44 ++++++++++++++++---------------------------- infra/stage.ts | 40 +++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/infra/console.ts b/infra/console.ts index 5c4a882e2af..68624834b66 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -1,31 +1,19 @@ -import { domain, zoneID } from "./stage" - -// opencode.ai and dev.opencode.ai belong to the site Worker (services/site). Their custom domain used to belong to -// the old Console Worker and was moved to the site Worker in place, keeping its ID (Cloudflare won't let a placeholder -// DNS record sit beside a Worker-managed one, and deleting the record first would leave the apex without DNS). -// SiteDomain adopts that resource so SST never deletes the live hostname: it is retained on delete, and its inputs are -// ignored so it is never updated or replaced. Its state still records the old Console service; Cloudflare has the -// site Worker. Keep it declared: dropping it only forgets it (retainOnDelete), but keeping it is a guaranteed no-op. -if ($app.stage === "production" || $app.stage === "dev") { - new cloudflare.WorkersCustomDomain( - "SiteDomain", - { - accountId: "15d29c8639fd3733b1b5486a2acfd968", - hostname: domain, - service: `opencode-site-${$app.stage}`, - zoneId: zoneID, - environment: "production", +// Archived Zen request/response dumps (writer removed May 2026). Nothing reads or writes them. +// Retained on delete so a follow-up can drop them from code without deleting the buckets. +new sst.cloudflare.Bucket("ZenData", { + transform: { + bucket: (_, opts) => { + opts.retainOnDelete = true }, - { - aliases: [ - `urn:pulumi:${$app.stage}::${$app.name}::sst:cloudflare:SolidStart$sst:cloudflare:Worker$cloudflare:index/workersCustomDomain:WorkersCustomDomain::ConsoleWorkerDomain`, - ], - retainOnDelete: true, - ignoreChanges: ["accountId", "hostname", "service", "zoneId", "environment"], + }, +}) +new sst.cloudflare.Bucket("ZenDataNew", { + transform: { + bucket: (_, opts) => { + opts.retainOnDelete = true }, - ) -} + }, +}) -// Archived Zen request/response dumps (writer removed May 2026). Retained on purpose; nothing reads or writes them. -new sst.cloudflare.Bucket("ZenData") -new sst.cloudflare.Bucket("ZenDataNew") +// Keep this file a module so sst.config.ts can import it. +export {} diff --git a/infra/stage.ts b/infra/stage.ts index 52ecaabab74..5ff0d7daa38 100644 --- a/infra/stage.ts +++ b/infra/stage.ts @@ -9,20 +9,30 @@ export const awsStage = $app.stage === "production" ? "production" : "dev" export const deployStats = $app.stage === awsStage if ($app.stage === "production") { - new cloudflare.DnsRecord("TrustCenter", { - zoneId: zoneID, - name: "trust.opencode.ai", - type: "CNAME", - content: "3a69a5bb27875189.vercel-dns-016.com", - proxied: false, - ttl: 60, - }) + // Retained on delete so a follow-up can untrack it without deleting the live record. + new cloudflare.DnsRecord( + "TrustCenter", + { + zoneId: zoneID, + name: "trust.opencode.ai", + type: "CNAME", + content: "3a69a5bb27875189.vercel-dns-016.com", + proxied: false, + ttl: 60, + }, + { retainOnDelete: true }, + ) - new cloudflare.DnsRecord("TrustCenterVerification", { - zoneId: zoneID, - name: "opencode.ai", - type: "TXT", - content: "compai-domain-verification=org_6993a99c6200a2d642bb115d", - ttl: 60, - }) + // Retained on delete so a follow-up can untrack it without deleting the live record. + new cloudflare.DnsRecord( + "TrustCenterVerification", + { + zoneId: zoneID, + name: "opencode.ai", + type: "TXT", + content: "compai-domain-verification=org_6993a99c6200a2d642bb115d", + ttl: 60, + }, + { retainOnDelete: true }, + ) }