diff --git a/apps/cms/component.yaml b/apps/cms/component.yaml index 1bdb859..35e0fcb 100644 --- a/apps/cms/component.yaml +++ b/apps/cms/component.yaml @@ -103,10 +103,16 @@ spec: wiringComponents: "cloudflare-hyperdrive-cms,cloudflare-r2-cms" wiringEnvs: "stage,prod" wiringFixture: wiring.fixture.json + # Terraform owns every resource the bindings name (cloudflare-r2-cms, + # cloudflare-hyperdrive-cms). Left on, wrangler reads the R2 bucket over + # the R2 API before the upload, and the brokered workers-deploy token has + # no R2 permission: "Authentication error [code: 10000]" on + # /r2/buckets/. The deploy step passes --x-provision=false. + skipResourceProvisioning: true installCommand: pnpm install --frozen-lockfile # The CMS's suite (tests/cms) runs in this lane too: a change to apps/cms # alone does not mark cms-tests changed (dependsOn orders, it does not - # propagate changes), and 0.20.0's worker composition has no test step. + # propagate changes), and the stack's worker composition has no test step. buildCommand: pnpm exec turbo run build --filter=@saas/cms && pnpm --filter @saas/cms-tests test typecheckCommand: pnpm exec turbo run typecheck --filter=@saas/cms dryRunCommand: pnpm exec wrangler deploy --dry-run --config wrangler.jsonc --env prod diff --git a/apps/cms/docs/runbook.md b/apps/cms/docs/runbook.md index 09fe384..ff03838 100644 --- a/apps/cms/docs/runbook.md +++ b/apps/cms/docs/runbook.md @@ -109,6 +109,12 @@ real R2 adapter. - `{"db":"error"}`: Payload started but the query failed: check that `cloudflare-hyperdrive-cms` applied, that the deploy rendered the right `HYPERDRIVE_CMS` id, and that db-migrate applied migration 200. +- **Deploy: "Authentication error [code: 10000]" on `/r2/buckets/`.** + Wrangler's resource provisioning checked the bucket with the brokered + `workers-deploy` token, which has no R2 permission. `skipResourceProvisioning: + true` in `component.yaml` turns that check off (stack-tectonic 0.21.0 and + later); check it is still set and the stack pin in `intent.yaml` has not + gone back below 0.21.0. The bucket itself comes from `cloudflare-r2-cms`. - **Uploads fail with "R2_MEDIA binding is missing".** The deploy rendered no `R2_MEDIA` binding: check that `cloudflare-r2-cms` applied for that environment and published `WIRING_CLOUDFLARE_R2_CMS`, then redeploy the CMS. diff --git a/intent.yaml b/intent.yaml index d35a46d..d7c9956 100644 --- a/intent.yaml +++ b/intent.yaml @@ -50,7 +50,7 @@ compositions: # a commit here. Bumping the tag is the deliberate upgrade step. - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/stack-tectonic:0.20.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.21.0 resolution: precedence: - stack-tectonic diff --git a/tasks/PC-7.TaskContract.yaml b/tasks/PC-7.TaskContract.yaml index e1a9a5b..08ba9bb 100644 --- a/tasks/PC-7.TaskContract.yaml +++ b/tasks/PC-7.TaskContract.yaml @@ -14,6 +14,8 @@ spec: - "pnpm-lock.yaml" - "infra/terraform/cloudflare-r2-cms/docs/**" - "tasks/PC-7.TaskContract.yaml" + # The stack pin: 0.21.0 lets the CMS deploy skip wrangler's R2 check. + - "intent.yaml" deps: - "PC-5" doneWhen: