From fb1c2b1355719de575c31ecc75872ab13b9e0188 Mon Sep 17 00:00:00 2001 From: Travis Jenkins <travis@estuary.dev> Date: Fri, 21 Mar 2025 10:31:11 -0400 Subject: [PATCH 1/4] Adding support to default private data plane if there is only one Marking todos --- src/api/dataPlanes.ts | 2 +- src/stores/DetailsForm/Store.ts | 53 ++++++++++++--------------------- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/api/dataPlanes.ts b/src/api/dataPlanes.ts index 285966eac..2d7bbbf47 100644 --- a/src/api/dataPlanes.ts +++ b/src/api/dataPlanes.ts @@ -35,7 +35,7 @@ const COLUMNS = [ 'cidr_blocks', 'gcp_service_account_email', 'aws_iam_user_arn', - // 'aws_link_endpoints', uncomment after https://github.com/estuary/flow/pull/1816 is done + // 'aws_link_endpoints', TODO uncomment after https://github.com/estuary/flow/pull/1816 is done ]; const QUERY = COLUMNS.join(','); diff --git a/src/stores/DetailsForm/Store.ts b/src/stores/DetailsForm/Store.ts index 0617f3a20..d5eee92fd 100644 --- a/src/stores/DetailsForm/Store.ts +++ b/src/stores/DetailsForm/Store.ts @@ -68,6 +68,25 @@ const getDataPlane = ( return selectedOption; } + // TODO (private data plane) - we need to add support for allowing tenants to configure their + // preferred data plane. + + // If we are not trying to find a specific data plane and there is only one option + // and it is private we are pretty safe in prefilling that one. + if ( + !dataPlaneId && + dataPlaneOptions.length === 1 && + dataPlaneOptions[0].dataPlaneName.whole.includes( + DATA_PLANE_SETTINGS.private.prefix + ) + ) { + logRocketEvent(CustomEvents.DATA_PLANE_SELECTOR, { + defaultedPrivate: true, + }); + return dataPlaneOptions[0]; + } + + // Try to find the default public data plane const defaultOption = dataPlaneOptions.find( ({ dataPlaneName }) => dataPlaneName.whole === @@ -313,10 +332,6 @@ export const getInitialState = ( const dataPlaneResponse = await getDataPlaneOptions(); - logRocketConsole( - 'DetailsFormHydrator>hydrateState>getDataPlaneOptions' - ); - if ( !dataPlaneResponse.error && dataPlaneResponse.data && @@ -326,9 +341,6 @@ export const getInitialState = ( generateDataPlaneOption ); - logRocketConsole( - 'DetailsFormHydrator>hydrateState>setDataPlaneOptions' - ); get().setDataPlaneOptions(dataPlaneOptions); } else { get().setHydrationError( @@ -338,30 +350,10 @@ export const getInitialState = ( } if (createWorkflow) { - logRocketConsole( - 'DetailsFormHydrator>hydrateState>createWorkflow' - ); const connectorImage = await getConnectorImage(connectorId); - logRocketConsole( - 'DetailsFormHydrator>hydrateState>createWorkflow>getConnectorImage', - { - connectorId: connectorImage?.connectorId, - connectorImageId: connectorImage?.id, - } - ); - const dataPlane = getDataPlane(dataPlaneOptions, dataPlaneId); - logRocketConsole( - 'DetailsFormHydrator>hydrateState>createWorkflow>getDataPlane', - { - dataPlaneName: dataPlane?.dataPlaneName, - } - ); if (connectorImage && dataPlane === null) { - logRocketConsole( - 'DetailsFormHydrator>hydrateState>createWorkflow>setDetails_connector' - ); get().setDetails_connector(connectorImage); const { @@ -374,10 +366,6 @@ export const getInitialState = ( errors, }); } else if (connectorImage && dataPlane !== null) { - logRocketConsole( - 'DetailsFormHydrator>hydrateState>createWorkflow>setDetails_connector&setDetails_dataPlane' - ); - get().setDetails_connector(connectorImage); const { @@ -391,9 +379,6 @@ export const getInitialState = ( errors, }); } else { - logRocketConsole( - 'DetailsFormHydrator>hydrateState>createWorkflow>setHydrationErrorsExist' - ); get().setHydrationErrorsExist(true); } } else if (liveSpecId) { From 95abf5db8ed93928f402dcca38849253430117d6 Mon Sep 17 00:00:00 2001 From: Travis Jenkins <travis@estuary.dev> Date: Fri, 21 Mar 2025 11:21:51 -0400 Subject: [PATCH 2/4] Cleaning up logging --- src/components/editor/MonacoEditor/index.tsx | 5 ----- src/stores/DetailsForm/Store.ts | 17 +-------------- src/stores/EndpointConfig/Hydrator.tsx | 7 ------- src/stores/EndpointConfig/Store.ts | 22 -------------------- 4 files changed, 1 insertion(+), 50 deletions(-) diff --git a/src/components/editor/MonacoEditor/index.tsx b/src/components/editor/MonacoEditor/index.tsx index d0042233b..ab304dc65 100644 --- a/src/components/editor/MonacoEditor/index.tsx +++ b/src/components/editor/MonacoEditor/index.tsx @@ -169,11 +169,6 @@ function MonacoEditor({ // Make sure we have all the props needed to update the value if (validValue && catalogName && catalogType) { - logRocketConsole('editor:update:saving', { - processedVal, - catalogName, - catalogType, - }); setStatus(EditorStatus.SAVING, evaluatedPath); // Check if there is a scope to update (ex: Schema editing for bindings editor) diff --git a/src/stores/DetailsForm/Store.ts b/src/stores/DetailsForm/Store.ts index d5eee92fd..1298a2f6e 100644 --- a/src/stores/DetailsForm/Store.ts +++ b/src/stores/DetailsForm/Store.ts @@ -4,7 +4,7 @@ import { getLiveSpecs_detailsForm } from 'api/liveSpecsExt'; import { GlobalSearchParams } from 'hooks/searchParams/useGlobalSearchParams'; import produce from 'immer'; import { isEmpty } from 'lodash'; -import { logRocketConsole, logRocketEvent } from 'services/shared'; +import { logRocketEvent } from 'services/shared'; import { CustomEvents } from 'services/types'; import { DATA_PLANE_SETTINGS } from 'settings/dataPlanes'; import { @@ -39,9 +39,6 @@ const getConnectorImage = async ( connectorId: string, existingImageTag?: ConnectorVersionEvaluationOptions['existingImageTag'] ): Promise<Details['data']['connectorImage'] | null> => { - logRocketConsole('DetailsFormHydrator>getConnectorImage', { - connectorId, - }); const { data, error } = await getConnectors_detailsForm(connectorId); if (!error && data && data.length > 0) { @@ -212,9 +209,6 @@ export const getInitialState = ( set( produce((state: DetailsFormState) => { if (connectorImage.id === '') { - logRocketConsole( - 'DetailsFormHydrator>setDetails_connector>resetting' - ); state.details.data.connectorImage = getInitialStateData().details.data.connectorImage; } else { @@ -318,15 +312,6 @@ export const getInitialState = ( workflow === 'capture_create' || workflow === 'materialization_create'; - logRocketConsole('DetailsFormHydrator>hydrateState', { - connectorId, - createWorkflow, - dataPlaneId, - liveSpecId, - searchParams: searchParams.toString(), - workflow, - }); - if (connectorId) { let dataPlaneOptions: DataPlaneOption[] = []; diff --git a/src/stores/EndpointConfig/Hydrator.tsx b/src/stores/EndpointConfig/Hydrator.tsx index c14e0c446..f613f3134 100644 --- a/src/stores/EndpointConfig/Hydrator.tsx +++ b/src/stores/EndpointConfig/Hydrator.tsx @@ -29,13 +29,6 @@ export const EndpointConfigHydrator = ({ children }: BaseComponentProps) => { const hydrateState = useEndpointConfig_hydrateState(); const setActive = useEndpointConfig_setActive(); - logRocketConsole('EndpointConfigHydrator', { - runHydration: Boolean(runHydration.current), - hydrated, - connectorTagId, - entityType, - }); - useEffect(() => { if ( runHydration.current && diff --git a/src/stores/EndpointConfig/Store.ts b/src/stores/EndpointConfig/Store.ts index abbd4e0a0..746f8a90e 100644 --- a/src/stores/EndpointConfig/Store.ts +++ b/src/stores/EndpointConfig/Store.ts @@ -4,7 +4,6 @@ import { GlobalSearchParams } from 'hooks/searchParams/useGlobalSearchParams'; import produce from 'immer'; import { isEmpty } from 'lodash'; import { createJSONFormDefaults } from 'services/ajv'; -import { logRocketConsole } from 'services/shared'; import { CustomError, fetchErrors, @@ -217,35 +216,14 @@ const getInitialState = ( get().setServerUpdateRequired(true); } - logRocketConsole('EndpointConfigHydrator>hydrateState', { - active: get().active, - }); - if (get().active && connectorTagId && connectorTagId.length > 0) { - logRocketConsole( - 'EndpointConfigHydrator>hydrateState>fetch>getSchema_Endpoint', - { - active: get().active, - } - ); - const { data, error } = await getSchema_Endpoint(connectorTagId); if (error) { - logRocketConsole( - 'EndpointConfigHydrator>hydrateState>fetch>setHydrationErrorsExist', - { - active: get().active, - } - ); get().setHydrationErrorsExist(true); } if (get().active && data) { - logRocketConsole( - 'EndpointConfigHydrator>hydrateState>fetch>setEndpointSchema' - ); - await get().setEndpointSchema( data.endpoint_spec_schema as unknown as Schema ); From 68fb970bb0873b7922d8bd588fab2b634e8ccef2 Mon Sep 17 00:00:00 2001 From: Travis Jenkins <travis@estuary.dev> Date: Fri, 21 Mar 2025 12:07:49 -0400 Subject: [PATCH 3/4] updating package --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0da5ea4b4..b2652c437 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "index.js", "private": true, "engines": { - "node": "20.10.0", - "npm": "10.2.3" + "node": "^20", + "npm": "^10" }, "scripts": { "build": "vite build", From a5f3d4d8959b0badf360db93fc7abe9c1b90cf60 Mon Sep 17 00:00:00 2001 From: Travis Jenkins <travis@estuary.dev> Date: Fri, 21 Mar 2025 12:10:13 -0400 Subject: [PATCH 4/4] updating package --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a53222748..52cdf05bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -126,8 +126,8 @@ "vitest-mock-extended": "^1.3.1" }, "engines": { - "node": "20.10.0", - "npm": "10.2.3" + "node": ">=20", + "npm": "^10" } }, "node_modules/@adobe/css-tools": { diff --git a/package.json b/package.json index b2652c437..ad532cf82 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "private": true, "engines": { - "node": "^20", + "node": ">=20", "npm": "^10" }, "scripts": {