Skip to content

Remove the retired D1 code path for serving update definitions#348

Merged
AlCalzone merged 1 commit into
mainfrom
claude/d1-cleanup-phase4
Jul 9, 2026
Merged

Remove the retired D1 code path for serving update definitions#348
AlCalzone merged 1 commit into
mainfrom
claude/d1-cleanup-phase4

Conversation

@AlCalzone

Copy link
Copy Markdown
Member

Follow-up to #347. The firmware update data has been serving from static assets in production since the merge, verified clean (deploy green, smoke test passed, error-filtered wrangler tail silent through the cutover). This removes the now-dead D1 backend.

Removed

  • d1Operations.ts, cachedD1Operations.ts, uploadSchema.ts
  • The /admin/* upload routes (routes/admin.ts) and maintenance/upload.ts
  • The D1 SQL migrations (migrations/)
  • The CONFIG_FILES D1 binding in wrangler.toml and the CONFIG_FILES/ADMIN_SECRET fields on CloudflareEnvironment
  • The now-orphaned safeCompare helper and the upload npm script

Docs

docs/testing-locally.md rewritten for the assets flow — yarn dev builds and serves the data, no ADMIN_SECRET and no manual upload step.

Deliberately left in place

  • The D1 database zwave-js-firmware-updates--prod and the ADMIN_SECRET/BASE_URL repo secrets, as a rollback anchor. Deleting them is a manual follow-up once this has baked. Version rollback still works regardless — older worker versions carry the binding in their own bundle.
  • The Durable Object [[migrations]] in wrangler.toml (the old rate limiter) — unrelated to D1.

Verification

yarn check, yarn lint, and the full test suite (55 tests) pass. wrangler deploy --dry-run shows only the DATA assets and rate-limit bindings, no D1.

🤖 Generated with Claude Code

Now that firmware update data is served from static assets (#347) and
has been verified healthy in production, remove the unused D1 backend:

- Delete d1Operations, cachedD1Operations, uploadSchema, the /admin/*
  upload routes and upload.ts, plus the D1 SQL migrations
- Drop the CONFIG_FILES D1 binding from wrangler.toml and the
  CONFIG_FILES/ADMIN_SECRET fields from CloudflareEnvironment
- Remove the now-orphaned safeCompare helper and the `upload` script
- Rewrite docs/testing-locally.md for the assets flow (yarn dev builds
  and serves the data; no ADMIN_SECRET, no manual upload)

The D1 database and the ADMIN_SECRET/BASE_URL repo secrets are left in
place as a rollback anchor; deleting them is a manual follow-up. The
Durable Object migrations in wrangler.toml are unrelated and untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AlCalzone AlCalzone changed the title Remove the retired D1 code path (Phase 4 cleanup) Remove the retired D1 code path for serving update definitions Jul 9, 2026
@AlCalzone
AlCalzone merged commit 27461c5 into main Jul 9, 2026
3 checks passed
@AlCalzone
AlCalzone deleted the claude/d1-cleanup-phase4 branch July 9, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant