fix(infra): update stale D1 database name in migration/deploy scripts - #5579
Merged
Conversation
The D1/Worker rename (#5569) updated wrangler.jsonc's d1_databases[].database_name from gittensory to loopover, but left 3 package.json scripts (deploy:api, db:migrate:local, db:migrate:remote) passing the old name as a positional arg to `wrangler d1 migrations apply`. Wrangler resolves that arg against wrangler.jsonc's own database_name/binding fields, not the database's live Cloudflare-side name, so every deploy since #5569 merged has failed with: Couldn't find a D1 DB with the name or binding 'gittensory' in your wrangler.jsonc file. blocking every push to main from deploying the API worker.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5579 +/- ##
=======================================
Coverage 94.99% 94.99%
=======================================
Files 573 573
Lines 45490 45490
Branches 14680 14680
=======================================
Hits 43212 43212
Misses 1527 1527
Partials 751 751
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wrangler.jsonc'sd1_databases[].database_namefromgittensorytoloopover, but left 3package.jsonscripts (deploy:api,db:migrate:local,db:migrate:remote) still passing the oldgittensoryname as a positional argument towrangler d1 migrations apply.wranglerresolves that argument againstwrangler.jsonc's owndatabase_name/bindingfields, not the database's live Cloudflare-side name — so it no longer matches, and every deploy since refactor(infra): rename gittensory-api/-ui Cloudflare Workers and D1 database to loopover #5569 merged has failed with:mainfrom deploying the API worker.Test plan
database_id: b2c79dd6-7771-4b1f-aa6b-085d5f3e9528) resolves correctly viawrangler d1 info loopover(matcheswrangler.jsonc's currentdatabase_name).npm run test:ci+npm audit --audit-level=moderate) green.