feat(cli): enable lazy local stack startup - #6071
Conversation
6f3f0ae to
9ff0201
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f3f0aeea9
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| home: home.dir, | ||
| }); | ||
| expect(before.exitCode, `stdout:\n${before.stdout}\nstderr:\n${before.stderr}`).toBe(0); | ||
| expect(before.stdout).toContain("auth: Pending"); |
There was a problem hiding this comment.
Expect Dormant for lazy services before activation
In the live lazy-start scenario, supabase status reads the stack's projected service states, and lazy services that have not been activated are normalized from raw inactive Pending/Stopped into Dormant (see StackStateProjection and the lazy startup unit tests that assert auth is Dormant after stack.start()). After this start --detach, auth should therefore be printed as auth: Dormant, so this assertion will fail the live suite before it ever exercises the first proxied request.
Useful? React with 👍 / 👎.
| "keeps an HTTP service dormant until its first proxied request", | ||
| { timeout: START_TIMEOUT_MS + 120_000 }, | ||
| async () => { | ||
| project = await makeTempStackProject("supabase-lazy-start-live-"); |
There was a problem hiding this comment.
Initialize the live stack project through the CLI
For local-dev-stack live tests, the workspace guidance expects creating a temp project and running runSupabaseLive(["init"], { cwd }) before start, so the test covers the real generated supabase/config.toml and normal project setup path. This path seeds only .supabase/stacks/default/stack.json via makeTempStackProject, so the live test can pass while regressions in initialized-project config loading or startup setup are missed; please create a temp dir and invoke init before starting.
AGENTS.md reference: apps/cli/AGENTS.md:L445-L445
Useful? React with 👍 / 👎.
f5a641c to
b874f95
Compare
9ff0201 to
e55f7a3
Compare
|
Consolidated into #6072 to simplify review and merging. |
Consolidates the complete lazy-stack v2 implementation and its architecture hardening into one reviewable change. The implementation replaces the earlier user-space coordination protocols with explicit ownership boundaries and operating-system primitives: - centralizes Docker and native artifact policy in one service catalog - publishes complete native caches through private staging directories and atomic rename - models lifecycle intent directly on each service as inactive, running, or explicitly stopped - activates HTTP services at the existing proxy boundary while keeping direct-listener services eager - reserves real TCP ports until each service reaches its spawn boundary - gives foreground and detached stacks the same allocation, readiness, and lifecycle behavior - enables lazy startup for CLI-managed local stacks while preserving eager startup as the package default The hardening pass makes each service's stable state stream the single lifecycle coordination primitive, removes generation-specific waiter and relaunch machinery, keeps healthy requests off the global lifecycle lock, starts independent eager roots concurrently, recovers incomplete artifact-cache destinations, and makes service port mappings exhaustive. This keeps the simpler v2 architecture while closing the highest-impact concurrency, recovery, and shutdown races identified during review. Realtime remains eager because the HTTP proxy does not bridge its WebSocket traffic, and concurrent artifact downloaders may duplicate work while still publishing through an atomic winner. Supersedes supabase#6041 Supersedes supabase#6042 Supersedes supabase#6043 Supersedes supabase#6044 Supersedes supabase#6045 Supersedes supabase#6046 Supersedes supabase#6047 Supersedes supabase#6069 Supersedes supabase#6070 Supersedes supabase#6071
Replacement stack 3 of 3, based on #6070.
Stack: #6069 → #6070 → #6071
Makes lazy startup the policy for CLI-managed stacks while keeping the package default eager:
The separate test-only commit isolates the legacy SSO integration suite from host keyring state discovered during the full regression run; it does not affect runtime behavior.
Supersedes #6047