@finos/legend-application-studio 28.21.45 → 28.21.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendStudioEvent.d.ts +63 -1
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +90 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +655 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +709 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.d.ts +30 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.d.ts.map +1 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.js +43 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.js.map +1 -0
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts +4 -3
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +90 -36
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +154 -35
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js +4 -6
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +31 -7
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +4 -8
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.js +15 -0
- package/lib/components/editor/side-bar/WorkflowManager.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +17 -1
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +2 -0
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +12 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts +18 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.js +90 -1
- package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
- package/lib/stores/editor/EditorTabTelemetryHelper.d.ts +31 -0
- package/lib/stores/editor/EditorTabTelemetryHelper.d.ts.map +1 -0
- package/lib/stores/editor/EditorTabTelemetryHelper.js +55 -0
- package/lib/stores/editor/EditorTabTelemetryHelper.js.map +1 -0
- package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.js +22 -1
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/LegendAISuggestTelemetry.d.ts +143 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.d.ts.map +1 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.js +376 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.js.map +1 -0
- package/lib/stores/editor/LegendSQLStudioPlaygroundState.js +3 -3
- package/lib/stores/editor/LegendSQLStudioPlaygroundState.js.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts +14 -3
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.js +42 -5
- package/lib/stores/editor/editor-state/GraphGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/ModelImporterState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/ModelImporterState.js +2 -1
- package/lib/stores/editor/editor-state/ModelImporterState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.js +14 -0
- package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts +35 -6
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js +74 -29
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.d.ts +5 -0
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.js +13 -0
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +5 -5
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +12 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +60 -14
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts +5 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js +13 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +21 -2
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.d.ts +5 -0
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.js +13 -0
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +34 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +48 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +5 -11
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +3 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +46 -17
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +110 -16
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +2 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +10 -4
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js +40 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/LocalChangesState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/LocalChangesState.js +1 -0
- package/lib/stores/editor/sidebar-state/LocalChangesState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js +51 -0
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts +14 -0
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js +132 -27
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js +41 -0
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js +71 -9
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.d.ts +12 -2
- package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.js +28 -28
- package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +2 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js +13 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts +20 -2
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js +38 -4
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.js +45 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js +48 -4
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
- package/package.json +9 -9
- package/src/__lib__/LegendStudioEvent.ts +102 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +1769 -311
- package/src/components/editor/editor-group/LegendAISuggestTelemetryHooks.ts +57 -0
- package/src/components/editor/editor-group/RuntimeEditor.tsx +282 -132
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +293 -106
- package/src/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.ts +3 -13
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +41 -23
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +5 -11
- package/src/components/editor/side-bar/WorkflowManager.tsx +24 -0
- package/src/index.ts +17 -1
- package/src/stores/editor/EditorGraphState.ts +30 -1
- package/src/stores/editor/EditorStore.ts +22 -0
- package/src/stores/editor/EditorTabManagerState.ts +128 -1
- package/src/stores/editor/EditorTabTelemetryHelper.ts +70 -0
- package/src/stores/editor/GraphEditFormModeState.ts +35 -1
- package/src/stores/editor/LegendAISuggestTelemetry.ts +592 -0
- package/src/stores/editor/LegendSQLStudioPlaygroundState.ts +3 -3
- package/src/stores/editor/editor-state/GraphGenerationState.ts +68 -9
- package/src/stores/editor/editor-state/ModelImporterState.ts +2 -0
- package/src/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.ts +30 -0
- package/src/stores/editor/editor-state/element-editor-state/RuntimeEditorState.ts +92 -31
- package/src/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.ts +17 -0
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +6 -6
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +75 -17
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.ts +17 -0
- package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +27 -2
- package/src/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.ts +17 -0
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +57 -0
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +74 -0
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +22 -21
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +9 -0
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +78 -21
- package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +205 -18
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +38 -3
- package/src/stores/editor/sidebar-state/BulkServiceRegistrationState.ts +71 -1
- package/src/stores/editor/sidebar-state/LocalChangesState.ts +4 -0
- package/src/stores/editor/sidebar-state/ProjectOverviewState.ts +114 -0
- package/src/stores/editor/sidebar-state/WorkflowManagerState.ts +250 -29
- package/src/stores/editor/sidebar-state/WorkspaceReviewState.ts +84 -0
- package/src/stores/editor/sidebar-state/testable/GlobalTestRunnerState.ts +124 -17
- package/src/stores/editor/utils/MockDataUtils.ts +33 -32
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +18 -0
- package/src/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.ts +62 -7
- package/src/stores/project-reviewer/ProjectReviewerStore.ts +97 -0
- package/src/stores/workspace-setup/WorkspaceSetupStore.ts +87 -4
- package/tsconfig.json +3 -0
|
@@ -25,6 +25,11 @@ import {
|
|
|
25
25
|
import type { EditorStore } from '../EditorStore.js';
|
|
26
26
|
import type { EditorSDLCState } from '../EditorSDLCState.js';
|
|
27
27
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
|
|
28
|
+
import {
|
|
29
|
+
LegendStudioTelemetryHelper,
|
|
30
|
+
SDLC_REVIEW_ACTION,
|
|
31
|
+
SDLC_REVIEW_ROLE,
|
|
32
|
+
} from '../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
28
33
|
import { LegendStudioUserDataHelper } from '../../../__lib__/LegendStudioUserDataHelper.js';
|
|
29
34
|
import {
|
|
30
35
|
type GeneratorFn,
|
|
@@ -287,6 +292,22 @@ export class WorkspaceReviewState {
|
|
|
287
292
|
return;
|
|
288
293
|
}
|
|
289
294
|
this.isClosingWorkspaceReview = true;
|
|
295
|
+
const startTime = Date.now();
|
|
296
|
+
const reviewId = this.workspaceReview.id;
|
|
297
|
+
const sourceInfo = this.editorStore.editorMode.getSourceInfo();
|
|
298
|
+
const identity = {
|
|
299
|
+
action: SDLC_REVIEW_ACTION.CLOSE,
|
|
300
|
+
role: SDLC_REVIEW_ROLE.AUTHOR,
|
|
301
|
+
projectId: this.sdlcState.activeProject.projectId,
|
|
302
|
+
patchReleaseVersionId:
|
|
303
|
+
this.sdlcState.activePatch?.patchReleaseVersionId.id,
|
|
304
|
+
reviewId,
|
|
305
|
+
};
|
|
306
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionLaunched(
|
|
307
|
+
this.editorStore.applicationStore.telemetryService,
|
|
308
|
+
sourceInfo,
|
|
309
|
+
identity,
|
|
310
|
+
);
|
|
290
311
|
try {
|
|
291
312
|
yield this.editorStore.sdlcServerClient.rejectReview(
|
|
292
313
|
this.sdlcState.activeProject.projectId,
|
|
@@ -294,12 +315,22 @@ export class WorkspaceReviewState {
|
|
|
294
315
|
this.workspaceReview.id,
|
|
295
316
|
);
|
|
296
317
|
this.workspaceReview = undefined;
|
|
318
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionSucceeded(
|
|
319
|
+
this.editorStore.applicationStore.telemetryService,
|
|
320
|
+
sourceInfo,
|
|
321
|
+
{ ...identity, durationMs: Date.now() - startTime },
|
|
322
|
+
);
|
|
297
323
|
} catch (error) {
|
|
298
324
|
assertErrorThrown(error);
|
|
299
325
|
this.editorStore.applicationStore.logService.error(
|
|
300
326
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
|
|
301
327
|
error,
|
|
302
328
|
);
|
|
329
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionFailure(
|
|
330
|
+
this.editorStore.applicationStore.telemetryService,
|
|
331
|
+
sourceInfo,
|
|
332
|
+
{ ...identity, errorMessage: error.message },
|
|
333
|
+
);
|
|
303
334
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
304
335
|
} finally {
|
|
305
336
|
this.isClosingWorkspaceReview = false;
|
|
@@ -332,6 +363,20 @@ export class WorkspaceReviewState {
|
|
|
332
363
|
return;
|
|
333
364
|
}
|
|
334
365
|
this.isCreatingWorkspaceReview = true;
|
|
366
|
+
const startTime = Date.now();
|
|
367
|
+
const sourceInfo = this.editorStore.editorMode.getSourceInfo();
|
|
368
|
+
const identity = {
|
|
369
|
+
action: SDLC_REVIEW_ACTION.CREATE,
|
|
370
|
+
role: SDLC_REVIEW_ROLE.AUTHOR,
|
|
371
|
+
projectId: this.sdlcState.activeProject.projectId,
|
|
372
|
+
patchReleaseVersionId:
|
|
373
|
+
this.sdlcState.activePatch?.patchReleaseVersionId.id,
|
|
374
|
+
};
|
|
375
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionLaunched(
|
|
376
|
+
this.editorStore.applicationStore.telemetryService,
|
|
377
|
+
sourceInfo,
|
|
378
|
+
identity,
|
|
379
|
+
);
|
|
335
380
|
try {
|
|
336
381
|
const description =
|
|
337
382
|
reviewDescription ??
|
|
@@ -348,12 +393,26 @@ export class WorkspaceReviewState {
|
|
|
348
393
|
},
|
|
349
394
|
)) as PlainObject<Review>,
|
|
350
395
|
);
|
|
396
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionSucceeded(
|
|
397
|
+
this.editorStore.applicationStore.telemetryService,
|
|
398
|
+
sourceInfo,
|
|
399
|
+
{
|
|
400
|
+
...identity,
|
|
401
|
+
reviewId: this.workspaceReview.id,
|
|
402
|
+
durationMs: Date.now() - startTime,
|
|
403
|
+
},
|
|
404
|
+
);
|
|
351
405
|
} catch (error) {
|
|
352
406
|
assertErrorThrown(error);
|
|
353
407
|
this.editorStore.applicationStore.logService.error(
|
|
354
408
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
|
|
355
409
|
error,
|
|
356
410
|
);
|
|
411
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionFailure(
|
|
412
|
+
this.editorStore.applicationStore.telemetryService,
|
|
413
|
+
sourceInfo,
|
|
414
|
+
{ ...identity, errorMessage: error.message },
|
|
415
|
+
);
|
|
357
416
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
358
417
|
} finally {
|
|
359
418
|
this.isCreatingWorkspaceReview = false;
|
|
@@ -396,6 +455,21 @@ export class WorkspaceReviewState {
|
|
|
396
455
|
return;
|
|
397
456
|
}
|
|
398
457
|
|
|
458
|
+
const startTime = Date.now();
|
|
459
|
+
const sourceInfo = this.editorStore.editorMode.getSourceInfo();
|
|
460
|
+
const identity = {
|
|
461
|
+
action: SDLC_REVIEW_ACTION.COMMIT,
|
|
462
|
+
role: SDLC_REVIEW_ROLE.AUTHOR,
|
|
463
|
+
projectId: this.sdlcState.activeProject.projectId,
|
|
464
|
+
patchReleaseVersionId:
|
|
465
|
+
this.sdlcState.activePatch?.patchReleaseVersionId.id,
|
|
466
|
+
reviewId: review.id,
|
|
467
|
+
};
|
|
468
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionLaunched(
|
|
469
|
+
this.editorStore.applicationStore.telemetryService,
|
|
470
|
+
sourceInfo,
|
|
471
|
+
identity,
|
|
472
|
+
);
|
|
399
473
|
try {
|
|
400
474
|
yield this.editorStore.sdlcServerClient.commitReview(
|
|
401
475
|
this.sdlcState.activeProject.projectId,
|
|
@@ -403,6 +477,11 @@ export class WorkspaceReviewState {
|
|
|
403
477
|
review.id,
|
|
404
478
|
{ message: `${review.title} [review]` },
|
|
405
479
|
);
|
|
480
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionSucceeded(
|
|
481
|
+
this.editorStore.applicationStore.telemetryService,
|
|
482
|
+
sourceInfo,
|
|
483
|
+
{ ...identity, durationMs: Date.now() - startTime },
|
|
484
|
+
);
|
|
406
485
|
// Committing a review deletes the workspace on SDLC. Drop it from
|
|
407
486
|
// the recents cache so the workspace setup screen doesn't keep
|
|
408
487
|
// offering a dead link. Patch workspaces are never cached.
|
|
@@ -452,6 +531,11 @@ export class WorkspaceReviewState {
|
|
|
452
531
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
|
|
453
532
|
error,
|
|
454
533
|
);
|
|
534
|
+
LegendStudioTelemetryHelper.logEvent_SdlcReviewActionFailure(
|
|
535
|
+
this.editorStore.applicationStore.telemetryService,
|
|
536
|
+
sourceInfo,
|
|
537
|
+
{ ...identity, errorMessage: error.message },
|
|
538
|
+
);
|
|
455
539
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
456
540
|
} finally {
|
|
457
541
|
this.isCommittingWorkspaceReview = false;
|
|
@@ -54,6 +54,14 @@ import type {
|
|
|
54
54
|
} from '../../../LegendStudioApplicationPlugin.js';
|
|
55
55
|
import { ServiceEditorState } from '../../editor-state/element-editor-state/service/ServiceEditorState.js';
|
|
56
56
|
import { LegendStudioUserDataHelper } from '../../../../__lib__/LegendStudioUserDataHelper.js';
|
|
57
|
+
import {
|
|
58
|
+
GLOBAL_TEST_RUN_SCOPE,
|
|
59
|
+
LegendStudioTelemetryHelper,
|
|
60
|
+
TESTABLE_RUN_MODE,
|
|
61
|
+
getTestableKind,
|
|
62
|
+
getTestablePath,
|
|
63
|
+
summarizeTestResults,
|
|
64
|
+
} from '../../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
57
65
|
|
|
58
66
|
// Testable Metadata
|
|
59
67
|
export interface TestableMetadata {
|
|
@@ -456,6 +464,10 @@ export class TestableState {
|
|
|
456
464
|
this.isRunningTests.inProgress();
|
|
457
465
|
let input: RunTestsTestableInput;
|
|
458
466
|
let currentNode = node;
|
|
467
|
+
const testable = this.testableMetadata.testable;
|
|
468
|
+
let mode: TESTABLE_RUN_MODE = TESTABLE_RUN_MODE.RUN_TESTABLE;
|
|
469
|
+
let suiteId: string | undefined;
|
|
470
|
+
let testCount = 0;
|
|
459
471
|
try {
|
|
460
472
|
if (node instanceof AssertionTestTreeNodeData) {
|
|
461
473
|
const atomicTest = guaranteeNonNullable(node.assertion.parentTest);
|
|
@@ -463,8 +475,11 @@ export class TestableState {
|
|
|
463
475
|
atomicTest.__parent instanceof TestSuite
|
|
464
476
|
? atomicTest.__parent
|
|
465
477
|
: undefined;
|
|
466
|
-
input = new RunTestsTestableInput(
|
|
478
|
+
input = new RunTestsTestableInput(testable);
|
|
467
479
|
input.unitTestIds = [new UniqueTestId(suite, atomicTest)];
|
|
480
|
+
mode = TESTABLE_RUN_MODE.RUN_TEST;
|
|
481
|
+
suiteId = suite?.id;
|
|
482
|
+
testCount = 1;
|
|
468
483
|
const parentNode = Array.from(this.treeData.nodes.values())
|
|
469
484
|
.filter(filterByType(AtomicTestTreeNodeData))
|
|
470
485
|
.find((n) => n.atomicTest === atomicTest);
|
|
@@ -478,30 +493,74 @@ export class TestableState {
|
|
|
478
493
|
atomicTest.__parent instanceof TestSuite
|
|
479
494
|
? atomicTest.__parent
|
|
480
495
|
: undefined;
|
|
481
|
-
input = new RunTestsTestableInput(
|
|
496
|
+
input = new RunTestsTestableInput(testable);
|
|
482
497
|
input.unitTestIds = [new UniqueTestId(suite, atomicTest)];
|
|
498
|
+
mode = TESTABLE_RUN_MODE.RUN_TEST;
|
|
499
|
+
suiteId = suite?.id;
|
|
500
|
+
testCount = 1;
|
|
483
501
|
node.isRunning = true;
|
|
484
502
|
} else if (node instanceof TestSuiteTreeNodeData) {
|
|
485
|
-
input = new RunTestsTestableInput(
|
|
503
|
+
input = new RunTestsTestableInput(testable);
|
|
486
504
|
input.unitTestIds = node.testSuite.tests.map(
|
|
487
505
|
(s) => new UniqueTestId(node.testSuite, s),
|
|
488
506
|
);
|
|
507
|
+
mode = TESTABLE_RUN_MODE.RUN_SUITE;
|
|
508
|
+
suiteId = node.testSuite.id;
|
|
509
|
+
testCount = node.testSuite.tests.length;
|
|
489
510
|
node.isRunning = true;
|
|
490
511
|
} else if (node instanceof TestableTreeNodeData) {
|
|
491
|
-
input = new RunTestsTestableInput(
|
|
512
|
+
input = new RunTestsTestableInput(testable);
|
|
513
|
+
mode = TESTABLE_RUN_MODE.RUN_TESTABLE;
|
|
514
|
+
suiteId = undefined;
|
|
515
|
+
testCount = testable.tests.reduce(
|
|
516
|
+
(acc, t) => acc + (t instanceof TestSuite ? t.tests.length : 1),
|
|
517
|
+
0,
|
|
518
|
+
);
|
|
492
519
|
node.isRunning = true;
|
|
493
520
|
} else {
|
|
494
521
|
throw new UnsupportedOperationError(
|
|
495
522
|
`Unable to run tests for node ${node}`,
|
|
496
523
|
);
|
|
497
524
|
}
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
525
|
+
const telemetryBase = {
|
|
526
|
+
testableKind: getTestableKind(testable),
|
|
527
|
+
testablePath: getTestablePath(testable),
|
|
528
|
+
suiteId,
|
|
529
|
+
mode,
|
|
530
|
+
testCount,
|
|
531
|
+
};
|
|
532
|
+
const startTime = Date.now();
|
|
533
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
534
|
+
this.editorStore.applicationStore.telemetryService,
|
|
535
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
536
|
+
telemetryBase,
|
|
537
|
+
);
|
|
538
|
+
try {
|
|
539
|
+
const testResults =
|
|
540
|
+
(yield this.editorStore.graphManagerState.graphManager.runTests(
|
|
541
|
+
[input],
|
|
542
|
+
this.editorStore.graphManagerState.graph,
|
|
543
|
+
)) as TestResult[];
|
|
544
|
+
this.globalTestRunnerState.handleResults(testResults);
|
|
545
|
+
this.isRunningTests.complete();
|
|
546
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
547
|
+
this.editorStore.applicationStore.telemetryService,
|
|
548
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
549
|
+
{
|
|
550
|
+
...telemetryBase,
|
|
551
|
+
durationMs: Date.now() - startTime,
|
|
552
|
+
...summarizeTestResults(testResults),
|
|
553
|
+
},
|
|
554
|
+
);
|
|
555
|
+
} catch (error) {
|
|
556
|
+
assertErrorThrown(error);
|
|
557
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
558
|
+
this.editorStore.applicationStore.telemetryService,
|
|
559
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
560
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
561
|
+
);
|
|
562
|
+
throw error;
|
|
563
|
+
}
|
|
505
564
|
} catch (error) {
|
|
506
565
|
assertErrorThrown(error);
|
|
507
566
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
@@ -659,11 +718,21 @@ export class GlobalTestRunnerState {
|
|
|
659
718
|
}
|
|
660
719
|
|
|
661
720
|
*runAllTests(): GeneratorFn<void> {
|
|
721
|
+
const inputs = this.ownTestableStates.map(
|
|
722
|
+
(e) => new RunTestsTestableInput(e.testableMetadata.testable),
|
|
723
|
+
);
|
|
724
|
+
const telemetryBase = {
|
|
725
|
+
scope: GLOBAL_TEST_RUN_SCOPE.ALL,
|
|
726
|
+
testableCount: inputs.length,
|
|
727
|
+
};
|
|
728
|
+
const startTime = Date.now();
|
|
729
|
+
LegendStudioTelemetryHelper.logEvent_GlobalTestRunLaunched(
|
|
730
|
+
this.editorStore.applicationStore.telemetryService,
|
|
731
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
732
|
+
telemetryBase,
|
|
733
|
+
);
|
|
662
734
|
try {
|
|
663
735
|
this.isRunningTests.inProgress();
|
|
664
|
-
const inputs = this.ownTestableStates.map(
|
|
665
|
-
(e) => new RunTestsTestableInput(e.testableMetadata.testable),
|
|
666
|
-
);
|
|
667
736
|
const testResults =
|
|
668
737
|
(yield this.editorStore.graphManagerState.graphManager.runTests(
|
|
669
738
|
inputs,
|
|
@@ -671,10 +740,24 @@ export class GlobalTestRunnerState {
|
|
|
671
740
|
)) as TestResult[];
|
|
672
741
|
this.handleResults(testResults);
|
|
673
742
|
this.isRunningTests.complete();
|
|
743
|
+
LegendStudioTelemetryHelper.logEvent_GlobalTestRunSucceeded(
|
|
744
|
+
this.editorStore.applicationStore.telemetryService,
|
|
745
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
746
|
+
{
|
|
747
|
+
...telemetryBase,
|
|
748
|
+
durationMs: Date.now() - startTime,
|
|
749
|
+
...summarizeTestResults(testResults),
|
|
750
|
+
},
|
|
751
|
+
);
|
|
674
752
|
} catch (error) {
|
|
675
753
|
assertErrorThrown(error);
|
|
676
754
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
677
755
|
this.isRunningTests.fail();
|
|
756
|
+
LegendStudioTelemetryHelper.logEvent_GlobalTestRunFailure(
|
|
757
|
+
this.editorStore.applicationStore.telemetryService,
|
|
758
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
759
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
760
|
+
);
|
|
678
761
|
}
|
|
679
762
|
}
|
|
680
763
|
|
|
@@ -711,11 +794,21 @@ export class GlobalTestRunnerState {
|
|
|
711
794
|
}
|
|
712
795
|
|
|
713
796
|
*runDependenciesTests(): GeneratorFn<void> {
|
|
797
|
+
const inputs = this.allDependencyTestablesStates.map(
|
|
798
|
+
(e) => new RunTestsTestableInput(e.testableMetadata.testable),
|
|
799
|
+
);
|
|
800
|
+
const telemetryBase = {
|
|
801
|
+
scope: GLOBAL_TEST_RUN_SCOPE.DEPENDENCIES,
|
|
802
|
+
testableCount: inputs.length,
|
|
803
|
+
};
|
|
804
|
+
const startTime = Date.now();
|
|
805
|
+
LegendStudioTelemetryHelper.logEvent_GlobalTestRunLaunched(
|
|
806
|
+
this.editorStore.applicationStore.telemetryService,
|
|
807
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
808
|
+
telemetryBase,
|
|
809
|
+
);
|
|
714
810
|
try {
|
|
715
811
|
this.isRunningDependencyTests.inProgress();
|
|
716
|
-
const inputs = this.allDependencyTestablesStates.map(
|
|
717
|
-
(e) => new RunTestsTestableInput(e.testableMetadata.testable),
|
|
718
|
-
);
|
|
719
812
|
const testResults =
|
|
720
813
|
(yield this.editorStore.graphManagerState.graphManager.runTests(
|
|
721
814
|
inputs,
|
|
@@ -723,10 +816,24 @@ export class GlobalTestRunnerState {
|
|
|
723
816
|
)) as TestResult[];
|
|
724
817
|
this.handleResults(testResults);
|
|
725
818
|
this.isRunningDependencyTests.complete();
|
|
819
|
+
LegendStudioTelemetryHelper.logEvent_GlobalTestRunSucceeded(
|
|
820
|
+
this.editorStore.applicationStore.telemetryService,
|
|
821
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
822
|
+
{
|
|
823
|
+
...telemetryBase,
|
|
824
|
+
durationMs: Date.now() - startTime,
|
|
825
|
+
...summarizeTestResults(testResults),
|
|
826
|
+
},
|
|
827
|
+
);
|
|
726
828
|
} catch (error) {
|
|
727
829
|
assertErrorThrown(error);
|
|
728
830
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
729
831
|
this.isRunningDependencyTests.fail();
|
|
832
|
+
LegendStudioTelemetryHelper.logEvent_GlobalTestRunFailure(
|
|
833
|
+
this.editorStore.applicationStore.telemetryService,
|
|
834
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
835
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
836
|
+
);
|
|
730
837
|
}
|
|
731
838
|
}
|
|
732
839
|
}
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
Randomizer,
|
|
22
22
|
UnsupportedOperationError,
|
|
23
23
|
type PlainObject,
|
|
24
|
-
isNonNullable,
|
|
25
24
|
filterByType,
|
|
26
25
|
} from '@finos/legend-shared';
|
|
27
26
|
import type { EditorStore } from '../EditorStore.js';
|
|
@@ -37,16 +36,12 @@ import {
|
|
|
37
36
|
TableAlias,
|
|
38
37
|
Table,
|
|
39
38
|
Column,
|
|
40
|
-
VarChar,
|
|
41
39
|
type RelationalDataType,
|
|
42
|
-
|
|
43
|
-
VarBinary,
|
|
40
|
+
BigInt,
|
|
44
41
|
TinyInt,
|
|
45
42
|
Float,
|
|
46
43
|
Timestamp,
|
|
47
|
-
Binary,
|
|
48
44
|
Bit,
|
|
49
|
-
Other,
|
|
50
45
|
Numeric,
|
|
51
46
|
Decimal,
|
|
52
47
|
Double,
|
|
@@ -220,49 +215,56 @@ export const createMockDataForClassWithFormat = (
|
|
|
220
215
|
}
|
|
221
216
|
};
|
|
222
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Maps a relational column type to the standard primitive type used to read
|
|
220
|
+
* the column with a TDS getter (e.g. `$row.getFloat('COL')`) and to mock its
|
|
221
|
+
* values.
|
|
222
|
+
*
|
|
223
|
+
* NOTE: this matches how the engine types `tableToTDS()` columns, except that
|
|
224
|
+
* `DECIMAL` and `NUMERIC` map to `Decimal` (the engine uses `Float`), so mock
|
|
225
|
+
* values keep exact-numeric semantics. Binary, JSON, semi-structured and other
|
|
226
|
+
* types have no TDS getter or literal of their own and map to `String`.
|
|
227
|
+
*/
|
|
223
228
|
export const getPrimitiveTypeFromRelationalType = (
|
|
224
229
|
type: RelationalDataType,
|
|
225
|
-
): PrimitiveType
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
type instanceof Char ||
|
|
229
|
-
type instanceof VarBinary ||
|
|
230
|
-
type instanceof Binary ||
|
|
231
|
-
type instanceof Bit ||
|
|
232
|
-
type instanceof Other
|
|
233
|
-
) {
|
|
234
|
-
return PrimitiveType.STRING;
|
|
235
|
-
} else if (type instanceof Numeric) {
|
|
236
|
-
return PrimitiveType.NUMBER;
|
|
237
|
-
} else if (type instanceof Decimal) {
|
|
238
|
-
return PrimitiveType.DECIMAL;
|
|
230
|
+
): PrimitiveType => {
|
|
231
|
+
if (type instanceof Bit) {
|
|
232
|
+
return PrimitiveType.BOOLEAN;
|
|
239
233
|
} else if (
|
|
240
|
-
type instanceof Double ||
|
|
241
234
|
type instanceof Integer ||
|
|
242
|
-
type instanceof
|
|
235
|
+
type instanceof BigInt ||
|
|
243
236
|
type instanceof SmallInt ||
|
|
244
237
|
type instanceof TinyInt
|
|
245
238
|
) {
|
|
246
239
|
return PrimitiveType.INTEGER;
|
|
247
|
-
} else if (
|
|
240
|
+
} else if (
|
|
241
|
+
type instanceof Float ||
|
|
242
|
+
type instanceof Double ||
|
|
243
|
+
type instanceof Real
|
|
244
|
+
) {
|
|
248
245
|
return PrimitiveType.FLOAT;
|
|
246
|
+
} else if (type instanceof Decimal || type instanceof Numeric) {
|
|
247
|
+
return PrimitiveType.DECIMAL;
|
|
249
248
|
} else if (type instanceof ColumnDate) {
|
|
250
|
-
return PrimitiveType.
|
|
249
|
+
return PrimitiveType.STRICTDATE;
|
|
251
250
|
} else if (type instanceof Timestamp) {
|
|
252
251
|
return PrimitiveType.DATETIME;
|
|
253
252
|
}
|
|
254
|
-
|
|
253
|
+
// VARCHAR, CHAR, BINARY, VARBINARY, JSON, SEMISTRUCTURED, OTHER
|
|
254
|
+
return PrimitiveType.STRING;
|
|
255
255
|
};
|
|
256
|
+
|
|
256
257
|
export const createMockDataForColumn = (
|
|
257
258
|
col: Column,
|
|
258
259
|
isPrimaryKey: boolean,
|
|
259
260
|
idx?: number | undefined,
|
|
260
|
-
): string
|
|
261
|
+
): string => {
|
|
261
262
|
const type = col.type;
|
|
262
263
|
|
|
263
264
|
if (
|
|
264
265
|
(type instanceof Double ||
|
|
265
266
|
type instanceof Integer ||
|
|
267
|
+
type instanceof BigInt ||
|
|
266
268
|
type instanceof Real ||
|
|
267
269
|
type instanceof SmallInt ||
|
|
268
270
|
type instanceof TinyInt) &&
|
|
@@ -271,13 +273,13 @@ export const createMockDataForColumn = (
|
|
|
271
273
|
) {
|
|
272
274
|
return idx.toString();
|
|
273
275
|
}
|
|
274
|
-
|
|
275
|
-
if (primitive) {
|
|
276
|
-
return createMockPrimitiveProperty(primitive, col.name).toString();
|
|
277
|
-
} else if (type instanceof Json || type instanceof SemiStructured) {
|
|
276
|
+
if (type instanceof Json || type instanceof SemiStructured) {
|
|
278
277
|
return '{}';
|
|
279
278
|
}
|
|
280
|
-
return
|
|
279
|
+
return createMockPrimitiveProperty(
|
|
280
|
+
getPrimitiveTypeFromRelationalType(type),
|
|
281
|
+
col.name,
|
|
282
|
+
).toString();
|
|
281
283
|
};
|
|
282
284
|
|
|
283
285
|
export const createMockDataForTable = (
|
|
@@ -292,7 +294,6 @@ export const createMockDataForTable = (
|
|
|
292
294
|
.map((col) =>
|
|
293
295
|
createMockDataForColumn(col, table.primaryKey.includes(col), idx),
|
|
294
296
|
)
|
|
295
|
-
.filter(isNonNullable)
|
|
296
297
|
.join(','),
|
|
297
298
|
)
|
|
298
299
|
.join('\n');
|
|
@@ -104,6 +104,24 @@ export const accessPointGroup_setTitle = action(
|
|
|
104
104
|
},
|
|
105
105
|
);
|
|
106
106
|
|
|
107
|
+
export const accessPointGroup_addTarget = action(
|
|
108
|
+
(group: AccessPointGroup, target: string) => {
|
|
109
|
+
if (!group.targets) {
|
|
110
|
+
group.targets = [target];
|
|
111
|
+
} else {
|
|
112
|
+
addUniqueEntry(group.targets, target);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
export const accessPointGroup_deleteTarget = action(
|
|
118
|
+
(group: AccessPointGroup, target: string) => {
|
|
119
|
+
if (group.targets) {
|
|
120
|
+
deleteEntry(group.targets, target);
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
|
|
107
125
|
export const modelAccessPointGroup_setMapping = action(
|
|
108
126
|
(
|
|
109
127
|
group: ModelAccessPointGroup,
|
|
@@ -17,10 +17,14 @@
|
|
|
17
17
|
import {
|
|
18
18
|
ConnectionPointer,
|
|
19
19
|
type PackageableConnection,
|
|
20
|
+
type PackageableRuntime,
|
|
21
|
+
type ObserverContext,
|
|
20
22
|
PackageableElementExplicitReference,
|
|
21
|
-
|
|
23
|
+
LakehouseRuntime,
|
|
24
|
+
LakehouseSingleStoreRuntime,
|
|
22
25
|
} from '@finos/legend-graph';
|
|
23
26
|
import { action } from 'mobx';
|
|
27
|
+
import { packageableRuntime_setRuntimeValue } from './DSL_Mapping_GraphModifierHelper.js';
|
|
24
28
|
|
|
25
29
|
export const lakehouseRuntime_setWarehouse = action(
|
|
26
30
|
(runtime: LakehouseRuntime, warehouse: string | undefined) => {
|
|
@@ -28,12 +32,6 @@ export const lakehouseRuntime_setWarehouse = action(
|
|
|
28
32
|
},
|
|
29
33
|
);
|
|
30
34
|
|
|
31
|
-
export const lakehouseRuntime_setEnvironment = action(
|
|
32
|
-
(runtime: LakehouseRuntime, environment: string | undefined) => {
|
|
33
|
-
runtime.environment = environment;
|
|
34
|
-
},
|
|
35
|
-
);
|
|
36
|
-
|
|
37
35
|
export const lakehouseRuntime_setConnection = action(
|
|
38
36
|
(
|
|
39
37
|
runtime: LakehouseRuntime,
|
|
@@ -47,3 +45,60 @@ export const lakehouseRuntime_setConnection = action(
|
|
|
47
45
|
: undefined;
|
|
48
46
|
},
|
|
49
47
|
);
|
|
48
|
+
|
|
49
|
+
export enum LakehouseComputeEngine {
|
|
50
|
+
SNOWFLAKE = 'SNOWFLAKE',
|
|
51
|
+
SINGLE_STORE = 'SINGLE_STORE',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Vendor product names, so they are spelled the way the vendor spells them --
|
|
56
|
+
* `prettyCONSTName` cannot produce "SingleStore" from any all-caps constant.
|
|
57
|
+
*/
|
|
58
|
+
export const LAKEHOUSE_COMPUTE_ENGINE_LABEL: Record<
|
|
59
|
+
LakehouseComputeEngine,
|
|
60
|
+
string
|
|
61
|
+
> = {
|
|
62
|
+
[LakehouseComputeEngine.SNOWFLAKE]: 'Snowflake',
|
|
63
|
+
[LakehouseComputeEngine.SINGLE_STORE]: 'SingleStore',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const getLakehouseComputeEngine = (
|
|
67
|
+
runtimeValue: LakehouseRuntime | LakehouseSingleStoreRuntime,
|
|
68
|
+
): LakehouseComputeEngine =>
|
|
69
|
+
runtimeValue instanceof LakehouseRuntime
|
|
70
|
+
? LakehouseComputeEngine.SNOWFLAKE
|
|
71
|
+
: LakehouseComputeEngine.SINGLE_STORE;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Swaps the concrete Lakehouse runtime class backing `packageableRuntime`
|
|
75
|
+
* between `LakehouseRuntime` (Snowflake) and `LakehouseSingleStoreRuntime`.
|
|
76
|
+
* These are distinct classes with distinct wire `_type`s, not a flag on one
|
|
77
|
+
* class, so switching compute engine means constructing a new instance --
|
|
78
|
+
* `environment` carries over, `warehouse`/`connectionPointer` naturally fall
|
|
79
|
+
* away (or reset to undefined) since the target class may not have them.
|
|
80
|
+
*/
|
|
81
|
+
export const lakehouseRuntime_setComputeEngine = action(
|
|
82
|
+
(
|
|
83
|
+
packageableRuntime: PackageableRuntime,
|
|
84
|
+
computeEngine: LakehouseComputeEngine,
|
|
85
|
+
observerContext: ObserverContext,
|
|
86
|
+
): LakehouseRuntime | LakehouseSingleStoreRuntime => {
|
|
87
|
+
const current = packageableRuntime.runtimeValue;
|
|
88
|
+
const environment =
|
|
89
|
+
current instanceof LakehouseRuntime ||
|
|
90
|
+
current instanceof LakehouseSingleStoreRuntime
|
|
91
|
+
? current.environment
|
|
92
|
+
: undefined;
|
|
93
|
+
const next =
|
|
94
|
+
computeEngine === LakehouseComputeEngine.SNOWFLAKE
|
|
95
|
+
? new LakehouseRuntime(environment)
|
|
96
|
+
: new LakehouseSingleStoreRuntime(environment);
|
|
97
|
+
packageableRuntime_setRuntimeValue(
|
|
98
|
+
packageableRuntime,
|
|
99
|
+
next,
|
|
100
|
+
observerContext,
|
|
101
|
+
);
|
|
102
|
+
return next;
|
|
103
|
+
},
|
|
104
|
+
);
|