Skip to content

Commit 42da69c

Browse files
committed
prefix integration config types with "legacy" to differentiate from new
1 parent 7f345c3 commit 42da69c

File tree

7 files changed

+42
-40
lines changed

7 files changed

+42
-40
lines changed

src/notebooks/deepnote/integrations/integrationDetector.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE,
88
IntegrationStatus,
99
IntegrationWithStatus,
10-
RawIntegrationType
10+
RawLegacyIntegrationType
1111
} from '../../../platform/notebooks/deepnote/integrationTypes';
1212
import { IIntegrationDetector, IIntegrationStorage } from './types';
1313

@@ -54,7 +54,8 @@ export class IntegrationDetector implements IIntegrationDetector {
5454
logger.debug(`IntegrationDetector: Found integration: ${integrationId} (${projectIntegration.type})`);
5555

5656
// Map the Deepnote integration type to our IntegrationType
57-
const integrationType = DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE[projectIntegration.type as RawIntegrationType];
57+
const integrationType =
58+
DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE[projectIntegration.type as RawLegacyIntegrationType];
5859

5960
// Skip unknown integration types
6061
if (!integrationType) {

src/notebooks/deepnote/integrations/integrationManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
IntegrationStatus,
1111
LegacyIntegrationType,
1212
IntegrationWithStatus,
13-
RawIntegrationType
13+
RawLegacyIntegrationType
1414
} from '../../../platform/notebooks/deepnote/integrationTypes';
1515
import { BlockWithIntegration, scanBlocksForIntegrations } from './integrationUtils';
1616
import { IDeepnoteNotebookManager } from '../../types';
@@ -173,7 +173,7 @@ export class IntegrationManager implements IIntegrationManager {
173173
if (projectIntegration.type in DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE) {
174174
// Map the Deepnote integration type to our IntegrationType
175175
integrationType =
176-
DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE[projectIntegration.type as RawIntegrationType];
176+
DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE[projectIntegration.type as RawLegacyIntegrationType];
177177
} else {
178178
logger.warn(
179179
`IntegrationManager: Unknown integration type '${projectIntegration.type}' for integration ID '${selectedIntegrationId}' in project '${projectId}'. Integration type will be undefined.`

src/notebooks/deepnote/integrations/integrationWebview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
LegacyIntegrationConfig,
1414
IntegrationStatus,
1515
IntegrationWithStatus,
16-
RawIntegrationType
16+
RawLegacyIntegrationType
1717
} from '../../../platform/notebooks/deepnote/integrationTypes';
1818

1919
/**
@@ -357,7 +357,7 @@ export class IntegrationWebviewProvider implements IIntegrationWebviewProvider {
357357
}
358358

359359
// Map to Deepnote integration type
360-
const deepnoteType: RawIntegrationType | undefined = LEGACY_INTEGRATION_TYPE_TO_DEEPNOTE[type];
360+
const deepnoteType: RawLegacyIntegrationType | undefined = LEGACY_INTEGRATION_TYPE_TO_DEEPNOTE[type];
361361
if (!deepnoteType) {
362362
logger.warn(`IntegrationWebviewProvider: Cannot map type ${type} for integration ${id}, skipping`);
363363
return null;

src/notebooks/deepnote/sqlCellStatusBarProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
DATAFRAME_SQL_INTEGRATION_ID,
2727
DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE,
2828
LegacyIntegrationType,
29-
RawIntegrationType
29+
RawLegacyIntegrationType
3030
} from '../../platform/notebooks/deepnote/integrationTypes';
3131
import { IDeepnoteNotebookManager } from '../types';
3232

@@ -347,7 +347,8 @@ export class SqlCellStatusBarProvider implements NotebookCellStatusBarItemProvid
347347
continue;
348348
}
349349

350-
const integrationType = DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE[projectIntegration.type as RawIntegrationType];
350+
const integrationType =
351+
DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE[projectIntegration.type as RawLegacyIntegrationType];
351352
const typeLabel = integrationType ? this.getIntegrationTypeLabel(integrationType) : projectIntegration.type;
352353

353354
const item: LocalQuickPickItem = {

src/platform/notebooks/deepnote/integrationTypes.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ export const LEGACY_INTEGRATION_TYPE_TO_DEEPNOTE = {
2424
[LegacyIntegrationType.Snowflake]: 'snowflake'
2525
} as const satisfies { [type in Exclude<LegacyIntegrationType, LegacyIntegrationType.DuckDB>]: string };
2626

27-
export type RawIntegrationType =
27+
export type RawLegacyIntegrationType =
2828
(typeof LEGACY_INTEGRATION_TYPE_TO_DEEPNOTE)[keyof typeof LEGACY_INTEGRATION_TYPE_TO_DEEPNOTE];
2929

3030
/**
3131
* Map Deepnote integration type strings to our IntegrationType enum
3232
*/
33-
export const DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE: Record<RawIntegrationType, LegacyIntegrationType> = {
33+
export const DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE: Record<RawLegacyIntegrationType, LegacyIntegrationType> = {
3434
pgsql: LegacyIntegrationType.Postgres,
3535
'big-query': LegacyIntegrationType.BigQuery,
3636
snowflake: LegacyIntegrationType.Snowflake
@@ -39,7 +39,7 @@ export const DEEPNOTE_TO_LEGACY_INTEGRATION_TYPE: Record<RawIntegrationType, Leg
3939
/**
4040
* Base interface for all integration configurations
4141
*/
42-
export interface BaseIntegrationConfig {
42+
export interface BaseLegacyIntegrationConfig {
4343
id: string;
4444
name: string;
4545
type: LegacyIntegrationType;
@@ -48,7 +48,7 @@ export interface BaseIntegrationConfig {
4848
/**
4949
* PostgreSQL integration configuration
5050
*/
51-
export interface PostgresIntegrationConfig extends BaseIntegrationConfig {
51+
export interface LegacyPostgresIntegrationConfig extends BaseLegacyIntegrationConfig {
5252
type: LegacyIntegrationType.Postgres;
5353
host: string;
5454
port: number;
@@ -61,7 +61,7 @@ export interface PostgresIntegrationConfig extends BaseIntegrationConfig {
6161
/**
6262
* BigQuery integration configuration
6363
*/
64-
export interface BigQueryIntegrationConfig extends BaseIntegrationConfig {
64+
export interface LegacyBigQueryIntegrationConfig extends BaseLegacyIntegrationConfig {
6565
type: LegacyIntegrationType.BigQuery;
6666
projectId: string;
6767
credentials: string; // JSON string of service account credentials
@@ -70,7 +70,7 @@ export interface BigQueryIntegrationConfig extends BaseIntegrationConfig {
7070
/**
7171
* DuckDB integration configuration (internal, always available)
7272
*/
73-
export interface DuckDBIntegrationConfig extends BaseIntegrationConfig {
73+
export interface LegacyDuckDBIntegrationConfig extends BaseLegacyIntegrationConfig {
7474
type: LegacyIntegrationType.DuckDB;
7575
}
7676

@@ -91,7 +91,7 @@ export {
9191
/**
9292
* Base Snowflake configuration with common fields
9393
*/
94-
interface BaseSnowflakeConfig extends BaseIntegrationConfig {
94+
interface BaseLegacySnowflakeConfig extends BaseLegacyIntegrationConfig {
9595
type: LegacyIntegrationType.Snowflake;
9696
account: string;
9797
warehouse?: string;
@@ -102,7 +102,7 @@ interface BaseSnowflakeConfig extends BaseIntegrationConfig {
102102
/**
103103
* Snowflake integration configuration (discriminated union)
104104
*/
105-
export type SnowflakeIntegrationConfig = BaseSnowflakeConfig &
105+
export type LegacySnowflakeIntegrationConfig = BaseLegacySnowflakeConfig &
106106
(
107107
| {
108108
authMethod: typeof SnowflakeAuthMethods.PASSWORD | null;
@@ -130,10 +130,10 @@ export type SnowflakeIntegrationConfig = BaseSnowflakeConfig &
130130
* Union type of all integration configurations
131131
*/
132132
export type LegacyIntegrationConfig =
133-
| PostgresIntegrationConfig
134-
| BigQueryIntegrationConfig
135-
| SnowflakeIntegrationConfig
136-
| DuckDBIntegrationConfig;
133+
| LegacyPostgresIntegrationConfig
134+
| LegacyBigQueryIntegrationConfig
135+
| LegacySnowflakeIntegrationConfig
136+
| LegacyDuckDBIntegrationConfig;
137137

138138
/**
139139
* Integration connection status

src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
LegacyIntegrationConfig,
1616
LegacyIntegrationType,
1717
SnowflakeAuthMethods,
18-
DuckDBIntegrationConfig,
18+
LegacyDuckDBIntegrationConfig,
1919
DATAFRAME_SQL_INTEGRATION_ID
2020
} from './integrationTypes';
2121

src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { IntegrationStorage } from './integrationStorage';
77
import { SqlIntegrationEnvironmentVariablesProvider } from './sqlIntegrationEnvironmentVariablesProvider';
88
import {
99
LegacyIntegrationType,
10-
PostgresIntegrationConfig,
11-
BigQueryIntegrationConfig,
12-
SnowflakeIntegrationConfig,
10+
LegacyPostgresIntegrationConfig,
11+
LegacyBigQueryIntegrationConfig,
12+
LegacySnowflakeIntegrationConfig,
1313
SnowflakeAuthMethods
1414
} from './integrationTypes';
1515
import { IPlatformNotebookEditorProvider, IPlatformDeepnoteNotebookManager } from './types';
@@ -131,7 +131,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
131131
test('Returns environment variable for PostgreSQL integration', async () => {
132132
const uri = Uri.file('/test/notebook.deepnote');
133133
const integrationId = 'my-postgres-db';
134-
const config: PostgresIntegrationConfig = {
134+
const config: LegacyPostgresIntegrationConfig = {
135135
id: integrationId,
136136
name: 'My Postgres DB',
137137
type: LegacyIntegrationType.Postgres,
@@ -164,7 +164,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
164164
const uri = Uri.file('/test/notebook.deepnote');
165165
const integrationId = 'my-bigquery';
166166
const serviceAccountJson = JSON.stringify({ type: 'service_account', project_id: 'my-project' });
167-
const config: BigQueryIntegrationConfig = {
167+
const config: LegacyBigQueryIntegrationConfig = {
168168
id: integrationId,
169169
name: 'My BigQuery',
170170
type: LegacyIntegrationType.BigQuery,
@@ -197,7 +197,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
197197
const postgresId = 'my-postgres-db';
198198
const bigqueryId = 'my-bigquery';
199199

200-
const postgresConfig: PostgresIntegrationConfig = {
200+
const postgresConfig: LegacyPostgresIntegrationConfig = {
201201
id: postgresId,
202202
name: 'My Postgres DB',
203203
type: LegacyIntegrationType.Postgres,
@@ -208,7 +208,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
208208
password: 'pass'
209209
};
210210

211-
const bigqueryConfig: BigQueryIntegrationConfig = {
211+
const bigqueryConfig: LegacyBigQueryIntegrationConfig = {
212212
id: bigqueryId,
213213
name: 'My BigQuery',
214214
type: LegacyIntegrationType.BigQuery,
@@ -238,7 +238,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
238238
test('Properly encodes special characters in PostgreSQL credentials', async () => {
239239
const uri = Uri.file('/test/notebook.deepnote');
240240
const integrationId = 'special-chars-db';
241-
const config: PostgresIntegrationConfig = {
241+
const config: LegacyPostgresIntegrationConfig = {
242242
id: integrationId,
243243
name: 'Special Chars DB',
244244
type: LegacyIntegrationType.Postgres,
@@ -275,7 +275,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
275275
test('Normalizes integration ID with spaces and mixed case for env var name', async () => {
276276
const uri = Uri.file('/test/notebook.deepnote');
277277
const integrationId = 'My Production DB';
278-
const config: PostgresIntegrationConfig = {
278+
const config: LegacyPostgresIntegrationConfig = {
279279
id: integrationId,
280280
name: 'Production Database',
281281
type: LegacyIntegrationType.Postgres,
@@ -308,7 +308,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
308308
test('Normalizes integration ID with special characters for env var name', async () => {
309309
const uri = Uri.file('/test/notebook.deepnote');
310310
const integrationId = 'my-db@2024!';
311-
const config: PostgresIntegrationConfig = {
311+
const config: LegacyPostgresIntegrationConfig = {
312312
id: integrationId,
313313
name: 'Test DB',
314314
type: LegacyIntegrationType.Postgres,
@@ -348,7 +348,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
348348
test('Returns environment variable for Snowflake with PASSWORD auth', async () => {
349349
const uri = Uri.file('/test/notebook.deepnote');
350350
const integrationId = 'my-snowflake';
351-
const config: SnowflakeIntegrationConfig = {
351+
const config: LegacySnowflakeIntegrationConfig = {
352352
id: integrationId,
353353
name: 'My Snowflake',
354354
type: LegacyIntegrationType.Snowflake,
@@ -383,7 +383,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
383383
test('Returns environment variable for Snowflake with legacy null auth (username+password)', async () => {
384384
const uri = Uri.file('/test/notebook.deepnote');
385385
const integrationId = 'legacy-snowflake';
386-
const config: SnowflakeIntegrationConfig = {
386+
const config: LegacySnowflakeIntegrationConfig = {
387387
id: integrationId,
388388
name: 'Legacy Snowflake',
389389
type: LegacyIntegrationType.Snowflake,
@@ -418,7 +418,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
418418
const integrationId = 'snowflake-keypair';
419419
const privateKey =
420420
'-----BEGIN ' + 'PRIVATE KEY-----\nfakekey-MIIEvQIBADANBg...\n-----END ' + 'PRIVATE KEY-----';
421-
const config: SnowflakeIntegrationConfig = {
421+
const config: LegacySnowflakeIntegrationConfig = {
422422
id: integrationId,
423423
name: 'Snowflake KeyPair',
424424
type: LegacyIntegrationType.Snowflake,
@@ -459,7 +459,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
459459
const integrationId = 'snowflake-keypair-no-pass';
460460
const privateKey =
461461
'-----BEGIN ' + 'PRIVATE KEY-----\nfakekey-MIIEvQIBADANBg...\n-----END ' + 'PRIVATE KEY-----';
462-
const config: SnowflakeIntegrationConfig = {
462+
const config: LegacySnowflakeIntegrationConfig = {
463463
id: integrationId,
464464
name: 'Snowflake KeyPair No Pass',
465465
type: LegacyIntegrationType.Snowflake,
@@ -496,7 +496,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
496496
test('Properly encodes special characters in Snowflake credentials', async () => {
497497
const uri = Uri.file('/test/notebook.deepnote');
498498
const integrationId = 'snowflake-special';
499-
const config: SnowflakeIntegrationConfig = {
499+
const config: LegacySnowflakeIntegrationConfig = {
500500
id: integrationId,
501501
name: 'Snowflake Special',
502502
type: LegacyIntegrationType.Snowflake,
@@ -530,7 +530,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
530530
test('Handles Snowflake with minimal optional fields', async () => {
531531
const uri = Uri.file('/test/notebook.deepnote');
532532
const integrationId = 'snowflake-minimal';
533-
const config: SnowflakeIntegrationConfig = {
533+
const config: LegacySnowflakeIntegrationConfig = {
534534
id: integrationId,
535535
name: 'Snowflake Minimal',
536536
type: LegacyIntegrationType.Snowflake,
@@ -559,7 +559,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
559559
test('Skips unsupported Snowflake auth method (OKTA)', async () => {
560560
const uri = Uri.file('/test/notebook.deepnote');
561561
const integrationId = 'snowflake-okta';
562-
const config: SnowflakeIntegrationConfig = {
562+
const config: LegacySnowflakeIntegrationConfig = {
563563
id: integrationId,
564564
name: 'Snowflake OKTA',
565565
type: LegacyIntegrationType.Snowflake,
@@ -582,7 +582,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
582582
test('Skips unsupported Snowflake auth method (AZURE_AD)', async () => {
583583
const uri = Uri.file('/test/notebook.deepnote');
584584
const integrationId = 'snowflake-azure';
585-
const config: SnowflakeIntegrationConfig = {
585+
const config: LegacySnowflakeIntegrationConfig = {
586586
id: integrationId,
587587
name: 'Snowflake Azure',
588588
type: LegacyIntegrationType.Snowflake,
@@ -604,7 +604,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
604604
test('Skips unsupported Snowflake auth method (KEY_PAIR)', async () => {
605605
const uri = Uri.file('/test/notebook.deepnote');
606606
const integrationId = 'snowflake-keypair-user';
607-
const config: SnowflakeIntegrationConfig = {
607+
const config: LegacySnowflakeIntegrationConfig = {
608608
id: integrationId,
609609
name: 'Snowflake KeyPair User',
610610
type: LegacyIntegrationType.Snowflake,

0 commit comments

Comments
 (0)