Repository navigation
Accept a managed Postgres engine and send it in preflight - #457
Merged
Merged
Conversation
floo.app.toml may set engine = "neon" or "hybrid" on a [managed.<name>] Postgres block, but the CLI refused the key at load, so floo deploy and floo deploy --preflight failed on any hybrid Postgres config. The parser now accepts it under the API's rules (Postgres only, "neon" or "hybrid", hybrid without keep_warm, size, users or tier), and the preflight payload carries it unchanged so the API planner can refuse an engine change. An unset engine stays out of the payload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis 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.
Requested by Patrick · project thread
Summary
engineon a[managed.<name>]block (unknown field engine), sofloo deployandfloo deploy --preflightfailed on any hybrid Postgres config. GitHub push was the only way to deploy one. The parser now acceptsengineunder the API's rules (api/app/services/tarball/managed_services.py,_postgres_engine): Postgres only,"neon"or"hybrid", and"hybrid"withoutkeep_warm,size,usersortier.engineunchanged when floo.app.toml sets it, so the API planner sees the engine and can answer409 MANAGED_SERVICE_ENGINE_CHANGEDat preflight. Whenengineis unset the key is left out, so stored shapes don't change. The API'sDeclaredManagedServicealready acceptsengine: "neon" | "hybrid" | None(api/app/schemas/preflight.py, onmain).Issue Closure (Required)
N/A: this follows getfloo/floo
docs/knowledge/domains/managed-services.md("the CLI's preflight payload carries noengineyet") and has no tracking issue.Changes
src/project_config/app_config.rs: addsenginetoManagedServiceBlockandvalidate_postgres_engine, which runs insidevalidate_managed_blocksand uses the API's error wording.src/api_types.rs: addsenginetoDeclaredManagedService, left out whenNone.src/project_config/discover.rs:discover_managed_servicescopies a block'sengineinto the declaration. A legacy section sends none.src/commands/dev.rs: updates a test struct literal.tests/fixtures/manifests/valid/server_supported_keys.toml:[managed.db]gainsengine = "neon", so the roundtrip and strictness tests cover the key.tests/mock_api_tests.rs: the preflight wire test adds a hybrid block and checks thatengine: "hybrid"reachesPOST /v1/apps/{id}/preflight.Deploy needed nothing beyond the parser.
create_deploysends no managed-service declarations, because the server reads the committed manifest, which already carriesengine. The only change deploy needed was for the CLI to stop refusing the config at load.Deliberately not building
engine. Once this ships it can move there, but that is an API change.engineon the legacy[postgres]section. The API accepts it there too, but the CLI's legacy section already leaves out other API keys (users). A legacy[postgres]withengineis still refused at load, so it is never silently dropped.enginein the--dry-runJSONmanaged_servicessummary, infloo services add, or in web docs."neon"goes out as"neon", and the parser checks the value.Test Plan
test_preflight_payload_carries_postgres_engine_only_when_set: floo.app.toml text goes throughload_app_config,discover_managed_servicesandDeclaredStateJSON. The payload carries"hybrid"and"neon"unchanged and leaves the key out for an unset Postgres and for Redis. Before the fix this test failed at load withunknown field engine.test_managed_block_engine_hybrid_parses,test_managed_block_engine_rules_match_the_api,test_managed_block_engine_rejected_off_postgres.test_preflight_declares_enabled_modern_and_legacy_services_without_lockchecks the wire body withengine: "hybrid".Verified by running
cargo fmt --check: clean.cargo clippy --all-targets -- -D warnings: clean.cargo test --no-fail-fast: all green exceptlocal_env_contract::dev_detaches_and_checks_all_services_before_any_spawn. That test fails locally withPORT_IN_USEbecause an unrelated local process holds port 3000. It doesn't touch this change, and CI will run it.dev_proxy::tests::proxy_reaches_a_backend_listening_only_on_ipv6_loopbackflaked once in one binary and passed on 3 reruns.Discovered Issues
None
🤖 Generated with Claude Code