fix(cloud): stop PR preview builds failing on DO migrations (10211)#1194
fix(cloud): stop PR preview builds failing on DO migrations (10211)#1194RhysSullivan wants to merge 2 commits into
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 243e6c0 | Commit Preview URL Branch Preview URL |
Jun 28 2026, 11:10 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 243e6c0 | Jun 28 2026, 11:11 PM |
| const cfg = JSON.parse(readFileSync(cfgUrl, "utf8")); | ||
| if (Array.isArray(cfg.migrations) && cfg.migrations.length > 0) { | ||
| delete cfg.migrations; | ||
| writeFileSync(cfgUrl, JSON.stringify(cfg)); |
There was a problem hiding this comment.
writeFileSync is called without JSON.stringify's space argument, so the patched wrangler.json is written as a single minified line with no trailing newline. This is a build artifact so it doesn't affect correctness, but if anything downstream ever logs or diffs the file it will be harder to read. Passing 2 as the space argument preserves the same formatting style used elsewhere in the repo.
| writeFileSync(cfgUrl, JSON.stringify(cfg)); | |
| writeFileSync(cfgUrl, JSON.stringify(cfg, null, 2) + "\n"); |
Cloudflare previewTorn down — the PR is closed. |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
…ds stop failing Preview (non-main) Workers Builds deploy via 'wrangler versions upload', which rejects any config containing Durable Object migrations (error 10211). Previews share production's already-applied DO state, so they neither need nor can apply migrations. build.mjs strips 'migrations' from the generated dist/server/wrangler.json on non-main CI branches; main keeps them and applies on the real deploy. Fail-safe: only strips on a confirmed non-main CI branch, never on a production deploy. Leaves the orphaned KV McpSessionDO + its stub export in place (harmless, unbound); not worth a delete migration whose own preview build can't pass.
02518dd to
97a3a1b
Compare
|
Closing — unnecessary. Confirmed normal PRs already pass the executor-cloud preview build (only PRs that add a new DO migration hit 10211, which is rare and self-resolved now that the SQLite migration is applied). Not worth a permanent build-script workaround. |
Problem
Preview (non-
main) Workers Builds deploy viawrangler versions upload, which rejects any config containing a Durable Object migration with error 10211 ("migrations must be applied via a non-versioned deployment"). Sinceapps/cloud'swrangler.jsonccarries the DO migration ledger (v1/v2), every PR's preview build fails.Fix
build.mjsstripsmigrationsfrom the generateddist/server/wrangler.jsononly on non-mainCI branches (WORKERS_CI=1+WORKERS_CI_BRANCH !== "main"). Previews share production's already-applied DO state, so they don't need (and can't apply) migrations.mainkeeps migrations and applies them on the real, non-versioned deploy.Fail-safe by construction: it only ever strips on a confirmed non-
mainCI branch, so it can't drop migrations from a production deploy. Confirmed via the CF build log that the strip takes effect (the earlier error moved from10211to a different one once stripped).Scope note
This intentionally does not delete the orphaned KV
McpSessionDOclass. That class is unbound and harmless, the migration ledger must stay regardless, and a delete-class PR's own preview build can't pass anyway. Left as-is with its one-line stub export.Verified locally
mainbuild keeps migrations; preview-branch build logs the strip and emits no migrations in the deploy config