@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
|
@@ -60,6 +60,12 @@ import {
|
|
|
60
60
|
} from './TestAssertionState.js';
|
|
61
61
|
import type { ElementEditorState } from '../ElementEditorState.js';
|
|
62
62
|
import { ExecutionPlanState } from '@finos/legend-query-builder';
|
|
63
|
+
import {
|
|
64
|
+
LegendStudioTelemetryHelper,
|
|
65
|
+
TESTABLE_RUN_MODE,
|
|
66
|
+
type TESTABLE_KIND,
|
|
67
|
+
summarizeTestResults,
|
|
68
|
+
} from '../../../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
63
69
|
|
|
64
70
|
export class TestableTestResultState {
|
|
65
71
|
readonly editorStore: EditorStore;
|
|
@@ -202,6 +208,10 @@ export abstract class TestableTestEditorState {
|
|
|
202
208
|
this.isReadOnly = isReadOnly;
|
|
203
209
|
}
|
|
204
210
|
|
|
211
|
+
abstract get testableKind(): TESTABLE_KIND;
|
|
212
|
+
|
|
213
|
+
abstract get testablePath(): string;
|
|
214
|
+
|
|
205
215
|
setSelectedTab(val: TESTABLE_TEST_TAB): void {
|
|
206
216
|
this.selectedTab = val;
|
|
207
217
|
}
|
|
@@ -335,18 +345,47 @@ export abstract class TestableTestEditorState {
|
|
|
335
345
|
).length;
|
|
336
346
|
}
|
|
337
347
|
*runTest(): GeneratorFn<void> {
|
|
348
|
+
const parentSuite =
|
|
349
|
+
this.test.__parent instanceof TestSuite ? this.test.__parent : undefined;
|
|
350
|
+
const telemetryBase = {
|
|
351
|
+
testableKind: this.testableKind,
|
|
352
|
+
testablePath: this.testablePath,
|
|
353
|
+
suiteId: parentSuite?.id,
|
|
354
|
+
mode: TESTABLE_RUN_MODE.RUN_TEST,
|
|
355
|
+
testCount: 1,
|
|
356
|
+
};
|
|
357
|
+
const startTime = Date.now();
|
|
358
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
359
|
+
this.editorStore.applicationStore.telemetryService,
|
|
360
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
361
|
+
telemetryBase,
|
|
362
|
+
);
|
|
338
363
|
try {
|
|
339
364
|
this.resetResult();
|
|
340
365
|
this.runningTestAction.inProgress();
|
|
341
366
|
const result = (yield flowResult(this.fetchTestResult())) as TestResult;
|
|
342
367
|
this.handleTestResult(result);
|
|
343
368
|
this.runningTestAction.complete();
|
|
369
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
370
|
+
this.editorStore.applicationStore.telemetryService,
|
|
371
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
372
|
+
{
|
|
373
|
+
...telemetryBase,
|
|
374
|
+
durationMs: Date.now() - startTime,
|
|
375
|
+
...summarizeTestResults([result]),
|
|
376
|
+
},
|
|
377
|
+
);
|
|
344
378
|
} catch (error) {
|
|
345
379
|
assertErrorThrown(error);
|
|
346
380
|
this.editorStore.applicationStore.notificationService.notifyError(
|
|
347
381
|
`Error running test: ${error.message}`,
|
|
348
382
|
);
|
|
349
383
|
this.runningTestAction.fail();
|
|
384
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
385
|
+
this.editorStore.applicationStore.telemetryService,
|
|
386
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
387
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
388
|
+
);
|
|
350
389
|
}
|
|
351
390
|
}
|
|
352
391
|
|
|
@@ -410,7 +449,24 @@ export abstract class TestableTestSuiteEditorState {
|
|
|
410
449
|
this.editorStore = editorStore;
|
|
411
450
|
}
|
|
412
451
|
|
|
452
|
+
abstract get testableKind(): TESTABLE_KIND;
|
|
453
|
+
|
|
454
|
+
abstract get testablePath(): string;
|
|
455
|
+
|
|
413
456
|
*runSuite(): GeneratorFn<void> {
|
|
457
|
+
const telemetryBase = {
|
|
458
|
+
testableKind: this.testableKind,
|
|
459
|
+
testablePath: this.testablePath,
|
|
460
|
+
suiteId: this.suite.id,
|
|
461
|
+
mode: TESTABLE_RUN_MODE.RUN_SUITE,
|
|
462
|
+
testCount: this.suite.tests.length,
|
|
463
|
+
};
|
|
464
|
+
const startTime = Date.now();
|
|
465
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
466
|
+
this.editorStore.applicationStore.telemetryService,
|
|
467
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
468
|
+
telemetryBase,
|
|
469
|
+
);
|
|
414
470
|
try {
|
|
415
471
|
this.runningSuiteState.inProgress();
|
|
416
472
|
this.testStates.forEach((t) => t.resetResult());
|
|
@@ -429,33 +485,61 @@ export abstract class TestableTestSuiteEditorState {
|
|
|
429
485
|
state?.handleTestResult(result);
|
|
430
486
|
});
|
|
431
487
|
this.runningSuiteState.complete();
|
|
488
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
489
|
+
this.editorStore.applicationStore.telemetryService,
|
|
490
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
491
|
+
{
|
|
492
|
+
...telemetryBase,
|
|
493
|
+
durationMs: Date.now() - startTime,
|
|
494
|
+
...summarizeTestResults(testResults),
|
|
495
|
+
},
|
|
496
|
+
);
|
|
432
497
|
} catch (error) {
|
|
433
498
|
assertErrorThrown(error);
|
|
434
499
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
435
500
|
this.runningSuiteState.fail();
|
|
501
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
502
|
+
this.editorStore.applicationStore.telemetryService,
|
|
503
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
504
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
505
|
+
);
|
|
436
506
|
} finally {
|
|
437
507
|
this.testStates.forEach((t) => t.runningTestAction.complete());
|
|
438
508
|
}
|
|
439
509
|
}
|
|
440
510
|
|
|
441
511
|
*runFailingTests(): GeneratorFn<void> {
|
|
512
|
+
const unitTestIds = this.testStates
|
|
513
|
+
.map((testState) => {
|
|
514
|
+
const result = testState.testResultState.result;
|
|
515
|
+
if (
|
|
516
|
+
(result instanceof TestExecuted &&
|
|
517
|
+
result.testExecutionStatus === TestExecutionStatus.FAIL) ||
|
|
518
|
+
result instanceof TestError
|
|
519
|
+
) {
|
|
520
|
+
testState.runningTestAction.inProgress();
|
|
521
|
+
return new UniqueTestId(this.suite, testState.test);
|
|
522
|
+
}
|
|
523
|
+
return undefined;
|
|
524
|
+
})
|
|
525
|
+
.filter(isNonNullable);
|
|
526
|
+
const telemetryBase = {
|
|
527
|
+
testableKind: this.testableKind,
|
|
528
|
+
testablePath: this.testablePath,
|
|
529
|
+
suiteId: this.suite.id,
|
|
530
|
+
mode: TESTABLE_RUN_MODE.RUN_FAILING,
|
|
531
|
+
testCount: unitTestIds.length,
|
|
532
|
+
};
|
|
533
|
+
const startTime = Date.now();
|
|
534
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
535
|
+
this.editorStore.applicationStore.telemetryService,
|
|
536
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
537
|
+
telemetryBase,
|
|
538
|
+
);
|
|
442
539
|
try {
|
|
443
540
|
this.runningSuiteState.inProgress();
|
|
444
541
|
const input = new RunTestsTestableInput(this.testable);
|
|
445
|
-
input.unitTestIds =
|
|
446
|
-
.map((testState) => {
|
|
447
|
-
const result = testState.testResultState.result;
|
|
448
|
-
if (
|
|
449
|
-
(result instanceof TestExecuted &&
|
|
450
|
-
result.testExecutionStatus === TestExecutionStatus.FAIL) ||
|
|
451
|
-
result instanceof TestError
|
|
452
|
-
) {
|
|
453
|
-
testState.runningTestAction.inProgress();
|
|
454
|
-
return new UniqueTestId(this.suite, testState.test);
|
|
455
|
-
}
|
|
456
|
-
return undefined;
|
|
457
|
-
})
|
|
458
|
-
.filter(isNonNullable);
|
|
542
|
+
input.unitTestIds = unitTestIds;
|
|
459
543
|
const testResults =
|
|
460
544
|
(yield this.editorStore.graphManagerState.graphManager.runTests(
|
|
461
545
|
[input],
|
|
@@ -466,10 +550,24 @@ export abstract class TestableTestSuiteEditorState {
|
|
|
466
550
|
state?.handleTestResult(result);
|
|
467
551
|
});
|
|
468
552
|
this.runningSuiteState.complete();
|
|
553
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
554
|
+
this.editorStore.applicationStore.telemetryService,
|
|
555
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
556
|
+
{
|
|
557
|
+
...telemetryBase,
|
|
558
|
+
durationMs: Date.now() - startTime,
|
|
559
|
+
...summarizeTestResults(testResults),
|
|
560
|
+
},
|
|
561
|
+
);
|
|
469
562
|
} catch (error) {
|
|
470
563
|
assertErrorThrown(error);
|
|
471
564
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
472
565
|
this.runningSuiteState.fail();
|
|
566
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
567
|
+
this.editorStore.applicationStore.telemetryService,
|
|
568
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
569
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
570
|
+
);
|
|
473
571
|
} finally {
|
|
474
572
|
this.testStates.forEach((t) => t.runningTestAction.complete());
|
|
475
573
|
}
|
|
@@ -517,6 +615,10 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
517
615
|
|
|
518
616
|
abstract init(): void;
|
|
519
617
|
|
|
618
|
+
abstract get testableKind(): TESTABLE_KIND;
|
|
619
|
+
|
|
620
|
+
abstract get testablePath(): string;
|
|
621
|
+
|
|
520
622
|
get suiteCount(): number {
|
|
521
623
|
return this.testable.tests.length;
|
|
522
624
|
}
|
|
@@ -593,12 +695,25 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
593
695
|
}
|
|
594
696
|
|
|
595
697
|
*runAllFailingSuites(): GeneratorFn<void> {
|
|
698
|
+
const input = new RunTestsTestableInput(this.testable);
|
|
699
|
+
this.failingSuites.forEach((s) => {
|
|
700
|
+
s.tests.forEach((t) => input.unitTestIds.push(new UniqueTestId(s, t)));
|
|
701
|
+
});
|
|
702
|
+
const telemetryBase = {
|
|
703
|
+
testableKind: this.testableKind,
|
|
704
|
+
testablePath: this.testablePath,
|
|
705
|
+
suiteId: undefined,
|
|
706
|
+
mode: TESTABLE_RUN_MODE.RUN_ALL_FAILING,
|
|
707
|
+
testCount: input.unitTestIds.length,
|
|
708
|
+
};
|
|
709
|
+
const startTime = Date.now();
|
|
710
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
711
|
+
this.editorStore.applicationStore.telemetryService,
|
|
712
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
713
|
+
telemetryBase,
|
|
714
|
+
);
|
|
596
715
|
try {
|
|
597
716
|
this.isRunningFailingSuitesState.inProgress();
|
|
598
|
-
const input = new RunTestsTestableInput(this.testable);
|
|
599
|
-
this.failingSuites.forEach((s) => {
|
|
600
|
-
s.tests.forEach((t) => input.unitTestIds.push(new UniqueTestId(s, t)));
|
|
601
|
-
});
|
|
602
717
|
const testResults =
|
|
603
718
|
(yield this.editorStore.graphManagerState.graphManager.runTests(
|
|
604
719
|
[input],
|
|
@@ -606,10 +721,24 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
606
721
|
)) as TestResult[];
|
|
607
722
|
this.handleNewResults(testResults);
|
|
608
723
|
this.isRunningFailingSuitesState.complete();
|
|
724
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
725
|
+
this.editorStore.applicationStore.telemetryService,
|
|
726
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
727
|
+
{
|
|
728
|
+
...telemetryBase,
|
|
729
|
+
durationMs: Date.now() - startTime,
|
|
730
|
+
...summarizeTestResults(testResults),
|
|
731
|
+
},
|
|
732
|
+
);
|
|
609
733
|
} catch (error) {
|
|
610
734
|
assertErrorThrown(error);
|
|
611
735
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
612
736
|
this.isRunningFailingSuitesState.fail();
|
|
737
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
738
|
+
this.editorStore.applicationStore.telemetryService,
|
|
739
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
740
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
741
|
+
);
|
|
613
742
|
} finally {
|
|
614
743
|
this.selectedTestSuite?.testStates.forEach((t) =>
|
|
615
744
|
t.runningTestAction.complete(),
|
|
@@ -618,6 +747,23 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
618
747
|
}
|
|
619
748
|
|
|
620
749
|
*runTestable(): GeneratorFn<void> {
|
|
750
|
+
const totalTestCount = this.suites.reduce(
|
|
751
|
+
(acc, s) => acc + s.tests.length,
|
|
752
|
+
0,
|
|
753
|
+
);
|
|
754
|
+
const telemetryBase = {
|
|
755
|
+
testableKind: this.testableKind,
|
|
756
|
+
testablePath: this.testablePath,
|
|
757
|
+
suiteId: undefined,
|
|
758
|
+
mode: TESTABLE_RUN_MODE.RUN_TESTABLE,
|
|
759
|
+
testCount: totalTestCount,
|
|
760
|
+
};
|
|
761
|
+
const startTime = Date.now();
|
|
762
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
763
|
+
this.editorStore.applicationStore.telemetryService,
|
|
764
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
765
|
+
telemetryBase,
|
|
766
|
+
);
|
|
621
767
|
try {
|
|
622
768
|
this.setTestableResults(undefined);
|
|
623
769
|
this.isRunningTestableSuitesState.inProgress();
|
|
@@ -633,10 +779,24 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
633
779
|
)) as TestResult[];
|
|
634
780
|
this.handleNewResults(testResults);
|
|
635
781
|
this.isRunningTestableSuitesState.complete();
|
|
782
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
783
|
+
this.editorStore.applicationStore.telemetryService,
|
|
784
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
785
|
+
{
|
|
786
|
+
...telemetryBase,
|
|
787
|
+
durationMs: Date.now() - startTime,
|
|
788
|
+
...summarizeTestResults(testResults),
|
|
789
|
+
},
|
|
790
|
+
);
|
|
636
791
|
} catch (error) {
|
|
637
792
|
assertErrorThrown(error);
|
|
638
793
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
639
794
|
this.isRunningTestableSuitesState.fail();
|
|
795
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
796
|
+
this.editorStore.applicationStore.telemetryService,
|
|
797
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
798
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
799
|
+
);
|
|
640
800
|
} finally {
|
|
641
801
|
this.selectedTestSuite?.testStates.forEach((t) =>
|
|
642
802
|
t.runningTestAction.complete(),
|
|
@@ -645,6 +805,19 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
645
805
|
}
|
|
646
806
|
|
|
647
807
|
*runSuite(suite: TestSuite): GeneratorFn<void> {
|
|
808
|
+
const telemetryBase = {
|
|
809
|
+
testableKind: this.testableKind,
|
|
810
|
+
testablePath: this.testablePath,
|
|
811
|
+
suiteId: suite.id,
|
|
812
|
+
mode: TESTABLE_RUN_MODE.RUN_SUITE,
|
|
813
|
+
testCount: suite.tests.length,
|
|
814
|
+
};
|
|
815
|
+
const startTime = Date.now();
|
|
816
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
|
|
817
|
+
this.editorStore.applicationStore.telemetryService,
|
|
818
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
819
|
+
telemetryBase,
|
|
820
|
+
);
|
|
648
821
|
try {
|
|
649
822
|
this.runningSuite = suite;
|
|
650
823
|
this.clearTestResultsForSuite(suite);
|
|
@@ -663,10 +836,24 @@ export abstract class TestablePackageableElementEditorState {
|
|
|
663
836
|
)) as TestResult[];
|
|
664
837
|
|
|
665
838
|
this.handleNewResults(testResults);
|
|
839
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
|
|
840
|
+
this.editorStore.applicationStore.telemetryService,
|
|
841
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
842
|
+
{
|
|
843
|
+
...telemetryBase,
|
|
844
|
+
durationMs: Date.now() - startTime,
|
|
845
|
+
...summarizeTestResults(testResults),
|
|
846
|
+
},
|
|
847
|
+
);
|
|
666
848
|
} catch (error) {
|
|
667
849
|
assertErrorThrown(error);
|
|
668
850
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
669
851
|
this.isRunningTestableSuitesState.fail();
|
|
852
|
+
LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
|
|
853
|
+
this.editorStore.applicationStore.telemetryService,
|
|
854
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
855
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
856
|
+
);
|
|
670
857
|
} finally {
|
|
671
858
|
this.selectedTestSuite?.testStates.forEach((t) =>
|
|
672
859
|
t.runningTestAction.complete(),
|
|
@@ -43,6 +43,10 @@ import {
|
|
|
43
43
|
ProjectType,
|
|
44
44
|
} from '@finos/legend-server-sdlc';
|
|
45
45
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../../__lib__/LegendStudioEvent.js';
|
|
46
|
+
import {
|
|
47
|
+
LegendStudioTelemetryHelper,
|
|
48
|
+
PROJECT_CONFIG_UPDATE_ACTION,
|
|
49
|
+
} from '../../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
46
50
|
import { SNAPSHOT_ALIAS, StoreProjectData } from '@finos/legend-server-depot';
|
|
47
51
|
import { ProjectDependencyEditorState } from './ProjectDependencyEditorState.js';
|
|
48
52
|
|
|
@@ -231,7 +235,15 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
231
235
|
|
|
232
236
|
*updateProjectConfiguration(
|
|
233
237
|
updateConfigurationCommand: UpdateProjectConfigurationCommand,
|
|
238
|
+
updateAction: PROJECT_CONFIG_UPDATE_ACTION,
|
|
234
239
|
): GeneratorFn<void> {
|
|
240
|
+
const startTime = Date.now();
|
|
241
|
+
const sourceInfo = this.editorStore.editorMode.getSourceInfo();
|
|
242
|
+
LegendStudioTelemetryHelper.logEvent_ProjectConfigUpdateLaunched(
|
|
243
|
+
this.editorStore.applicationStore.telemetryService,
|
|
244
|
+
sourceInfo,
|
|
245
|
+
{ action: updateAction },
|
|
246
|
+
);
|
|
235
247
|
try {
|
|
236
248
|
this.updatingConfigurationState.inProgress();
|
|
237
249
|
|
|
@@ -262,12 +274,22 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
262
274
|
this.editorStore.tabManagerState.openTab(
|
|
263
275
|
this.editorStore.projectConfigurationEditorState,
|
|
264
276
|
);
|
|
277
|
+
LegendStudioTelemetryHelper.logEvent_ProjectConfigUpdateSucceeded(
|
|
278
|
+
this.editorStore.applicationStore.telemetryService,
|
|
279
|
+
sourceInfo,
|
|
280
|
+
{ action: updateAction, durationMs: Date.now() - startTime },
|
|
281
|
+
);
|
|
265
282
|
} catch (error) {
|
|
266
283
|
assertErrorThrown(error);
|
|
267
284
|
this.editorStore.applicationStore.logService.error(
|
|
268
285
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE),
|
|
269
286
|
error,
|
|
270
287
|
);
|
|
288
|
+
LegendStudioTelemetryHelper.logEvent_ProjectConfigUpdateFailure(
|
|
289
|
+
this.editorStore.applicationStore.telemetryService,
|
|
290
|
+
sourceInfo,
|
|
291
|
+
{ action: updateAction, errorMessage: error.message },
|
|
292
|
+
);
|
|
271
293
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
272
294
|
} finally {
|
|
273
295
|
this.updatingConfigurationState.complete();
|
|
@@ -292,7 +314,12 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
292
314
|
latestStructure,
|
|
293
315
|
`update project configuration from ${this.editorStore.applicationStore.config.appName}: update to latest project structure`,
|
|
294
316
|
);
|
|
295
|
-
yield flowResult(
|
|
317
|
+
yield flowResult(
|
|
318
|
+
this.updateProjectConfiguration(
|
|
319
|
+
updateCommand,
|
|
320
|
+
PROJECT_CONFIG_UPDATE_ACTION.UPDATE_TO_LATEST_STRUCTURE,
|
|
321
|
+
),
|
|
322
|
+
);
|
|
296
323
|
} catch (error) {
|
|
297
324
|
assertErrorThrown(error);
|
|
298
325
|
this.editorStore.applicationStore.logService.error(
|
|
@@ -320,7 +347,12 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
320
347
|
}: changed project type to ${prettyCONSTName(newProjectType)}`,
|
|
321
348
|
);
|
|
322
349
|
updateCommand.projectType = newProjectType;
|
|
323
|
-
yield flowResult(
|
|
350
|
+
yield flowResult(
|
|
351
|
+
this.updateProjectConfiguration(
|
|
352
|
+
updateCommand,
|
|
353
|
+
PROJECT_CONFIG_UPDATE_ACTION.CHANGE_PROJECT_TYPE,
|
|
354
|
+
),
|
|
355
|
+
);
|
|
324
356
|
} catch (error) {
|
|
325
357
|
assertErrorThrown(error);
|
|
326
358
|
this.editorStore.applicationStore.logService.error(
|
|
@@ -380,7 +412,10 @@ export class ProjectConfigurationEditorState extends EditorState {
|
|
|
380
412
|
),
|
|
381
413
|
);
|
|
382
414
|
yield flowResult(
|
|
383
|
-
this.updateProjectConfiguration(
|
|
415
|
+
this.updateProjectConfiguration(
|
|
416
|
+
updateProjectConfigurationCommand,
|
|
417
|
+
PROJECT_CONFIG_UPDATE_ACTION.UPDATE_CONFIGS,
|
|
418
|
+
),
|
|
384
419
|
);
|
|
385
420
|
} catch (error) {
|
|
386
421
|
assertErrorThrown(error);
|
|
@@ -35,6 +35,10 @@ import {
|
|
|
35
35
|
ServiceRegistrationState,
|
|
36
36
|
} from '../editor-state/element-editor-state/service/ServiceRegistrationState.js';
|
|
37
37
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
|
|
38
|
+
import {
|
|
39
|
+
LegendStudioTelemetryHelper,
|
|
40
|
+
SERVICE_REGISTRATION_TRIGGER,
|
|
41
|
+
} from '../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
38
42
|
import { type ServiceRegistrationEnvironmentConfig } from '../../../application/LegendStudioApplicationConfig.js';
|
|
39
43
|
|
|
40
44
|
export enum REGISTRATION_RESULT {
|
|
@@ -179,6 +183,19 @@ export class GlobalBulkServiceRegistrationState {
|
|
|
179
183
|
.filter((bulkRegState) => bulkRegState.isSelected)
|
|
180
184
|
.map((serviceState) => serviceState.service);
|
|
181
185
|
|
|
186
|
+
const startedAt = Date.now();
|
|
187
|
+
const telemetryBase = {
|
|
188
|
+
trigger: SERVICE_REGISTRATION_TRIGGER.BULK,
|
|
189
|
+
executionMode: this.serviceConfigState.serviceExecutionMode,
|
|
190
|
+
serviceCount: selectedServices.length,
|
|
191
|
+
activatePostRegistration: this.activatePostRegistration,
|
|
192
|
+
};
|
|
193
|
+
LegendStudioTelemetryHelper.logEvent_ServiceRegistrationLaunched(
|
|
194
|
+
this.editorStore.applicationStore.telemetryService,
|
|
195
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
196
|
+
telemetryBase,
|
|
197
|
+
);
|
|
198
|
+
|
|
182
199
|
try {
|
|
183
200
|
this.validateBulkServiceForRegistration(
|
|
184
201
|
this.editorStore,
|
|
@@ -216,25 +233,78 @@ export class GlobalBulkServiceRegistrationState {
|
|
|
216
233
|
const successfulResults = registrationResults.filter(
|
|
217
234
|
(result) => result instanceof ServiceRegistrationSuccess,
|
|
218
235
|
);
|
|
236
|
+
const failedResults = registrationResults.filter(
|
|
237
|
+
(result) => result instanceof ServiceRegistrationFail,
|
|
238
|
+
);
|
|
219
239
|
|
|
240
|
+
let activationFailedCount: number | undefined;
|
|
220
241
|
if (this.activatePostRegistration) {
|
|
221
|
-
|
|
242
|
+
// Wait for every activation to settle so a single rejected activation
|
|
243
|
+
// neither hides the registration results nor goes unhandled.
|
|
244
|
+
const activationResults = (yield Promise.allSettled(
|
|
222
245
|
successfulResults.map((serviceResult) =>
|
|
223
246
|
this.editorStore.graphManagerState.graphManager.activateService(
|
|
224
247
|
config.executionUrl,
|
|
225
248
|
serviceResult.serviceInstanceId,
|
|
226
249
|
),
|
|
227
250
|
),
|
|
251
|
+
)) as PromiseSettledResult<void>[];
|
|
252
|
+
const activationFailures = activationResults.filter(
|
|
253
|
+
(result): result is PromiseRejectedResult =>
|
|
254
|
+
result.status === 'rejected',
|
|
255
|
+
);
|
|
256
|
+
activationFailedCount = activationFailures.length;
|
|
257
|
+
activationFailures.forEach((result) =>
|
|
258
|
+
this.editorStore.applicationStore.logService.error(
|
|
259
|
+
LogEvent.create(
|
|
260
|
+
LEGEND_STUDIO_APP_EVENT.SERVICE_REGISTRATION_FAILURE,
|
|
261
|
+
),
|
|
262
|
+
result.reason,
|
|
263
|
+
),
|
|
228
264
|
);
|
|
229
265
|
}
|
|
230
266
|
this.handleResults(registrationResults);
|
|
231
267
|
this.isServiceRegistering.complete();
|
|
268
|
+
const outcomeCounts = {
|
|
269
|
+
registeredCount: successfulResults.length,
|
|
270
|
+
failedCount: failedResults.length,
|
|
271
|
+
activationFailedCount,
|
|
272
|
+
};
|
|
273
|
+
// A bulk run where nothing got registered is a failed run; partial
|
|
274
|
+
// success is reported on the success payload via the outcome counts.
|
|
275
|
+
const firstFailure = failedResults[0];
|
|
276
|
+
if (successfulResults.length === 0 && firstFailure) {
|
|
277
|
+
LegendStudioTelemetryHelper.logEvent_ServiceRegistrationFailure(
|
|
278
|
+
this.editorStore.applicationStore.telemetryService,
|
|
279
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
280
|
+
{
|
|
281
|
+
...telemetryBase,
|
|
282
|
+
...outcomeCounts,
|
|
283
|
+
errorMessage: firstFailure.errorMessage,
|
|
284
|
+
},
|
|
285
|
+
);
|
|
286
|
+
} else {
|
|
287
|
+
LegendStudioTelemetryHelper.logEvent_ServiceRegistrationSucceeded(
|
|
288
|
+
this.editorStore.applicationStore.telemetryService,
|
|
289
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
290
|
+
{
|
|
291
|
+
...telemetryBase,
|
|
292
|
+
...outcomeCounts,
|
|
293
|
+
durationMs: Date.now() - startedAt,
|
|
294
|
+
},
|
|
295
|
+
);
|
|
296
|
+
}
|
|
232
297
|
} catch (error) {
|
|
233
298
|
assertErrorThrown(error);
|
|
234
299
|
this.editorStore.applicationStore.logService.error(
|
|
235
300
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.SERVICE_REGISTRATION_FAILURE),
|
|
236
301
|
error,
|
|
237
302
|
);
|
|
303
|
+
LegendStudioTelemetryHelper.logEvent_ServiceRegistrationFailure(
|
|
304
|
+
this.editorStore.applicationStore.telemetryService,
|
|
305
|
+
this.editorStore.editorMode.getSourceInfo(),
|
|
306
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
307
|
+
);
|
|
238
308
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
239
309
|
} finally {
|
|
240
310
|
this.serviceConfigState.registrationState.reset();
|
|
@@ -461,6 +461,10 @@ export abstract class LocalChangesState {
|
|
|
461
461
|
revisionId: latestRevision.id,
|
|
462
462
|
},
|
|
463
463
|
);
|
|
464
|
+
this.editorStore.legendAIAppliedSuggestionRegistry.reportPushedChanges(
|
|
465
|
+
this.editorStore,
|
|
466
|
+
localChanges,
|
|
467
|
+
);
|
|
464
468
|
|
|
465
469
|
// ======= (RE)START CHANGE DETECTION =======
|
|
466
470
|
|