Drop APP_DB jobs tables after porting remaining readers to the JOBS service (ADR 0016) - #1394
Merged
Merged
Conversation
…ervice (ADR 0016) Co-Authored-By: Kent C. Dodds <me@kentcdodds.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
🔎 Preview deployed: https://kody-pr-1394.kody-a99.workers.dev Worker: Mocks:
|
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.
Intent
Finish ADR 0016's jobs-lane extraction cleanup: every remaining main-worker surface that still read the stale
APP_DBcopies ofjobs/archived_job_artifactsnow goes through the JOBS service binding, so the old tables can finally be dropped fromAPP_DB(soak period accelerated pre-launch per runbook step 8).Summary
0010-drop-jobs-tables.sqldropsjobsandarchived_job_artifactsfromAPP_DB(ledger entry added).packages/shared/src/jobs/{store,repo}.ts,packages/jobs-worker/src/service.ts):countJobsForUser,sumJobsStorageBytesForUser,listJobStorageIdsForUser,listArchivedJobArtifactsForUser,listAllJobStorageOwners,getJobInsights,purgeUserJobsData.scheduled_jobscount + D1 storage-byte recompute/reconcile), user-meter parity, DR exporter inventory, admin insights, account export / user-inventory storage-id discovery (bucket paging merged with jobs-worker ids), account data-target registry, retention dispositions.JOBS.purgeUserfail-closed after best-effort cleanup, before the atomic APP_DB delete (jobs rows can no longer join that transaction);deletedRowCountsno longer includesjobs.createD1JobsStore(APP_DB)is no longer needed in any deployed path:testenv gains theJOBS→kody-jobs-testservice binding (multi-configwrangler devresolves it in-process);migrate:local/migrate:e2e/MCP harness also apply the jobs-worker D1 migrations;kody-jobs-testworker (bundled fromtools/jobs-test-service.entry.ts) serving the JobsService contract from its own D1.Testing
npm run validategreen locally (format, lint, typecheck, node+workers unit, e2e, MCP, builds, migrations/guardrails checks).System changes
APP_DBno longer contains job tables; the jobs worker's D1 is the single owner (ADR 0016). Risk: any unported reader would fail withno such tablepost-deploy — auditedFROM jobs/archived_job_artifacts/createD1JobsStore(env.APP_DB)references; remaining hits are jobs-worker-owned code, test fixtures, and docs/migration history.Link to Devin session: https://app.devin.ai/sessions/c87f412525e94774b5829058620c71a9
Requested by: @kentcdodds