Repository navigation
Conversation
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 9 commands. Binary size: 135.2 MB, up 16.0 KB from 135.2 MB. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 AI Review
CLI reference prose guidance: snapshot supabase/supabase@f78870c supplied to reviewers (advisory, not a style pass).
Both independent reviews were available. Static verification confirms all three Claude findings at nit severity: two misleading error messages and one advisory prose issue supported by the available pinned guidance. Codex reported no findings.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| ⚪ NIT | apps/cli/src/command-internal/stack-local-database.ts:177 |
error-handling |
claude | A selected stack whose database is still starting is reported as "not running" and receives advice to start it again instead of waiting. |
| ⚪ NIT | apps/cli/src/command-internal/target/resolve-target.ts:87 |
error-handling |
claude | On the legacy backend, combining --stack with --linked, --remote, or --db-url suggests enabling the experimental backend even though the same invocation would then fail because local-stack and remote selectors conflict. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/start/start.command.ts:34 |
docs-style |
claude | The modified flag description "Open an existing stack by id or unique id prefix (defaults to SUPABASE_STACK_ID)." uses lowercase "id", contrary to the supplied terminology guidance. The modified descriptions in stack status, stop, restart, logs, and destroy have the same issue. |
Stats
Claude findings: 3 · Codex findings: 0 · Confirmed: 3 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
Coly010
left a comment
There was a problem hiding this comment.
One design change we'd like before this lands: can we collapse --stack and --stack-id into a single --stack that takes either a name or an ID, and do the same for the env with just SUPABASE_STACK? Two selectors that both mean "this stack" feels like more surface than people need, and it lets us drop the "both variables set" error entirely.
A few things that fall out of it:
- Stack names can be any non-blank string, so
cafeor1234could be either. I'd resolve a name under the current project and branch first, then an exact ID or unique prefix (4+ hex chars), so a name always wins on a collision and the result stays deterministic - The project scoping you have for
SUPABASE_STACK_IDshould carry over:SUPABASE_STACKresolving to an ID only selects a stack of the current project, while an explicit--stack <id>can still reach another checkout's stack stack start --stack Xwould open an existing stack X matches by name or ID, otherwise create one named X. A mistyped ID would then create a stack with that name, which I think is acceptable, but shout if you'd rather handle it differentlysupabase logs --stack-idshipped in v3.1.0, so I think it needs to stay onlogsas a hidden deprecated alias for--stack. Thestacksubcommands sit outside the compatibility promise so they can just drop it- The printed hints from
describeStackSelectorwould all become--stack <value>
On precedence, from my read it holds today: a flag beats the env, and the env is ignored rather than an error alongside --linked/--db-url and on the legacy backend, while an explicit flag errors in both. Can we keep that through the change? Unless I'm missing them, I couldn't find tests for the env-ignored cases (SUPABASE_STACK with --linked, SUPABASE_STACK on the legacy backend), so it'd be great to add those alongside a case where a --stack name beats a SUPABASE_STACK ID.
Otherwise, it looks good to me!
TL;DR
adds
--stackand--stack-idto every command that talks to a local stack, withSUPABASE_STACKandSUPABASE_STACK_IDas the fallback.whats introduced?
db,migration,inspect,storage,gen types,test db,seed bucketsandfunctions servenow target a named stack, the waystartandstopalready do.a selected stack never falls back to the default one. a missing or stopped stack fails naming it, and only
db startcreates one.with no selector nothing changes.
how?
stackForProjectresolves the selection through the sameStackTargetResolverthestackcommands use.the flags are per command like
logs, so commands that never reach a stack reject them instead of ignoring them.visual rep:
flowchart TD cmd["db, migration, gen types, ..."] --> sel{"--stack or --stack-id, else SUPABASE_STACK or SUPABASE_STACK_ID"} sel -- none --> def["default stack, unchanged"] sel -- "flag with --remote, or legacy backend" --> rej["rejected"] sel -- "name or id" --> res["StackTargetResolver"] res -- running --> run["runs on that stack"] res -- "stopped or missing" --> err["error naming the stack"] res -- "missing, db start" --> make["creates it"]ref