Repository navigation
fix(hosting): wizard migrates the app's database; keep explicit bootstrap fields; one dotenv source; bounded Redis leases - #803
Merged
Conversation
…lds; one dotenv source; bounded Redis leases - setup wizard passes the app engine URL to Alembic (`sm.database_url` attribute); host and scaffolded env.py prefer it over Settings(), so the migrated database is the one the lock covers (#782) - merge_host_settings(bootstrap) preserves every field set on the bootstrap (#783) - HostSettings discovers the project .env like BootstrapSettings, so boot and runtime reads agree without load_dotenv_into_environ() (#793) - lease acquire bounds each backend call by the remaining wait (1 s floor); Redis client gets 2 s socket timeouts and no hidden retries; acquire timeouts/connection failures return False, release failures log (#787) Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
Mark the .env precedence and lease acquisition entries as behaviour changes. Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
- one immediate Redis reconnect so a stale pooled connection is not an outage - ALEMBIC_DATABASE_URL_ATTRIBUTE constant shared by the wizard and env.py - leases docs: only timeouts and Redis connection failures return False - CHANGELOG: upgrade note for hosts scaffolded before #782 - lease tests: tighter limit assertions, looser wall-clock bounds Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
Deploying simple-module-python with
|
| Latest commit: |
8ebb0a1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d336abb3.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-hosting-review-config-bo.simple-module-python.pages.dev |
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. |
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
config.attributes[ALEMBIC_DATABASE_URL_ATTRIBUTE], fromsimple_module_hosting.migrations). The host and scaffoldedmigrations/env.pyprefer it overSettings(), so the migrated database is the one the migration lock covers. Hosts scaffolded earlier keep their ownenv.py; the CHANGELOG has the one-line change to apply there.merge_host_settings(bootstrap)keeps every field explicitly set on the bootstrap (environment,modules_enabled,redis_url,debug,vite_dev_url, …), not only the secret and database URL.HostSettingsdiscovers the project.envthe same wayBootstrapSettingsdoes, so boot and runtime reads agree withoutload_dotenv_into_environ(). A field set in.envnow pins the value over a stored DB override, like a process env var. Docs (settings.md,env-vars.md,i18n.md) were corrected:SM_MAINTENANCE_MODEdoes work.Lease.acquirebounds each backend call by the remaining wait (1 s minimum per attempt, also forwait=0). The Redis lease client has 2 s socket timeouts and at most one immediate reconnect. An acquire timeout or Redis connection failure logs a WARNING and returns not-acquired. A Redis release failure logs and returnsFalsewithout masking the body's exception. Other backends' errors still propagate.Closes #782
Closes #783
Closes #787
Closes #793
Verification
/setup(port8232): migrations reach head, the first admin is created, host settings persist, maintenance mode on/off works, admin pages loadmake lint,make test-py(7514 passed; one environment-only failure from a stray/tmp/.gitthat passes alone),make test-js(886),make doctorall green; e2e suite 53 passedQA Report
Test plan
/setup→ Apply migrations migrates the database the app runs onhttps://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq