Repository navigation
First deploy with D1 migrations: upload, wake, migrate, then live - #43
Merged
Merged
Conversation
First deploys have nothing published yet, so no fleet can start and the pre-migrate wake times out. Reverse steps 6-7 for apps with no successful deploy (last_deploy_sha NULL, read fresh from the row): upload first, wake, then migrate; only a migrate success marks the app live. Existing apps keep migrate-before-upload. The proxy never forwards for an app with no successful deploy (503 building page), so uploaded-but-unmigrated code is never served. First-deploy migrate failures say 'Your app isn't live yet'; the operator CLI (wake: None) translates the celld lease error into a deploy-through-MCP hint.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Found live while pinning template 60edb35 (its
db/migrations/0001_item.sqlstarter): every new app's first deploy failed.migrate()woke the fleet before applying (celld d1 reaches the database through a running node), but a first deploy has nothing uploaded yet, so the wake timed out (fleet tpl-first never became healthy). First deploy (last_deploy_sha IS NULL, read fresh from the row) now runs upload → wake → migrate → live. Apps with a live version keep migrate → upload. A failed first deploy stays not-live and retries on the same path; celld skips applied files.retry-after: 2("being built"), so nobody is served code before its migrations finish.077umask, butcelld d1 migrations applyruns as the app uid, so celld saw "no migrations directory". Staged dirs Outer owns become0755and files0644viafchmodonO_NOFOLLOWfds (readable, not writable, by the app).d1.md, module docs and comments agree with the code.Tests: upload/wake/migrate order on first deploy, first-deploy migrate failure → failed + not live, retry stays on the first-deploy path, proxy refuses before first success, staged files readable under a 077 umask. 446 pass.
Live: released
outer:ed9fd09;create_app tpl-first3through MCP on template 60edb35 →successin 33 s (steps worktree, install, build, gate, deploy-root, deploy, migrate), page renders at 390 px with no console errors. Test app and key deleted.CodeRabbit is out of free reviews; merging on green CI plus the live check above.