Skip to content

Accept a managed Postgres engine and send it in preflight - #457

Merged
pdonohoe02 merged 1 commit into
mainfrom
feat/preflight-engine
Dec 4, 2026
Merged

pdonohoe02 merged 1 commit into
mainfrom
feat/preflight-engine

Conversation

@pdonohoe02

Copy link
Copy Markdown
Contributor

Requested by Patrick · project thread

Summary

  • The CLI refused engine on a [managed.<name>] block (unknown field engine), so floo deploy and floo deploy --preflight failed on any hybrid Postgres config. GitHub push was the only way to deploy one. The parser now accepts engine under the API's rules (api/app/services/tarball/managed_services.py, _postgres_engine): Postgres only, "neon" or "hybrid", and "hybrid" without keep_warm, size, users or tier.
  • The preflight payload now carries engine unchanged when floo.app.toml sets it, so the API planner sees the engine and can answer 409 MANAGED_SERVICE_ENGINE_CHANGED at preflight. When engine is unset the key is left out, so stored shapes don't change. The API's DeclaredManagedService already accepts engine: "neon" | "hybrid" | None (api/app/schemas/preflight.py, on main).

Issue Closure (Required)

N/A: this follows getfloo/floo docs/knowledge/domains/managed-services.md ("the CLI's preflight payload carries no engine yet") and has no tracking issue.

Changes

  • src/project_config/app_config.rs: adds engine to ManagedServiceBlock and validate_postgres_engine, which runs inside validate_managed_blocks and uses the API's error wording.
  • src/api_types.rs: adds engine to DeclaredManagedService, left out when None.
  • src/project_config/discover.rs: discover_managed_services copies a block's engine into 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] gains engine = "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 that engine: "hybrid" reaches POST /v1/apps/{id}/preflight.

Deploy needed nothing beyond the parser. create_deploy sends no managed-service declarations, because the server reads the committed manifest, which already carries engine. The only change deploy needed was for the CLI to stop refusing the config at load.

Deliberately not building

  • The reverse refusal in the API planner (a non-hybrid block on a service whose row records sandboxes). The API doc keeps it out of the planner only because CLI preflight sent no engine. Once this ships it can move there, but that is an API change.
  • engine on 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] with engine is still refused at load, so it is never silently dropped.
  • engine in the --dry-run JSON managed_services summary, in floo services add, or in web docs.
  • A typed enum for the value. It stays a pass-through string so "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 through load_app_config, discover_managed_services and DeclaredState JSON. 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 with unknown 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_lock checks the wire body with engine: "hybrid".

Verified by running

  • cargo fmt --check: clean. cargo clippy --all-targets -- -D warnings: clean.
  • cargo test --no-fail-fast: all green except local_env_contract::dev_detaches_and_checks_all_services_before_any_spawn. That test fails locally with PORT_IN_USE because 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_loopback flaked once in one binary and passed on 3 reruns.

Discovered Issues

None

🤖 Generated with Claude Code

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>
@pdonohoe02 pdonohoe02 self-assigned this Dec 4, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T01:09:29.732877Z 191a383 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pdonohoe02
pdonohoe02 merged commit d03d18b into main Dec 4, 2026
8 checks passed
@pdonohoe02
pdonohoe02 deleted the feat/preflight-engine branch December 4, 2026 01:36
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