Turn previews on
Previews are off until you turn them on. There are two controls, and the per-PR one wins.The app default, in floo.app.toml
preview_ttl_hours sets how long a preview stays up after it is created or refreshed by a push; the default is 72, and traffic does not extend it. Closing or merging the PR tears it down sooner. A missing preview_environments key means previews are off; preview_environments = false turns them off for future PRs.
[preview] enabled and [preview] ttl_hours are deprecated aliases for these keys. They work for one migration window, and each deploy that uses them emits a legacy_preview_toml warning. Move the values into [github] and delete them from [preview]. [preview.data] is unaffected and remains the hydration surface.The per-PR override, from a pull request comment
Comment on a pull request to override the app default for that PR:
When most PRs on a repo do not need a preview, leave
preview_environments = false and opt in the PRs that want a live URL. When the app default is on, /floo preview off skips a noisy PR.
If the PR is already closed or merged when the command lands, floo tears the preview down instead of deploying one.
Create a sandbox from the CLI
floo previews up creates an isolated sandbox for a feature branch without waiting on a pull request preview:
#123 when that PR number resolves to one preview.
Add --json for stable output:
source_branch, deploy_id, status, URL, expiry, database_branches, and dev_prod_untouched: true. --wait exits non-zero when the deploy fails. Managed-resource isolation failures surface as PREVIEW_MANAGED_SERVICE_ISOLATION_UNAVAILABLE; fix the attached managed service state and retry after pushing a new commit or rerunning the command.
Deleting a preview sandbox tears down only preview-owned services, managed resources, gateway routes, and env vars. Dev and prod resources are untouched.
Preview database branches
A preview database branch is preview-owned managed Postgres state, isolated from dev, prod, and other previews. Migrations, reviewer changes, and agent experiments land in that branch only.empty
and seed start from a blank database; clone-dev starts from a copy of dev.
Inspect the branch behind a preview:
floo previews. Add --json for stable fields:
list JSON includes the app, preview context, and managed_resource_branches;
show returns one managed_resource_branch. Each branch reports its type,
resource_key, source_env, hydration_mode, resource_status, reset eligibility,
and expiry. These commands include Postgres, Redis, and Storage and never return
plaintext credentials.
Reset Redis and Storage preview branches
Usefloo previews resources reset for Redis and Storage branches:
STORAGE_BUCKET value stable, so running preview revisions keep
working. Both then reapply the preview data policy.
Reset is blocked when the preview has no matching managed attachment, when the branch is not ready, when a deploy is in flight for that preview, or when the data belongs to dev, prod, or an external resource.
Choose preview data
Use[preview.data] to choose how a new preview branch starts.
Empty
empty is the default. floo creates a fresh preview database branch with a blank
database, so migrations run from scratch.
Seed
seed runs your seed command once after migrations and before the preview is marked live.
Clone dev
clone-dev copies dev data from every attached managed resource into its preview branch.
The Redis clone runs its preflight before flushing the preview database, so an unsupported key type or an oversized keyspace fails closed and leaves the preview as it was.
Hydration runs at most once per policy, so another push to the same PR keeps reviewer-created state. Change the policy and the next deploy hydrates again.
Unsupported modes
floo does not support:- Raw prod clone.
- Sanitized prod clone until the admin-gated runner exists.
- Merging preview branch changes back into dev or prod.
- Instant copy-on-write branches from arbitrary points in time. Storage copy is explicit object copy, not provider-native branching.
Multi-service apps
Preview branches follow the same managed credential attachment rules as dev and prod. Attach managed Postgres only to the services that need it:managed, legacy apps receive managed credentials in every service. Once any service declares managed, omitted services receive none.