Repository navigation
fix(deploy): match D1 migrations_dir by folder, not by text - #502
Conversation
A migrations_dir such as "db/migrations" names the same folder as the "./db/migrations" Void expects, but the preflight compared the raw text. The provisioner kept the equal spelling, so every Cloudflare deploy stopped with "provisioning did not set migrations_dir". Both checks now resolve the value against the config folder, which also accepts an absolute path. A migrations_dir for another folder stops the deploy before any account call, with a message that names the expected folder and the file to edit. Fixes #499 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 536b04fe04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
With an absolute migrations_dir that names Void's folder, the pattern check still used "./db/migrations", so a pattern with the same absolute prefix was rejected. Wrangler checks the pattern against the configured spelling; do the same. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-d1-migrations-dir-compare-void-cloud.voidzero-docs.workers.dev (commit 1956714)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
Fixes #499
Problem
The two checks treated the value differently: the preflight compared the raw text, while the provisioner compared normalized paths. Existing tests missed it because the only
db/migrationstest reuses an existing Worker, and that path skips the check.Fix
A new helper,
sameMigrationsDir(configPath, a, b)inwrangler.ts, says whether two values point to the same folder. It turns\into/and resolves both values against the config's folder, the way Wrangler does. The preflight and the provisioner both use it, and the user's spelling is kept as written.migrations_dir./db/migrationsdb/migrations,db/migrations/,./db/migrations/,src/db/migrations(sourceDirsrc)<root>/db/migrationsdrizzle)Void generates and applies migrations only from
<sourceDir>/db/migrations, so it can't use another folder. The new error names that folder and the file to edit:The "or remove it" part is shown only when the value is in
void.config.ts. It is left out when Void filled the value in and stored it invoid.lock.json.Not in this PR: a backslash spelling (
db\migrations) now passes the preflight. On macOS and Linux it still fails in a later step, the migration apply-set check, whichvoid db migrate --remotealso uses. That is a separate bug.Tests
cloudflare-deploy.test.ts:wrangler.jsonc, forvoid.config.ts, and with sourceDir set;void.lock.json;void.config.tssetup: the first deploy provisions through the real config writer, and the second deploys with no provisioning.wrangler.test.ts: an absolute path to the right folder is kept as written.All 12 new tests fail on
main. The 6 test files that mentionmigrations_dirpass (876 tests). Lint, format and typecheck are clean.🤖 Generated with Claude Code