feat(cli): add experimental stack stop - #6507
Conversation
8f52522 to
14cae37
Compare
14cae37 to
e6eeb8d
Compare
e6eeb8d to
865c92f
Compare
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@865c92fd59ff639193d4a3aa299c1f2af3223556Preview package for commit |
|
/ai-review |
|
/ai-review |
avallete
left a comment
There was a problem hiding this comment.
Approve with comments. No blockers: the command meets the stop contract (config-free targeting, preserve data, never destroy). Non-blocking notes on cleanup-error actionability, test names vs asserts, and sharing the small targeting validations with start.
There was a problem hiding this comment.
🤖 AI Review
Only Claude's independent review was available; the Codex pass did not complete. Eight of Claude's ten findings are confirmed, covering shared targeting duplication, conditional documentation inaccuracy, a compiled-boundary test gap, and several maintainability/test-quality nits. Two findings are refuted: StackRuntimeMismatchError is not emitted by the production openStack path, and the documented catch-all exit-1 condition already covers both flagged validation errors. No critical or major defect was verified.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/stop/stop.handler.ts:96 |
code-duplication |
claude | The stop handler duplicates stack-target validation already used by the stack command family instead of sharing it from the family root. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/stop/SIDE_EFFECTS.md:11 |
documentation |
claude | The blanket statement that a missing project config does not prevent stopping is inaccurate for implicit or named targeting when workdir resolution changes the project root. |
| 🟡 MINOR | apps/cli/src/commands/experimental/stack/stop/stop.integration.test.ts:82 |
test-coverage |
claude | No compiled CLI test exercises experimental stack stop through the real stack API and supervisor teardown path. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/stop/stop.handler.ts:33 |
dead-code |
claude | The non-stack-error branch in stopError is unreachable through its statically typed call sites. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/stop/stop.handler.ts:15 |
maintainability |
claude | ExperimentalStackStopFlags is manually duplicated instead of being inferred from the command configuration. |
| ⚪ NIT | apps/cli/src/commands/experimental/stack/stop/stop.integration.test.ts:167 |
test-quality |
claude | Several stop integration-test names claim semantics their fixtures do not exercise. |
| ⚪ NIT | apps/cli/src/shared/cli/hidden-flag.unit.test.ts:182 |
test-quality |
claude | The two useDocker assertions cannot distinguish parsed flag values from command defaults. |
| ⚪ NIT | apps/cli/src/shared/cli/hidden-flag.unit.test.ts:126 |
scope |
claude | The hidden-flag test rewrite is unrelated to stack stop and removes a real-handler GoProxy forwarding assertion, although that contract remains covered elsewhere. |
Refuted findings (kept for transparency, not posted as review comments)
apps/cli/src/commands/experimental/stack/stop/stop.handler.ts:58(error-classification): StackRuntimeMismatchError is a reachable openStack failure but is classified as unknown instead of actionable flags.
Refuted: Although OpenStackError includes StackRuntimeMismatchError, the production openStack implementation cannot emit it. Its state read has a narrower failure set and makeHandle is non-failing. A mismatch returned during stop RPC is also narrowed by the package to StackLifecycleConflictError at EffectStack.ts:282-287.apps/cli/src/commands/experimental/stack/stop/SIDE_EFFECTS.md:24(documentation): The exit-status documentation omits the exit-1 paths for legacy output-flag rejection and mutually exclusive target flags.
Refuted: Both cited paths are typed ExperimentalStackStopError failures and therefore fall under the document's explicit catch-all "any typed stop failure" exit-1 condition. Their behavior could be documented more specifically, but the exit-status enumeration does not omit them.
Stats
Claude findings: 10 · Codex findings: 0 · Confirmed: 8 · Refuted: 2 · 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.
supabase experimental stack stopstops the current or named managed stack, or an explicit stack ID, while preserving its identity and data. Selection works without loading project configuration, including when the config file has been removed or changed.Use the stack package’s lifecycle API and report whether a stack was found in both human and structured output. This PR builds on the experimental stack start integration.