mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
fix(studio): use supabase.co for production Warehouse connections (#51934)
Use `<project_ref>.warehouse.supabase.co` in production Flight SQL connection details while preserving `.supabase.red` for staging and local development.
This commit is contained in:
1 parent
cb5b57ce51
commit
c752bf0125
3 files changed
+33
-6
No files matched your search
@@ -95,7 +95,7 @@ describe('WarehouseTab', () => {
|
||||
'Some tables are ready to query. The remaining tables will become available as their backfills finish.'
|
||||
)
|
||||
).toBeInTheDocument()
|
||||
expect(screen.getByDisplayValue('default.warehouse.supabase.io')).toBeInTheDocument()
|
||||
expect(screen.getByDisplayValue('default.warehouse.supabase.co')).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'View progress' })).toHaveAttribute(
|
||||
'href',
|
||||
'/project/default/integrations/warehouse/overview'
|
||||
@@ -118,7 +118,7 @@ describe('WarehouseTab', () => {
|
||||
'href',
|
||||
'/project/default/integrations/warehouse/overview'
|
||||
)
|
||||
expect(screen.queryByDisplayValue('default.warehouse.supabase.io')).not.toBeInTheDocument()
|
||||
expect(screen.queryByDisplayValue('default.warehouse.supabase.co')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
test('renders connection details and offers catalog access only for DuckDB', async () => {
|
||||
@@ -134,10 +134,10 @@ describe('WarehouseTab', () => {
|
||||
expect(container.querySelector('.border-0.shadow-none')).toBeInTheDocument()
|
||||
expect(container.querySelector('[data-orientation="horizontal"]')).not.toBeInTheDocument()
|
||||
expect(screen.queryByRole('heading', { name: 'Connect' })).not.toBeInTheDocument()
|
||||
expect(screen.getByDisplayValue('default.warehouse.supabase.io')).toBeInTheDocument()
|
||||
expect(screen.getByDisplayValue('default.warehouse.supabase.co')).toBeInTheDocument()
|
||||
expect(
|
||||
screen.getByDisplayValue(
|
||||
'flightsql://postgres:[YOUR-PASSWORD]@default.warehouse.supabase.io:443?tls=enabled'
|
||||
'flightsql://postgres:[YOUR-PASSWORD]@default.warehouse.supabase.co:443?tls=enabled'
|
||||
)
|
||||
).toBeInTheDocument()
|
||||
expect(screen.getByRole('link', { name: 'Manage Warehouse' })).toHaveAttribute(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import {
|
||||
getDuckLakeSetupScript,
|
||||
@@ -6,6 +6,14 @@ import {
|
||||
type WarehouseCatalogConnection,
|
||||
} from './warehouse'
|
||||
|
||||
const environment = vi.hoisted(() => ({ isStagingOrLocal: false }))
|
||||
vi.mock('@/lib/constants', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('@/lib/constants')>()),
|
||||
get IS_STAGING_OR_LOCAL() {
|
||||
return environment.isStagingOrLocal
|
||||
},
|
||||
}))
|
||||
|
||||
const CREDENTIALS = {
|
||||
data_path: 's3://warehouse/',
|
||||
metadata_schema: 'ducklake',
|
||||
@@ -147,3 +155,22 @@ describe('getDuckLakeSetupScript', () => {
|
||||
expect(script).toContain("METADATA_PATH ''")
|
||||
})
|
||||
})
|
||||
|
||||
describe('Warehouse Flight SQL connections', () => {
|
||||
test.each([
|
||||
{ isStagingOrLocal: false, domain: 'supabase.co' },
|
||||
{ isStagingOrLocal: true, domain: 'supabase.red' },
|
||||
])('uses $domain for every connection format', async ({ isStagingOrLocal, domain }) => {
|
||||
environment.isStagingOrLocal = isStagingOrLocal
|
||||
vi.resetModules()
|
||||
const warehouse = await import('./warehouse')
|
||||
const hostname = `project-ref.warehouse.${domain}`
|
||||
expect(warehouse.getWarehouseFlightSqlEndpoint('project-ref')).toBe(hostname)
|
||||
expect(warehouse.getWarehouseFlightSqlConnectionString('project-ref')).toBe(
|
||||
`flightsql://postgres:[YOUR-PASSWORD]@${hostname}:443?tls=enabled`
|
||||
)
|
||||
expect(warehouse.getWarehouseUsqlCommand('project-ref')).toBe(
|
||||
`usql -X -W 'flightsql://postgres@${hostname}:443?tls=enabled'`
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -3,7 +3,7 @@ import { literal } from '@supabase/pg-meta'
|
||||
import { PASSWORD_PLACEHOLDER } from '@/components/interfaces/ConnectSheet/ConnectionString.utils'
|
||||
import { IS_STAGING_OR_LOCAL } from '@/lib/constants'
|
||||
|
||||
const WAREHOUSE_TLD = IS_STAGING_OR_LOCAL ? 'red' : 'io'
|
||||
const WAREHOUSE_TLD = IS_STAGING_OR_LOCAL ? 'red' : 'co'
|
||||
|
||||
/**
|
||||
* Name of the singleton replication publication (and destination) that Warehouse manages. Its table
|
||||
|
||||
Reference in new issue
Block a user