decocms / decocms/blocks

fix(migrate): add account_id to generated wrangler.jsonc template

Open Beginner friendly
#431 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5
Forks
2
Avg merge
20h 12m
Merged PRs (30d)
36

Description

Problem

The migration script's generateWranglerConfig in packages/blocks-cli/scripts/migrate/phase-scaffold.ts does not include account_id in the generated wrangler.jsonc. Without it, wrangler deploy targets the deploying user's default CF account instead of the deco-cx account — causing Worker-to-Worker fetches to deco-otel-ingest.deco-cx.workers.dev to return 404.

This was observed on miess-01-tanstack: every POST to the otel-ingest endpoint returned 404, while other sites (casaevideo, lebiscuit, baggagio) that had account_id pinned got 200 OK. Fix was applied manually via PR #56 on that site.

Fix

Add account_id: "c95fc4cec7fc52453228d9db170c372c" to the object returned by generateWranglerConfig in packages/blocks-cli/scripts/migrate/phase-scaffold.ts, so every newly migrated site already has the correct account pinned from day one.

Why this account_id

c95fc4cec7fc52453228d9db170c372c is the deco-cx Cloudflare account that hosts deco-otel-ingest and deco-otel-tail. Both Worker-to-Worker fetches and tail_consumers bindings require in-account routing to resolve correctly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/blocks-cli/scripts/migrate/phase-scaffold.ts and inspect generateWranglerConfig. Verify the generated wrangler.jsonc structure and confirm that newly migrated sites pin the specified Cloudflare account_id so Worker-to-Worker routing uses the deco-cx account.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, cloud
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
91/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.