Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/cms/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/<name>. 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
Expand Down
6 changes: 6 additions & 0 deletions apps/cms/docs/runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<name>`.**
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.
Expand Down
2 changes: 1 addition & 1 deletion intent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tasks/PC-7.TaskContract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading