Skip to content

Commit 71775c3

Browse files
authored
refactor(replication): remove useless expire snapshot configuration (supabase#46341)
Remove useless expire snapshot configuration > This is an alpha feature not already deployed to any of our customers so breaking changes are not an issue. Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
1 parent 84d7da4 commit 71775c3

9 files changed

Lines changed: 2 additions & 69 deletions

File tree

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.schema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export const DestinationPanelFormSchema = z.object({
4343
ducklakeS3UrlStyle: z.enum(['path', 'vhost']).optional(),
4444
ducklakeS3UseSsl: z.boolean().optional(),
4545
ducklakeMetadataSchema: z.string().optional(),
46-
ducklakeExpireSnapshotsOlderThan: z.string().optional(),
4746
})
4847

4948
export type DestinationPanelSchemaType = z.infer<typeof DestinationPanelFormSchema>

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const baseDucklakeFormData = {
3535
ducklakeS3UrlStyle: 'path' as const,
3636
ducklakeS3UseSsl: true,
3737
ducklakeMetadataSchema: ' ducklake_metadata ',
38-
ducklakeExpireSnapshotsOlderThan: ' 7 days ',
3938
}
4039

4140
describe('DestinationForm.utils DuckLake', () => {
@@ -46,7 +45,6 @@ describe('DestinationForm.utils DuckLake', () => {
4645
data: {
4746
...baseDucklakeFormData,
4847
ducklakeMetadataSchema: ' ',
49-
ducklakeExpireSnapshotsOlderThan: ' ',
5048
},
5149
})
5250

@@ -62,7 +60,6 @@ describe('DestinationForm.utils DuckLake', () => {
6260
s3UrlStyle: 'path',
6361
s3UseSsl: true,
6462
metadataSchema: undefined,
65-
expireSnapshotsOlderThan: undefined,
6663
},
6764
})
6865
})
@@ -91,7 +88,6 @@ describe('DestinationForm.utils DuckLake', () => {
9188
s3UrlStyle: 'path',
9289
s3UseSsl: true,
9390
metadataSchema: 'ducklake_metadata',
94-
expireSnapshotsOlderThan: '7 days',
9591
},
9692
})
9793
expect(createS3AccessKey).not.toHaveBeenCalled()

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationForm.utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ export const buildDestinationConfigForValidation = ({
176176
s3UrlStyle: data.ducklakeS3UrlStyle,
177177
s3UseSsl: data.ducklakeS3UseSsl,
178178
metadataSchema: normalizeOptionalString(data.ducklakeMetadataSchema),
179-
expireSnapshotsOlderThan: normalizeOptionalString(data.ducklakeExpireSnapshotsOlderThan),
180179
},
181180
}
182181
} else {
@@ -255,7 +254,6 @@ export const buildDestinationConfig = async ({
255254
s3UrlStyle: data.ducklakeS3UrlStyle,
256255
s3UseSsl: data.ducklakeS3UseSsl,
257256
metadataSchema: normalizeOptionalString(data.ducklakeMetadataSchema),
258-
expireSnapshotsOlderThan: normalizeOptionalString(data.ducklakeExpireSnapshotsOlderThan),
259257
}
260258
destinationConfig = { ducklake: ducklakeConfig }
261259
}

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DestinationPanelFields.tsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ export const DuckLakeFields = ({ form }: { form: UseFormReturn<DestinationPanelS
318318
</div>
319319

320320
<div className="flex flex-col gap-y-1">
321-
<p className="text-sm font-medium text-foreground">Maintenance</p>
321+
<p className="text-sm font-medium text-foreground">Metadata</p>
322322
<p className="text-sm text-foreground-light">
323-
Optional settings for DuckLake metadata tables and snapshot cleanup.
323+
Optional schema setting for DuckLake metadata tables.
324324
</p>
325325
</div>
326326

@@ -340,22 +340,6 @@ export const DuckLakeFields = ({ form }: { form: UseFormReturn<DestinationPanelS
340340
</FormItemLayout>
341341
)}
342342
/>
343-
344-
<FormField
345-
control={form.control}
346-
name="ducklakeExpireSnapshotsOlderThan"
347-
render={({ field }) => (
348-
<FormItemLayout
349-
layout="horizontal"
350-
label="Expire snapshots older than"
351-
description="Optional snapshot retention interval, for example `7 days`"
352-
>
353-
<FormControl>
354-
<Input {...field} placeholder="7 days" value={field.value ?? ''} />
355-
</FormControl>
356-
</FormItemLayout>
357-
)}
358-
/>
359343
</div>
360344
</div>
361345
)

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ type DucklakeApiConfig = {
8484
s3_url_style?: 'path' | 'vhost'
8585
s3_use_ssl?: boolean
8686
metadata_schema?: string
87-
expire_snapshots_older_than?: string
8887
}
8988

9089
export const DestinationForm = ({
@@ -237,7 +236,6 @@ export const DestinationForm = ({
237236
ducklakeS3UrlStyle: ducklakeConfig?.s3_url_style ?? 'path',
238237
ducklakeS3UseSsl: ducklakeConfig?.s3_use_ssl ?? true,
239238
ducklakeMetadataSchema: ducklakeConfig?.metadata_schema ?? 'ducklake',
240-
ducklakeExpireSnapshotsOlderThan: ducklakeConfig?.expire_snapshots_older_than ?? '',
241239
}
242240
}, [destinationData, pipelineData, catalogToken, projectSettings])
243241

apps/studio/data/replication/create-destination-pipeline-mutation.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export type DucklakeDestinationConfig = {
4646
s3UrlStyle?: 'path' | 'vhost'
4747
s3UseSsl?: boolean
4848
metadataSchema?: string
49-
expireSnapshotsOlderThan?: string
5049
}
5150

5251
export type BatchConfig = {
@@ -137,7 +136,6 @@ async function createDestinationPipeline(
137136
s3UrlStyle,
138137
s3UseSsl,
139138
metadataSchema,
140-
expireSnapshotsOlderThan,
141139
} = destinationConfig.ducklake
142140

143141
destination_config = {
@@ -152,7 +150,6 @@ async function createDestinationPipeline(
152150
s3_url_style: s3UrlStyle,
153151
s3_use_ssl: s3UseSsl,
154152
metadata_schema: metadataSchema,
155-
expire_snapshots_older_than: expireSnapshotsOlderThan,
156153
},
157154
} as unknown as components['schemas']['CreateReplicationDestinationPipelineBody']['destination_config']
158155
} else {

apps/studio/data/replication/update-destination-pipeline-mutation.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ async function updateDestinationPipeline(
9393
s3UrlStyle,
9494
s3UseSsl,
9595
metadataSchema,
96-
expireSnapshotsOlderThan,
9796
} = destinationConfig.ducklake
9897
destination_config = {
9998
ducklake: {
@@ -107,7 +106,6 @@ async function updateDestinationPipeline(
107106
s3_url_style: s3UrlStyle,
108107
s3_use_ssl: s3UseSsl,
109108
metadata_schema: metadataSchema,
110-
expire_snapshots_older_than: expireSnapshotsOlderThan,
111109
},
112110
} as unknown as components['schemas']['UpdateReplicationDestinationPipelineBody']['destination_config']
113111
} else {

apps/studio/data/replication/validate-destination-mutation.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ async function validateDestination(
7171
s3UrlStyle,
7272
s3UseSsl,
7373
metadataSchema,
74-
expireSnapshotsOlderThan,
7574
} = destinationConfig.ducklake
7675

7776
config = {
@@ -86,7 +85,6 @@ async function validateDestination(
8685
s3_url_style: s3UrlStyle,
8786
s3_use_ssl: s3UseSsl,
8887
metadata_schema: metadataSchema,
89-
expire_snapshots_older_than: expireSnapshotsOlderThan,
9088
},
9189
} as unknown as components['schemas']['ValidateReplicationDestinationBody']['config']
9290
} else {

packages/api-types/types/platform.d.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5732,11 +5732,6 @@ export interface components {
57325732
* @example s3://<bucket-name>/
57335733
*/
57345734
data_path: string
5735-
/**
5736-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
5737-
* @example 7 days
5738-
*/
5739-
expire_snapshots_older_than?: string
57405735
/**
57415736
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
57425737
* @default ducklake
@@ -5870,11 +5865,6 @@ export interface components {
58705865
* @example s3://<bucket-name>/
58715866
*/
58725867
data_path: string
5873-
/**
5874-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
5875-
* @example 7 days
5876-
*/
5877-
expire_snapshots_older_than?: string
58785868
/**
58795869
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
58805870
* @default ducklake
@@ -9393,11 +9383,6 @@ export interface components {
93939383
* @example s3://<bucket-name>/
93949384
*/
93959385
data_path: string
9396-
/**
9397-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
9398-
* @example 7 days
9399-
*/
9400-
expire_snapshots_older_than?: string
94019386
/**
94029387
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
94039388
* @default ducklake
@@ -9543,11 +9528,6 @@ export interface components {
95439528
* @example s3://<bucket-name>/
95449529
*/
95459530
data_path: string
9546-
/**
9547-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
9548-
* @example 7 days
9549-
*/
9550-
expire_snapshots_older_than?: string
95519531
/**
95529532
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
95539533
* @default ducklake
@@ -11384,11 +11364,6 @@ export interface components {
1138411364
* @example s3://<bucket-name>/
1138511365
*/
1138611366
data_path: string
11387-
/**
11388-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
11389-
* @example 7 days
11390-
*/
11391-
expire_snapshots_older_than?: string
1139211367
/**
1139311368
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
1139411369
* @default ducklake
@@ -11522,11 +11497,6 @@ export interface components {
1152211497
* @example s3://<bucket-name>/
1152311498
*/
1152411499
data_path: string
11525-
/**
11526-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
11527-
* @example 7 days
11528-
*/
11529-
expire_snapshots_older_than?: string
1153011500
/**
1153111501
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
1153211502
* @default ducklake
@@ -12071,11 +12041,6 @@ export interface components {
1207112041
* @example s3://<bucket-name>/
1207212042
*/
1207312043
data_path: string
12074-
/**
12075-
* @description DuckLake snapshot retention interval (format: https://duckdb.org/docs/current/sql/data_types/interval)
12076-
* @example 7 days
12077-
*/
12078-
expire_snapshots_older_than?: string
1207912044
/**
1208012045
* @description Schema used for DuckLake metadata tables stored in PostgreSQL
1208112046
* @default ducklake

0 commit comments

Comments
 (0)