@finos/legend-application-studio 28.21.44 → 28.21.46

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.
Files changed (138) hide show
  1. package/lib/__lib__/LegendStudioEvent.d.ts +55 -1
  2. package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioEvent.js +77 -0
  4. package/lib/__lib__/LegendStudioEvent.js.map +1 -1
  5. package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +491 -1
  6. package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioTelemetryHelper.js +594 -1
  8. package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
  9. package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
  10. package/lib/components/editor/side-bar/WorkflowManager.js +15 -0
  11. package/lib/components/editor/side-bar/WorkflowManager.js.map +1 -1
  12. package/lib/index.css +1 -1
  13. package/lib/index.d.ts +1 -1
  14. package/lib/index.d.ts.map +1 -1
  15. package/lib/index.js +1 -1
  16. package/lib/index.js.map +1 -1
  17. package/lib/package.json +1 -1
  18. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  19. package/lib/stores/editor/EditorGraphState.js +17 -1
  20. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  21. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  22. package/lib/stores/editor/EditorStore.js +10 -0
  23. package/lib/stores/editor/EditorStore.js.map +1 -1
  24. package/lib/stores/editor/EditorTabManagerState.d.ts +18 -1
  25. package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
  26. package/lib/stores/editor/EditorTabManagerState.js +90 -1
  27. package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
  28. package/lib/stores/editor/EditorTabTelemetryHelper.d.ts +31 -0
  29. package/lib/stores/editor/EditorTabTelemetryHelper.d.ts.map +1 -0
  30. package/lib/stores/editor/EditorTabTelemetryHelper.js +55 -0
  31. package/lib/stores/editor/EditorTabTelemetryHelper.js.map +1 -0
  32. package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
  33. package/lib/stores/editor/GraphEditFormModeState.js +11 -1
  34. package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
  35. package/lib/stores/editor/editor-state/GraphGenerationState.d.ts.map +1 -1
  36. package/lib/stores/editor/editor-state/GraphGenerationState.js +25 -0
  37. package/lib/stores/editor/editor-state/GraphGenerationState.js.map +1 -1
  38. package/lib/stores/editor/editor-state/ModelImporterState.d.ts.map +1 -1
  39. package/lib/stores/editor/editor-state/ModelImporterState.js +2 -1
  40. package/lib/stores/editor/editor-state/ModelImporterState.js.map +1 -1
  41. package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.d.ts.map +1 -1
  42. package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.js +14 -0
  43. package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.js.map +1 -1
  44. package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.d.ts +5 -0
  45. package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.d.ts.map +1 -1
  46. package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.js +13 -0
  47. package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.js.map +1 -1
  48. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts +5 -0
  49. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts.map +1 -1
  50. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js +13 -0
  51. package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js.map +1 -1
  52. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +7 -0
  53. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -1
  54. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +19 -0
  55. package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
  56. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.d.ts +5 -0
  57. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.d.ts.map +1 -1
  58. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.js +13 -0
  59. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.js.map +1 -1
  60. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +7 -0
  61. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  62. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +34 -0
  63. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  64. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
  65. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +29 -0
  66. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
  67. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  68. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +2 -0
  69. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  70. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +3 -0
  71. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  72. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +7 -0
  73. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  74. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
  75. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +46 -17
  76. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
  77. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +7 -0
  78. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
  79. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +110 -16
  80. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
  81. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +2 -1
  82. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
  83. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +10 -4
  84. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
  85. package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.d.ts.map +1 -1
  86. package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js +11 -0
  87. package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js.map +1 -1
  88. package/lib/stores/editor/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
  89. package/lib/stores/editor/sidebar-state/ProjectOverviewState.js +51 -0
  90. package/lib/stores/editor/sidebar-state/ProjectOverviewState.js.map +1 -1
  91. package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts +14 -0
  92. package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
  93. package/lib/stores/editor/sidebar-state/WorkflowManagerState.js +141 -26
  94. package/lib/stores/editor/sidebar-state/WorkflowManagerState.js.map +1 -1
  95. package/lib/stores/editor/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
  96. package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js +41 -0
  97. package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js.map +1 -1
  98. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts.map +1 -1
  99. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js +71 -9
  100. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js.map +1 -1
  101. package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -1
  102. package/lib/stores/project-reviewer/ProjectReviewerStore.js +45 -0
  103. package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -1
  104. package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts.map +1 -1
  105. package/lib/stores/workspace-setup/WorkspaceSetupStore.js +48 -4
  106. package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
  107. package/package.json +9 -9
  108. package/src/__lib__/LegendStudioEvent.ts +88 -0
  109. package/src/__lib__/LegendStudioTelemetryHelper.ts +1389 -204
  110. package/src/components/editor/side-bar/WorkflowManager.tsx +24 -0
  111. package/src/index.ts +4 -1
  112. package/src/stores/editor/EditorGraphState.ts +30 -1
  113. package/src/stores/editor/EditorStore.ts +19 -0
  114. package/src/stores/editor/EditorTabManagerState.ts +128 -1
  115. package/src/stores/editor/EditorTabTelemetryHelper.ts +70 -0
  116. package/src/stores/editor/GraphEditFormModeState.ts +19 -1
  117. package/src/stores/editor/editor-state/GraphGenerationState.ts +53 -0
  118. package/src/stores/editor/editor-state/ModelImporterState.ts +2 -0
  119. package/src/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.ts +30 -0
  120. package/src/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.ts +17 -0
  121. package/src/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.ts +17 -0
  122. package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +25 -0
  123. package/src/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.ts +17 -0
  124. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +57 -0
  125. package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +56 -0
  126. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +10 -0
  127. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +9 -0
  128. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +78 -21
  129. package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +205 -18
  130. package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +38 -3
  131. package/src/stores/editor/sidebar-state/BulkServiceRegistrationState.ts +27 -0
  132. package/src/stores/editor/sidebar-state/ProjectOverviewState.ts +114 -0
  133. package/src/stores/editor/sidebar-state/WorkflowManagerState.ts +259 -29
  134. package/src/stores/editor/sidebar-state/WorkspaceReviewState.ts +84 -0
  135. package/src/stores/editor/sidebar-state/testable/GlobalTestRunnerState.ts +124 -17
  136. package/src/stores/project-reviewer/ProjectReviewerStore.ts +97 -0
  137. package/src/stores/workspace-setup/WorkspaceSetupStore.ts +87 -4
  138. package/tsconfig.json +1 -0
@@ -111,6 +111,7 @@ import {
111
111
  createBareExternalFormat,
112
112
  } from '../../../../utils/TestableUtils.js';
113
113
  import { LEGEND_STUDIO_APP_EVENT } from '../../../../../../__lib__/LegendStudioEvent.js';
114
+ import { TESTABLE_KIND } from '../../../../../../__lib__/LegendStudioTelemetryHelper.js';
114
115
  import { testSuite_addTest } from '../../../../../graph-modifier/Testable_GraphModifierHelper.js';
115
116
  import {
116
117
  buildDefaultInstanceValue,
@@ -437,6 +438,14 @@ export class FunctionTestState extends TestableTestEditorState {
437
438
  newParameterValueName = '';
438
439
  showNewParameterModal = false;
439
440
 
441
+ override get testableKind(): TESTABLE_KIND {
442
+ return TESTABLE_KIND.FUNCTION_ACTIVATOR;
443
+ }
444
+
445
+ override get testablePath(): string {
446
+ return this.functionTestableState.function.path;
447
+ }
448
+
440
449
  constructor(
441
450
  editorStore: EditorStore,
442
451
  parentSuiteState: FunctionTestSuiteState,
@@ -847,6 +856,14 @@ export class FunctionTestSuiteState extends TestableTestSuiteEditorState {
847
856
 
848
857
  showCreateModal = false;
849
858
 
859
+ override get testableKind(): TESTABLE_KIND {
860
+ return TESTABLE_KIND.FUNCTION_ACTIVATOR;
861
+ }
862
+
863
+ override get testablePath(): string {
864
+ return this.functionTestableState.function.path;
865
+ }
866
+
850
867
  constructor(
851
868
  editorStore: EditorStore,
852
869
  functionTestableState: FunctionTestableState,
@@ -930,6 +947,14 @@ export class FunctionTestableState extends TestablePackageableElementEditorState
930
947
  createSuiteModal = false;
931
948
  cachedAccessors: Accessor[] = [];
932
949
 
950
+ override get testableKind(): TESTABLE_KIND {
951
+ return TESTABLE_KIND.FUNCTION_ACTIVATOR;
952
+ }
953
+
954
+ override get testablePath(): string {
955
+ return this.function.path;
956
+ }
957
+
933
958
  constructor(functionEditorState: FunctionEditorState) {
934
959
  super(functionEditorState, functionEditorState.functionElement);
935
960
  makeObservable(this, {
@@ -53,6 +53,7 @@ import {
53
53
  TestableTestEditorState,
54
54
  TestableTestSuiteEditorState,
55
55
  } from '../testable/TestableEditorState.js';
56
+ import { TESTABLE_KIND } from '../../../../../__lib__/LegendStudioTelemetryHelper.js';
56
57
  import type { EditorStore } from '../../../EditorStore.js';
57
58
  import type { IngestDefinitionEditorState } from './IngestDefinitionEditorState.js';
58
59
  import { RelationElementState } from '../data/EmbeddedDataState.js';
@@ -108,6 +109,14 @@ export class IngestTestState extends TestableTestEditorState {
108
109
  readonly uuid = uuid();
109
110
  testDataRelationState: RelationElementState | undefined;
110
111
 
112
+ override get testableKind(): TESTABLE_KIND {
113
+ return TESTABLE_KIND.INGEST;
114
+ }
115
+
116
+ override get testablePath(): string {
117
+ return this.suiteState.testableState.ingest.path;
118
+ }
119
+
111
120
  constructor(suiteState: IngestTestSuiteState, test: IngestMatViewTest) {
112
121
  super(
113
122
  suiteState.testableState.ingest,
@@ -342,6 +351,14 @@ export class IngestTestSuiteState extends TestableTestSuiteEditorState {
342
351
  testDataState: IngestTestDataState;
343
352
  readonly uuid = uuid();
344
353
 
354
+ override get testableKind(): TESTABLE_KIND {
355
+ return TESTABLE_KIND.INGEST;
356
+ }
357
+
358
+ override get testablePath(): string {
359
+ return this.testableState.ingest.path;
360
+ }
361
+
345
362
  constructor(
346
363
  editorStore: EditorStore,
347
364
  testableState: IngestTestableState,
@@ -87,6 +87,12 @@ import {
87
87
  isRelationalMappingTestSuite,
88
88
  } from './MappingTestingHelper.js';
89
89
  import { LEGEND_STUDIO_APP_EVENT } from '../../../../../../__lib__/LegendStudioEvent.js';
90
+ import {
91
+ LegendStudioTelemetryHelper,
92
+ TESTABLE_RUN_MODE,
93
+ TESTABLE_KIND,
94
+ summarizeTestResults,
95
+ } from '../../../../../../__lib__/LegendStudioTelemetryHelper.js';
90
96
 
91
97
  export class StoreTestDataState {
92
98
  readonly editorStore: EditorStore;
@@ -218,6 +224,14 @@ export class MappingTestState extends TestableTestEditorState {
218
224
  override test: MappingTest;
219
225
  dataState: MappingTestDataState;
220
226
 
227
+ override get testableKind(): TESTABLE_KIND {
228
+ return TESTABLE_KIND.MAPPING;
229
+ }
230
+
231
+ override get testablePath(): string {
232
+ return this.mappingTestableState.mapping.path;
233
+ }
234
+
221
235
  constructor(
222
236
  editorStore: EditorStore,
223
237
  parentSuiteState: MappingTestSuiteState,
@@ -348,6 +362,14 @@ export class MappingTestSuiteState extends TestableTestSuiteEditorState {
348
362
  showCreateModal = false;
349
363
  queryState: MappingTestSuiteQueryState;
350
364
 
365
+ override get testableKind(): TESTABLE_KIND {
366
+ return TESTABLE_KIND.MAPPING;
367
+ }
368
+
369
+ override get testablePath(): string {
370
+ return this.mappingTestableState.mapping.path;
371
+ }
372
+
351
373
  constructor(
352
374
  editorStore: EditorStore,
353
375
  mappingTestableState: MappingTestableState,
@@ -563,6 +585,14 @@ export class MappingTestableState extends TestablePackageableElementEditorState
563
585
  declare selectedTestSuite: MappingTestSuiteState | undefined;
564
586
  declare runningSuite: MappingTestSuite | undefined;
565
587
 
588
+ override get testableKind(): TESTABLE_KIND {
589
+ return TESTABLE_KIND.MAPPING;
590
+ }
591
+
592
+ override get testablePath(): string {
593
+ return this.mapping.path;
594
+ }
595
+
566
596
  constructor(mappingEditorState: MappingEditorState) {
567
597
  super(mappingEditorState, mappingEditorState.mapping);
568
598
  makeObservable(this, {
@@ -644,6 +674,19 @@ export class MappingTestableState extends TestablePackageableElementEditorState
644
674
  }
645
675
 
646
676
  override *runSuite(suite: MappingTestSuite): GeneratorFn<void> {
677
+ const telemetryBase = {
678
+ testableKind: this.testableKind,
679
+ testablePath: this.testablePath,
680
+ suiteId: suite.id,
681
+ mode: TESTABLE_RUN_MODE.RUN_SUITE,
682
+ testCount: suite.tests.length,
683
+ };
684
+ const startTime = Date.now();
685
+ LegendStudioTelemetryHelper.logEvent_TestableRunLaunched(
686
+ this.editorStore.applicationStore.telemetryService,
687
+ this.editorStore.editorMode.getSourceInfo(),
688
+ telemetryBase,
689
+ );
647
690
  try {
648
691
  this.runningSuite = suite;
649
692
  this.clearTestResultsForSuite(suite);
@@ -682,10 +725,24 @@ export class MappingTestableState extends TestablePackageableElementEditorState
682
725
  )) as TestResult[];
683
726
  }
684
727
  this.handleNewResults(testResults);
728
+ LegendStudioTelemetryHelper.logEvent_TestableRunSucceeded(
729
+ this.editorStore.applicationStore.telemetryService,
730
+ this.editorStore.editorMode.getSourceInfo(),
731
+ {
732
+ ...telemetryBase,
733
+ durationMs: Date.now() - startTime,
734
+ ...summarizeTestResults(testResults),
735
+ },
736
+ );
685
737
  } catch (error) {
686
738
  assertErrorThrown(error);
687
739
  this.editorStore.applicationStore.notificationService.notifyError(error);
688
740
  this.isRunningTestableSuitesState.fail();
741
+ LegendStudioTelemetryHelper.logEvent_TestableRunFailure(
742
+ this.editorStore.applicationStore.telemetryService,
743
+ this.editorStore.editorMode.getSourceInfo(),
744
+ { ...telemetryBase, errorMessage: error.message },
745
+ );
689
746
  } finally {
690
747
  this.selectedTestSuite?.testStates.forEach((t) =>
691
748
  t.runningTestAction.complete(),
@@ -32,6 +32,10 @@ import {
32
32
  compareSemVerVersions,
33
33
  } from '@finos/legend-shared';
34
34
  import { LEGEND_STUDIO_APP_EVENT } from '../../../../../__lib__/LegendStudioEvent.js';
35
+ import {
36
+ LegendStudioTelemetryHelper,
37
+ SERVICE_REGISTRATION_TRIGGER,
38
+ } from '../../../../../__lib__/LegendStudioTelemetryHelper.js';
35
39
  import {
36
40
  type Service,
37
41
  type PureExecution,
@@ -288,7 +292,16 @@ export class ServiceRegistrationState extends ServiceConfigState {
288
292
 
289
293
  *checkServiceRegistration(): GeneratorFn<void> {
290
294
  this.deploymentCheckState.inProgress();
295
+ const startedAt = Date.now();
296
+ const servicePath = this.service.path;
297
+ const sourceInfo = this.editorStore.editorMode.getSourceInfo();
298
+ LegendStudioTelemetryHelper.logEvent_ServiceRegistrationCheckLaunched(
299
+ this.editorStore.applicationStore.telemetryService,
300
+ sourceInfo,
301
+ { servicePath, envCount: this.registrationOptions.length },
302
+ );
291
303
  const envs: string[] = [];
304
+ let errorCount = 0;
292
305
  const servicePattern = this.service.pattern.startsWith('/')
293
306
  ? this.service.pattern.substring(1)
294
307
  : this.service.pattern;
@@ -304,19 +317,52 @@ export class ServiceRegistrationState extends ServiceConfigState {
304
317
  }
305
318
  } catch (error) {
306
319
  assertErrorThrown(error);
320
+ errorCount += 1;
307
321
  this.editorStore.applicationStore.logService.warn(
308
322
  LogEvent.create(
309
323
  LEGEND_STUDIO_APP_EVENT.SERVICE_REGISTRATION_CHECK_FAILURE,
310
324
  ),
311
325
  `Can't check registration status for env '${envConfig.env}': ${error.message}`,
312
326
  );
327
+ LegendStudioTelemetryHelper.logEvent_ServiceRegistrationCheckFailure(
328
+ this.editorStore.applicationStore.telemetryService,
329
+ sourceInfo,
330
+ {
331
+ servicePath,
332
+ env: envConfig.env,
333
+ errorMessage: error.message,
334
+ },
335
+ );
313
336
  }
314
337
  }
315
338
  this.setRegisteredEnvs(envs);
316
339
  this.deploymentCheckState.complete();
340
+ LegendStudioTelemetryHelper.logEvent_ServiceRegistrationCheckSucceeded(
341
+ this.editorStore.applicationStore.telemetryService,
342
+ sourceInfo,
343
+ {
344
+ servicePath,
345
+ envCount: this.registrationOptions.length,
346
+ durationMs: Date.now() - startedAt,
347
+ registeredEnvCount: envs.length,
348
+ errorCount,
349
+ },
350
+ );
317
351
  }
318
352
 
319
353
  *registerService(): GeneratorFn<void> {
354
+ const startedAt = Date.now();
355
+ const telemetryBase = {
356
+ trigger: SERVICE_REGISTRATION_TRIGGER.SINGLE,
357
+ executionMode: this.serviceExecutionMode,
358
+ serviceCount: 1,
359
+ activatePostRegistration: this.activatePostRegistration,
360
+ };
361
+ LegendStudioTelemetryHelper.logEvent_ServiceRegistrationLaunched(
362
+ this.editorStore.applicationStore.telemetryService,
363
+ this.editorStore.editorMode.getSourceInfo(),
364
+ telemetryBase,
365
+ );
320
366
  try {
321
367
  this.registrationState.inProgress();
322
368
  this.validateServiceForRegistration();
@@ -381,12 +427,22 @@ export class ServiceRegistrationState extends ServiceConfigState {
381
427
  },
382
428
  ],
383
429
  });
430
+ LegendStudioTelemetryHelper.logEvent_ServiceRegistrationSucceeded(
431
+ this.editorStore.applicationStore.telemetryService,
432
+ this.editorStore.editorMode.getSourceInfo(),
433
+ { ...telemetryBase, durationMs: Date.now() - startedAt },
434
+ );
384
435
  } catch (error) {
385
436
  assertErrorThrown(error);
386
437
  this.editorStore.applicationStore.logService.error(
387
438
  LogEvent.create(LEGEND_STUDIO_APP_EVENT.SERVICE_REGISTRATION_FAILURE),
388
439
  error,
389
440
  );
441
+ LegendStudioTelemetryHelper.logEvent_ServiceRegistrationFailure(
442
+ this.editorStore.applicationStore.telemetryService,
443
+ this.editorStore.editorMode.getSourceInfo(),
444
+ { ...telemetryBase, errorMessage: error.message },
445
+ );
390
446
  this.editorStore.applicationStore.notificationService.notifyError(error);
391
447
  } finally {
392
448
  this.registrationState.reset();
@@ -472,6 +472,11 @@ export class ConnectionTestDataState {
472
472
  this.generatingTestDataState.pass();
473
473
  } catch (error) {
474
474
  assertErrorThrown(error);
475
+ LegendStudioTelemetryHelper.logEvent_TestDataGenerationFailure(
476
+ this.editorStore.applicationStore.telemetryService,
477
+ this.editorStore.editorMode.getSourceInfo(),
478
+ error.message,
479
+ );
475
480
  this.editorStore.applicationStore.notificationService.notifyError(
476
481
  `Unable to generate test data: ${error.message}`,
477
482
  );
@@ -610,6 +615,11 @@ export class ConnectionTestDataState {
610
615
  this.generatingTestDataWithSeedDataState.pass();
611
616
  } catch (error) {
612
617
  assertErrorThrown(error);
618
+ LegendStudioTelemetryHelper.logEvent_TestDataGenerationFailure(
619
+ this.editorStore.applicationStore.telemetryService,
620
+ this.editorStore.editorMode.getSourceInfo(),
621
+ error.message,
622
+ );
613
623
  this.editorStore.applicationStore.notificationService.notifyError(
614
624
  `Unable to generate test data: ${error.message}`,
615
625
  );
@@ -30,6 +30,7 @@ import {
30
30
  TESTABLE_TEST_TAB,
31
31
  TestableTestEditorState,
32
32
  } from '../../testable/TestableEditorState.js';
33
+ import { TESTABLE_KIND } from '../../../../../../__lib__/LegendStudioTelemetryHelper.js';
33
34
  import type { ServiceTestSuiteState } from './ServiceTestableState.js';
34
35
  import {
35
36
  service_addAssertKeyForTest,
@@ -428,6 +429,14 @@ export class ServiceTestState extends TestableTestEditorState {
428
429
  override test: ServiceTest;
429
430
  override testable: Service;
430
431
  setupState: ServiceTestSetupState;
432
+
433
+ override get testableKind(): TESTABLE_KIND {
434
+ return TESTABLE_KIND.SERVICE;
435
+ }
436
+
437
+ override get testablePath(): string {
438
+ return this.testable.path;
439
+ }
431
440
  constructor(suiteState: ServiceTestSuiteState, test: ServiceTest) {
432
441
  super(
433
442
  suiteState.testableState.serviceEditorState.service,
@@ -66,6 +66,11 @@ import {
66
66
  SERIALIZATION_FORMAT,
67
67
  ServiceTestState,
68
68
  } from './ServiceTestEditorState.js';
69
+ import {
70
+ LegendStudioTelemetryHelper,
71
+ SERVICE_TEST_SUITE_RUN_MODE,
72
+ summarizeTestResults,
73
+ } from '../../../../../../__lib__/LegendStudioTelemetryHelper.js';
69
74
 
70
75
  const createEmptyServiceTestSuite = (
71
76
  serviceTestableState: ServiceTestableState,
@@ -186,15 +191,27 @@ export class ServiceTestSuiteState {
186
191
  }
187
192
 
188
193
  *runSuite(): GeneratorFn<void> {
194
+ const service = this.testableState.serviceEditorState.service;
195
+ const input = new RunTestsTestableInput(service);
196
+ input.unitTestIds = this.suite.tests.map(
197
+ (t) => new UniqueTestId(this.suite, t),
198
+ );
199
+ const telemetryData = {
200
+ servicePath: service.path,
201
+ suiteId: this.suite.id,
202
+ mode: SERVICE_TEST_SUITE_RUN_MODE.RUN_SUITE,
203
+ testCount: input.unitTestIds.length,
204
+ };
205
+ const startTime = Date.now();
206
+ LegendStudioTelemetryHelper.logEvent_ServiceTestSuiteRunLaunched(
207
+ this.editorStore.applicationStore.telemetryService,
208
+ this.editorStore.editorMode.getSourceInfo(),
209
+ telemetryData,
210
+ );
189
211
  try {
190
212
  this.runningTestState.inProgress();
191
213
  this.testStates.forEach((t) => t.resetResult());
192
214
  this.testStates.forEach((t) => t.runningTestAction.inProgress());
193
- const service = this.testableState.serviceEditorState.service;
194
- const input = new RunTestsTestableInput(service);
195
- input.unitTestIds = this.suite.tests.map(
196
- (t) => new UniqueTestId(this.suite, t),
197
- );
198
215
  const testResults =
199
216
  (yield this.editorStore.graphManagerState.graphManager.runTests(
200
217
  [input],
@@ -205,34 +222,60 @@ export class ServiceTestSuiteState {
205
222
  state?.handleTestResult(result);
206
223
  });
207
224
  this.runningTestState.complete();
225
+ LegendStudioTelemetryHelper.logEvent_ServiceTestSuiteRunSucceeded(
226
+ this.editorStore.applicationStore.telemetryService,
227
+ this.editorStore.editorMode.getSourceInfo(),
228
+ {
229
+ ...telemetryData,
230
+ durationMs: Date.now() - startTime,
231
+ ...summarizeTestResults(testResults),
232
+ },
233
+ );
208
234
  } catch (error) {
209
235
  assertErrorThrown(error);
210
236
  this.editorStore.applicationStore.notificationService.notifyError(error);
211
237
  this.runningTestState.fail();
238
+ LegendStudioTelemetryHelper.logEvent_ServiceTestSuiteRunFailure(
239
+ this.editorStore.applicationStore.telemetryService,
240
+ this.editorStore.editorMode.getSourceInfo(),
241
+ { ...telemetryData, errorMessage: error.message },
242
+ );
212
243
  } finally {
213
244
  this.testStates.forEach((t) => t.runningTestAction.complete());
214
245
  }
215
246
  }
216
247
 
217
248
  *runFailingTests(): GeneratorFn<void> {
249
+ const service = this.testableState.serviceEditorState.service;
250
+ const input = new RunTestsTestableInput(service);
251
+ input.unitTestIds = this.testStates
252
+ .map((testState) => {
253
+ const result = testState.testResultState.result;
254
+ if (
255
+ (result instanceof TestExecuted &&
256
+ result.testExecutionStatus === TestExecutionStatus.FAIL) ||
257
+ result instanceof TestError
258
+ ) {
259
+ testState.runningTestAction.inProgress();
260
+ return new UniqueTestId(this.suite, testState.test);
261
+ }
262
+ return undefined;
263
+ })
264
+ .filter(isNonNullable);
265
+ const telemetryData = {
266
+ servicePath: service.path,
267
+ suiteId: this.suite.id,
268
+ mode: SERVICE_TEST_SUITE_RUN_MODE.RUN_FAILING,
269
+ testCount: input.unitTestIds.length,
270
+ };
271
+ const startTime = Date.now();
272
+ LegendStudioTelemetryHelper.logEvent_ServiceTestSuiteRunLaunched(
273
+ this.editorStore.applicationStore.telemetryService,
274
+ this.editorStore.editorMode.getSourceInfo(),
275
+ telemetryData,
276
+ );
218
277
  try {
219
278
  this.runningTestState.inProgress();
220
- const service = this.testableState.serviceEditorState.service;
221
- const input = new RunTestsTestableInput(service);
222
- input.unitTestIds = this.testStates
223
- .map((testState) => {
224
- const result = testState.testResultState.result;
225
- if (
226
- (result instanceof TestExecuted &&
227
- result.testExecutionStatus === TestExecutionStatus.FAIL) ||
228
- result instanceof TestError
229
- ) {
230
- testState.runningTestAction.inProgress();
231
- return new UniqueTestId(this.suite, testState.test);
232
- }
233
- return undefined;
234
- })
235
- .filter(isNonNullable);
236
279
  const testResults =
237
280
  (yield this.editorStore.graphManagerState.graphManager.runTests(
238
281
  [input],
@@ -243,10 +286,24 @@ export class ServiceTestSuiteState {
243
286
  state?.handleTestResult(result);
244
287
  });
245
288
  this.runningTestState.complete();
289
+ LegendStudioTelemetryHelper.logEvent_ServiceTestSuiteRunSucceeded(
290
+ this.editorStore.applicationStore.telemetryService,
291
+ this.editorStore.editorMode.getSourceInfo(),
292
+ {
293
+ ...telemetryData,
294
+ durationMs: Date.now() - startTime,
295
+ ...summarizeTestResults(testResults),
296
+ },
297
+ );
246
298
  } catch (error) {
247
299
  assertErrorThrown(error);
248
300
  this.editorStore.applicationStore.notificationService.notifyError(error);
249
301
  this.runningTestState.fail();
302
+ LegendStudioTelemetryHelper.logEvent_ServiceTestSuiteRunFailure(
303
+ this.editorStore.applicationStore.telemetryService,
304
+ this.editorStore.editorMode.getSourceInfo(),
305
+ { ...telemetryData, errorMessage: error.message },
306
+ );
250
307
  } finally {
251
308
  this.testStates.forEach((t) => t.runningTestAction.complete());
252
309
  }