Skip to content

feat(cli): opt supabase init into the experimental stack via env - #6665

Merged
avallete merged 5 commits into
developfrom
avallete/e66eaf50
Sep 21, 2026
Merged

avallete merged 5 commits into
developfrom
avallete/e66eaf50

Conversation

@avallete

Copy link
Copy Markdown
Member

Summary

  • SUPABASE_EXPERIMENTAL_STACK=1 supabase init writes [experimental] stack = true and omits Docker-era default ports so the new stack is not pinned to legacy local listeners.
  • Unset or 0 keeps the established Go-parity template. Invalid values fail closed. Blank supabase bootstrap uses the same scaffold.

SUPABASE_EXPERIMENTAL_STACK=1 writes experimental.stack and omits
Docker-era default ports so new projects can use the stack without
pinning legacy local ports.
@avallete
avallete requested a review from a team as a code owner September 17, 2026 14:59
Keep the init opt-in docs next to develop's stack targeting section.
@avallete

Copy link
Copy Markdown
Member Author

/ai-review

@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

Adjudication found eight confirmed concerns and refuted two. Most are documentation, robustness, and coverage issues; the most significant is that persisting the environment opt-in conflicts with the trusted repository convention that environment opt-ins must not write project configuration.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/commands/init/init.handler.ts:23 behavior-regression codex The new init and blank-bootstrap behavior turns a temporary environment override into persistent project configuration, contrary to the trusted repository convention that environment opt-ins do not write project configuration.
🟡 MINOR apps/cli/src/commands/bootstrap/bootstrap.handler.ts:171 error-handling claude Blank bootstrap validates SUPABASE_EXPERIMENTAL_STACK only after creating the work directory, possibly prompting for overwrite, and changing the process working directory.
🟡 MINOR apps/cli/src/commands/init/SIDE_EFFECTS.md:33 documentation claude The init environment-variable table omits SUPABASE_YES even though the handler reads it through resolveYes.
🟡 MINOR apps/cli/src/commands/init/SIDE_EFFECTS.md:41 documentation codex The documented invalid-value condition incorrectly includes an empty SUPABASE_EXPERIMENTAL_STACK value, although the resolver treats an empty value as unset.
🟡 MINOR apps/cli/src/commands/bootstrap/bootstrap.handler.ts:171 test-coverage claude The newly added bootstrap environment-flag wiring has no handler integration coverage for either enabled scaffolding or invalid input.
⚪ NIT apps/cli/src/shared/init/project-init.templates.ts:496 robustness claude The stack template transformation relies on brittle substring replacements, including an analytics port fragment with no section or comment anchor.
⚪ NIT apps/cli/src/shared/init/project-init.templates.ts:469 documentation claude The generated comment describes only top-level start, stop, and status even though experimental.stack also controls numerous local database, migration, storage, seed, and inspection paths.
⚪ NIT apps/cli/src/commands/bootstrap/SIDE_EFFECTS.md:72 formatting claude+codex The newly added SIDE_EFFECTS table rows are not padded consistently with the surrounding aligned Markdown tables.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/src/shared/init/project-init.ts:139 (api-design): Making experimentalStack optional allows callers to omit an explicit scaffolding decision.
    Refuted: Concrete surrounding API behavior establishes false as the intentional default for this opt-in: renderCliConfigTemplate defaults experimentalStack to false at project-init.templates.ts:508-517, and the existing non-production file-mode caller deliberately omits it. Both production handlers pass an explicit value. Optionality therefore encodes the established opt-in default rather than an ambiguous runtime state.
  • apps/cli/src/commands/init/init.handler.ts:25 (correctness): An unset environment variable during init --force drops an existing experimental.stack=true setting.
    Refuted: The force path intentionally replaces the entire configuration rather than preserving selected existing settings: project-init.ts:296-308 only short-circuits without force and otherwise writes a fresh template, while init/SIDE_EFFECTS.md:92 and stack-commands.md:90-93 explicitly document replacement and the no-environment legacy template. Preserving this one field would conflict with the established force semantics.

Stats

Claude findings: 8 · Codex findings: 3 · 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.

Comment thread apps/cli/src/commands/init/init.handler.ts
Comment thread apps/cli/src/commands/bootstrap/bootstrap.handler.ts Outdated
Comment thread apps/cli/src/commands/init/SIDE_EFFECTS.md Outdated
Comment thread apps/cli/src/commands/init/SIDE_EFFECTS.md Outdated
Comment thread apps/cli/src/shared/init/project-init.templates.ts
Comment thread apps/cli/src/commands/bootstrap/bootstrap.handler.ts Outdated
Comment thread apps/cli/src/shared/init/project-init.templates.ts Outdated
Comment thread apps/cli/src/commands/bootstrap/SIDE_EFFECTS.md Outdated
Init tests were mutating SUPABASE_EXPERIMENTAL_STACK, which leaked into
parallel integration files and could take pull off the mocked pg-delta path.
…writes

Validate SUPABASE_EXPERIMENTAL_STACK on the scratch path before mkdir/chdir,
cover that in integration tests, and document empty-string fallback.
@avallete
avallete enabled auto-merge September 17, 2026 18:20
@avallete
avallete added this pull request to the merge queue Sep 21, 2026
@avallete
avallete removed this pull request from the merge queue due to a manual request Sep 21, 2026
@avallete
avallete added this pull request to the merge queue Sep 21, 2026
Merged via the queue into develop with commit 30fc965 Sep 21, 2026
93 checks passed
@avallete
avallete deleted the avallete/e66eaf50 branch September 21, 2026 07:28
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