Skip to content

fix(cli): name the stack opt-in when a stack-only flag is rejected - #7592

Merged
jgoux merged 3 commits into
developfrom
fix/stack-flag-opt-in-hint
Nov 12, 2026
Merged

jgoux merged 3 commits into
developfrom
fix/stack-flag-opt-in-hint

Conversation

@jgoux

@jgoux jgoux commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Without the stack opt-in, supabase start --runtime native reaches the legacy start. That command fails with a bare Unrecognized flag: --runtime, which gives no clue that the flag belongs to the stack backend.

When the legacy backend rejects a flag that the stack version of the same command accepts, the error now names the opt-in:

Unrecognized flag: --runtime in command supabase start

  Hint: --runtime needs the stack backend. Set SUPABASE_EXPERIMENTAL_STACK=1, or set stack = true under [experimental] in your project config and leave SUPABASE_EXPERIMENTAL_STACK unset.
  • The CLI builds the root that the stack opt-in would select and passes it to the parse-error formatters. The hint appears only when that root's command at the same path accepts the rejected flag.
  • This covers every stack-only flag on start, stop and status without a hand-kept list. A flag that neither backend accepts gets no hint.
  • Text and JSON output both carry the hint. Error codes are unchanged.

@jgoux
jgoux requested a review from a team as a code owner November 12, 2026 08:39
@jgoux
jgoux requested a review from avallete November 12, 2026 08:39
@jgoux jgoux self-assigned this Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 1b781f5 against develop at df9a973 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 157 ms 152 ms no real change
supabase --help help 192 ms 193 ms no real change
supabase init init 178 ms 174 ms no real change
supabase migration new bench migration-new 187 ms 189 ms no real change
supabase config convert config-convert 197 ms 196 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 207 ms 214 ms no real change
supabase projects list projects-list 195 ms 194 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 195 ms 195 ms no real change

API calls: unchanged for all 8 commands.

Binary size: 135.0 MB, up 4.0 KB from 135.0 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 150-165 ms 150-161 ms -5 ms (-3%) within noise
supabase --help help 168-229 ms 178-215 ms +1 ms (+0%) within noise
supabase init init 167-210 ms 164-244 ms -4 ms (-2%) within noise
supabase migration new bench migration-new 164-200 ms 161-216 ms +1 ms (+1%) within noise
supabase config convert config-convert 185-207 ms 184-212 ms -1 ms (0%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 194-219 ms 204-226 ms +7 ms (+4%) within noise
supabase projects list projects-list 189-203 ms 182-203 ms -1 ms (0%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 181-209 ms 173-215 ms +0 ms (+0%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Verified all three findings and merged the overlapping test findings into one. Two minor concerns are confirmed: misleading config advice when an environment override disables stack, and an acceptance test that can pass despite unrelated failures.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/shared/cli/subcommand-flag-suggestions.ts:334 error-messages claude When SUPABASE_EXPERIMENTAL_STACK=0 is set, the hint incorrectly offers setting stack = true in config.toml as an effective alternative. The environment override prevents that config edit from enabling stack.
🟡 MINOR apps/cli/src/cli/stack-flag-opt-in-hint.integration.test.ts:112 test-coverage claude+codex The stack-backend acceptance test checks only that the message lacks 'Unrecognized flag', so unrelated failures satisfy the assertion without establishing successful acceptance.

Stats

Claude findings: 2 · Codex findings: 1 · Confirmed: 2 · 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.

@jgoux
jgoux added this pull request to the merge queue Nov 12, 2026
Merged via the queue into develop with commit 8ede09e Nov 12, 2026
58 checks passed
@jgoux
jgoux deleted the fix/stack-flag-opt-in-hint branch November 12, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants