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 controls how long an idle preview stays around, and defaults to 72. Closing or merging the PR tears it down earlier. A missing preview_environments key means previews are off, and preview_environments = false turns them back off for future PRs.
[preview] enabled and [preview] ttl_hours are deprecated aliases for these keys. They still 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 the pull request to override the app default for that one PR:
This is the control to reach for when most PRs on a repo do not need a preview. Leave
preview_environments = false and opt in the changes that want a live URL. It is also how you skip previews for a noisy PR when the app default is on.
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
Usefloo previews up when an agent needs an isolated sandbox for a feature branch before opening or relying on a pull request preview:
#123 when that PR number resolves to one preview.
Agents should use --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 Cloud Run 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. It is isolated from dev, prod, and other previews. Migrations, reviewer changes, and agent experiments land in that preview branch only. V1 preview database branches are branch-like isolation on floo’s managed-resource substrate. They are not raw production clones, arbitrary point-in-time clones, or provider-native copy-on-write branches. True provider-backed branching is tracked separately in getfloo/floo#733. Use the CLI to inspect the branch behind a preview:#123 when that PR number resolves to one preview.
Use --json when an agent needs stable fields:
database_branches, source_environment, hydration_mode, resource_status, schema_name, reset eligibility, and expiry. It never includes plaintext database credentials.
Reset A Preview Branch
Reset drops and recreates only the selected preview database branch. Dev and prod are untouched.floo previews resources reset for the generic form:
STORAGE_BUCKET / STORAGE_URL values stable, so running preview revisions keep working. Each one then reapplies 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 and copies no data.
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 with the preview left as it was rather than emptied.
Hydration runs at most once per policy. Pushing another commit to the same PR reuses the preview data instead of overwriting reviewer-created state. Change the policy and the next deploy hydrates again.
Unsupported Modes
These are deliberately not V1 behavior:- 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.