Epic: Add Supabase Database Branching Provider#894
Draft
Conversation
…er support - Remove findPreviewBranch and getBranchNameFromEndpoint from DatabaseProvider interface (Neon-specific) - Add displayName and installHint required string properties to DatabaseProvider interface - Update DatabaseManager to use provider.displayName and provider.installHint in all user-facing messages (both createBranchIfConfigured and deleteBranchIfConfigured) - Add displayName='Neon' and installHint='npm install -g neonctl' to NeonProvider - Update MockDatabaseProvider and DatabaseManager tests to match new interface
2e3b101 to
800e118
Compare
…rFromSettings factory - Add SupabaseSettingsSchema to SettingsManager with projectRef, parentBranch, withData fields - Extend DatabaseProvidersSettingsSchema with optional supabase key - Create src/utils/database-helpers.ts with createDatabaseProviderFromSettings factory - Returns NeonProvider when neon is configured - Returns SupabaseProvider when supabase is configured - Throws if both are configured simultaneously - Returns unconfigured NeonProvider when neither is configured - Add SupabaseProvider placeholder stub (isConfigured=false, full impl in separate issue) - Add comprehensive tests for factory branching logic - Document databaseProviders.supabase config in docs/iloom-commands.md
…upport Adds SupabaseProvider class implementing DatabaseProvider interface using supabase branches CLI commands. Includes: - Branch creation via supabase branches create with optional --with-data - Branch deletion with existence check before attempting removal - Connection string retrieval parsing POSTGRES_URL_NON_POOLING from env output - branchExists with precise error classification: only not-found errors return false, auth/network errors are rethrown (no silent swallowing) - isCliAvailable using ENOENT-based binary detection via supabase --version - isAuthenticated via supabase projects list with auth error pattern matching - sanitizeBranchName replacing slashes with hyphens (Supabase convention) - Graceful degradation: isConfigured returns false on invalid config without throwing - 48 comprehensive unit tests covering all methods and edge cases Supabase branches always fork from production; the fromBranch parameter is accepted for interface compatibility but ignored. The --branch-name flag does not exist in the Supabase CLI and has been omitted from branch creation.
… and templates - Replace createNeonProviderFromSettings with createDatabaseProviderFromSettings in start.ts, finish.ts, cleanup.ts, and cli.ts - Remove stale re-export of createNeonProviderFromSettings from database-helpers.ts - Delete orphaned src/utils/neon-helpers.ts - Rename CLI debug command test-neon to test-db using provider-agnostic interface - Update regular-prompt.txt and issue-prompt.txt to use "database branching" language - Add clarifying comment to SupabaseProvider.branchExists() about exitCode=1 convention
- Add `has_supabase: boolean` to `SessionStartedProperties` telemetry interface - Wire Supabase detection in ignite command alongside existing has_neon tracking - Add test coverage for Supabase detection in session.started telemetry - Expand Supabase documentation with prerequisites, paid plan requirement, and withData option explanation
Adds Supabase as a database branching provider, enabling per-loom database isolation via supabase branches CLI. Refactors DatabaseProvider interface to be provider-agnostic, creates a generic factory, wires all commands through it, adds telemetry and documentation. Fixes #272
Supabase always branches from the default branch so parentBranch has no effect. Made it optional in schema, config interface, and validation. Updated README with Supabase support mentions and example config. Removed parentBranch from Supabase docs example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #272
Epic: Add Supabase Database Branching Provider
Summary
Add Supabase as a second database branching provider, enabling users on Supabase to get isolated database branches per loom. This includes refactoring the provider architecture to cleanly support multiple database providers.
Context
iloom creates isolated Git worktrees for issues/PRs and supports database branching for full environment isolation. Currently only Neon is supported. Supabase users cannot use this isolation feature. The existing architecture anticipated multiple providers (
Config.databaseProvideralready includes'supabase'in its union type) but the implementation is hardcoded to Neon.Key Architectural Decisions
findPreviewBranch()andgetBranchNameFromEndpoint()are only called internally within NeonProvider. They will be removed from the interface and kept as NeonProvider-internal methods.displayNameandinstallHintproperties allow DatabaseManager to show provider-appropriate messages instead of hardcoded "Neon CLI" references.createDatabaseProviderFromSettings()replaces hardcodedcreateNeonProviderFromSettings()calls in 4 command files. Errors if both Neon and Supabase are configured.supabase branchesCLI commands, consistent with the Neon CLI pattern.withDatadefaults totrue— Supabase branches don't include production data by default (unlike Neon). ThewithDatasetting (default: true) ensures users get schema+data in their branches.Acceptance Criteria
databaseProviders.supabasein settings and get isolated database branches per loomThis PR was created automatically by iloom.