feat(cli): add experimental stack status - #6508
Conversation
e120ca7 to
1764f96
Compare
fa05922 to
34ca600
Compare
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@34ca600fdad2a3cbe8f166998f05d4b6fdbc4d6fPreview package for commit |
|
/ai-review |
34ca600 to
9ad64f6
Compare
|
On this one, can we integrate :
It was done here but I'm closing this PR as well and porting what was done for start/stop/destroy directly from develop. |
Database-only stacks previously failed credentials() with an InvalidStackConfigError. The api credentials are now optional and are omitted when the Auth capability is disabled.
Suppress the JSON serialization lint in the redaction assertions of the drift test and add ExperimentalStackStatusError to the error-tag fixture.
status --env exports connection variables as dotenv or a JSON variable map, with --override-name for application-specific names. Ordinary status does not reveal credentials. Database-only stacks export database credentials with API credentials omitted when Auth is disabled. An absent config.toml is compared against default settings, matching stack start; invalid configuration still reports drift as unavailable. The legacy -o env form is rejected with a pointer to --env.
supabase status follows [experimental] stack and SUPABASE_EXPERIMENTAL_STACK like start and stop, so a project on the new backend gets a status command that understands its stack.
output.success merges message into the JSON payload, so --env produced
{ DB_URL, message: "" }. Use output.result for the bare variable map and
assert the serialized shape in the integration test.
|
/ai-review |
There was a problem hiding this comment.
🤖 AI Review
Verified all 11 reported findings against the PR code and trusted repository conventions. One duplicate was merged, yielding 10 findings: five minor and five nit-level. All are confirmed; no critical or major issues were found.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/status/status.errors.ts:16 |
telemetry |
claude | The runtime reason is incorrectly classified as an external-service network failure even when it represents user-actionable lifecycle or local encoding errors. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/status/status.handler.ts:229 |
error-handling |
claude | Configuration comparison errors discard their precise typed diagnostic and inaccurately report that the project configuration could not be loaded. |
| 🟡 MINOR | apps/cli/docs/stack-commands.md:31 |
documentation |
claude | The migration guide mentions rejection of legacy -o env but omits that every explicit legacy -o/--output value, including json and pretty, is rejected by the stack backend. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/status/status.env.ts:84 |
correctness |
codex | Text export rejects values containing both a single quote and a backtick even when they can be represented losslessly with dotenv double quotes. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/status/status.env.ts:39 |
correctness |
codex | Override collision validation includes optional variables that will not be exported, rejecting non-colliding renames on capability-limited stacks. |
| ⚪ NIT | packages/config/src/experimental.ts:44 |
documentation |
claude | The generated public configuration schemas retain the old description that says the stack backend affects only start and stop. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/status/status.env.ts:37 |
validation |
claude | Conflicting repeated overrides for the same source variable are silently resolved last-wins. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/status/status.handler.ts:213 |
code-quality |
claude | The environment-export branch returns an unrelated optional inspection whose presence depends solely on whether --stack-id was used. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/status/status.handler.ts:226 |
performance |
claude | Status with --stack-id and a loadable configuration inspects the stack twice, repeating the owner status RPC. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/status/SIDE_EFFECTS.md:49 |
documentation |
claude+codex | The side-effect contract omits the command's exit-code behavior and telemetry-state write. |
Stats
Claude findings: 8 · Codex findings: 3 · Confirmed: 10 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: manual · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
Classify lifecycle and dotenv-encoding failures as user-actionable instead of network errors, surface the typed diagnostic when a config comparison is rejected, reject repeated --override-name sources, use double quotes for dotenv values that need them, return void from the handler, and document exit codes, telemetry, and the legacy -o rejection.
supabase stack statusreports the selected stack's identity, runtime, owner, readiness, endpoints, and configuration drift. It loads configuration from the selected stack's project, including when inspecting an ID from another working directory.Adds a read-only configuration comparison to the stack package that reports changed paths without exposing secret values. Invalid or unreadable project configuration leaves inspection available and marks drift as unavailable. An absent
config.tomlis compared against default settings, matching whatstack startdoes (develop's project loader treats an absent file as defaults, not an error).status --envPorted from #6517 (closed):
status --envexports connection variables as dotenv (text) or a JSON variable map (--output-format json/stream-json). Ordinary status never reveals credentials.--override-name API_URL=NEXT_PUBLIC_SUPABASE_URLrenames exported variables (CSV or repeated; requires--env; rejects unknown sources, invalid names, and duplicate destinations).stack.credentials()in@supabase/stacknow returns an optionalapiinstead of failing when Auth is disabled.-o/--outputvalue is rejected with--output-formatguidance;-o envpoints at--env.',",`that round-trips; a value none can carry fails with a pointer to--output-format json.Feature-flag routing
Top-level
supabase statusnow follows[experimental] stack = true/SUPABASE_EXPERIMENTAL_STACKexactly likestartandstop, so a project on the new backend gets a status command that understands its stack.supabase stack statusalways uses the new backend.Also in this PR
developtwice (refactor(stack): simplify stack identity #6531'sdescriptor(state, id)change, then feat(cli): add stack command options and destruction #6576'sdestroy/discoverStacksadditions and the handle's Effect-valuedstatus/credentials).startStack/provideFlags), not network errors; a rejected config comparison reports its typed diagnostic.lint:effect:checkwarnings in the drift test, the error-tag telemetry fixture, and the routing test's hardcodedstacksubcommand list.