@spinnaker/kayenta 1.0.5 → 2.1.0-rc1

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 (64) hide show
  1. package/.github/workflows/ci-branch.yml +73 -0
  2. package/.github/workflows/publish_lib_test.yml +26 -0
  3. package/.husky/pre-commit +6 -0
  4. package/.lintstagedrc.json +4 -0
  5. package/build/dist/index-6aa5a1a4.js +2 -0
  6. package/build/dist/index-6aa5a1a4.js.map +1 -0
  7. package/build/dist/index.d.ts +1 -0
  8. package/build/dist/index.d.ts.map +1 -1
  9. package/build/dist/index.js +1 -38
  10. package/build/dist/index.js.map +1 -1
  11. package/build/dist/kayenta/canary.dataSource.bridge.d.ts +2 -0
  12. package/build/dist/kayenta/canary.dataSource.bridge.d.ts.map +1 -0
  13. package/build/dist/kayenta/canary.dataSource.stub.d.ts +9 -0
  14. package/build/dist/kayenta/canary.dataSource.stub.d.ts.map +1 -0
  15. package/build/dist/kayenta/edit/copyConfigButton.d.ts +1 -1
  16. package/build/dist/kayenta/edit/createConfigButton.d.ts +1 -1
  17. package/build/dist/kayenta/index.d.ts +0 -1
  18. package/build/dist/kayenta/index.d.ts.map +1 -1
  19. package/build/dist/kayenta/navigation/canary.states.d.ts +5 -1
  20. package/build/dist/kayenta/navigation/canary.states.d.ts.map +1 -1
  21. package/build/dist/kayenta/navigation/canary.states.stub.d.ts +4 -0
  22. package/build/dist/kayenta/navigation/canary.states.stub.d.ts.map +1 -0
  23. package/build/dist/kayenta/report/detail/graph/metricSetPairGraph.service.d.ts +1 -1
  24. package/build/dist/kayenta/report/detail/graph/metricSetPairGraph.service.d.ts.map +1 -1
  25. package/build/dist/kayenta/report/detail/graph/semiotic/index.d.ts.map +1 -1
  26. package/build/dist/kayenta/stages/kayentaStage/kayentaStage.d.ts +28 -1
  27. package/build/dist/kayenta/stages/kayentaStage/kayentaStage.d.ts.map +1 -1
  28. package/build/dist/kayenta/stages/kayentaStage/kayentaStage.transformer.d.ts +0 -1
  29. package/build/dist/kayenta/stages/kayentaStage/kayentaStage.transformer.d.ts.map +1 -1
  30. package/build/dist/lazy-94b6420d.js +2 -0
  31. package/build/dist/lazy-94b6420d.js.map +1 -0
  32. package/build/dist/lazy.d.ts +6 -0
  33. package/build/dist/lazy.d.ts.map +1 -0
  34. package/build/dist/semioticGraph-a9ade595.js +2 -0
  35. package/build/dist/semioticGraph-a9ade595.js.map +1 -0
  36. package/build/dist/stub.d.ts +15 -0
  37. package/build/dist/stub.d.ts.map +1 -0
  38. package/package.json +19 -16
  39. package/rollup.config.js +2 -0
  40. package/src/index.ts +1 -0
  41. package/src/kayenta/canary.dataSource.bridge.ts +53 -0
  42. package/src/kayenta/canary.dataSource.stub.ts +64 -0
  43. package/src/kayenta/index.ts +0 -1
  44. package/src/kayenta/navigation/canary.states.stub.ts +28 -0
  45. package/src/kayenta/navigation/canary.states.ts +158 -166
  46. package/src/kayenta/report/detail/graph/metricSetPairGraph.service.ts +1 -1
  47. package/src/kayenta/report/detail/graph/semiotic/index.tsx +19 -0
  48. package/src/kayenta/stages/kayentaStage/kayentaStage.transformer.ts +0 -4
  49. package/src/kayenta/stages/kayentaStage/kayentaStage.ts +150 -178
  50. package/src/lazy.ts +29 -0
  51. package/src/stub.ts +60 -0
  52. package/build/dist/kayenta/canary.dataSource.d.ts +0 -2
  53. package/build/dist/kayenta/canary.dataSource.d.ts.map +0 -1
  54. package/build/dist/kayenta/canary.module.d.ts +0 -5
  55. package/build/dist/kayenta/canary.module.d.ts.map +0 -1
  56. package/build/dist/kayenta/components/components.module.d.ts +0 -2
  57. package/build/dist/kayenta/components/components.module.d.ts.map +0 -1
  58. package/build/dist/kayenta/stages/stages.module.d.ts +0 -2
  59. package/build/dist/kayenta/stages/stages.module.d.ts.map +0 -1
  60. package/src/kayenta/canary.dataSource.ts +0 -131
  61. package/src/kayenta/canary.module.ts +0 -20
  62. package/src/kayenta/components/components.module.ts +0 -7
  63. package/src/kayenta/report/detail/graph/semiotic/index.ts +0 -10
  64. package/src/kayenta/stages/stages.module.ts +0 -6
@@ -1,4 +1,3 @@
1
- import { module } from 'angular';
2
1
  import { get, last, round } from 'lodash';
3
2
 
4
3
  import { Application, IExecution, IExecutionStage, ITransformer, OrchestratedItemTransformer } from '@spinnaker/core';
@@ -178,6 +177,3 @@ export class KayentaStageTransformer implements ITransformer {
178
177
  }
179
178
  }
180
179
  }
181
-
182
- export const KAYENTA_STAGE_TRANSFORMER = 'spinnaker.kayenta.kayentaStageTransformer';
183
- module(KAYENTA_STAGE_TRANSFORMER, []).service('kayentaStageTransformer', KayentaStageTransformer);
@@ -1,19 +1,11 @@
1
- import { module } from 'angular';
2
1
  import { CanarySettings } from 'kayenta/canary.settings';
3
- import { CANARY_SCORES_CONFIG_COMPONENT } from 'kayenta/components/canaryScores.component';
4
2
  import { IKayentaStage, KayentaAnalysisType } from 'kayenta/domain';
5
3
  import { getCanaryConfigById } from 'kayenta/service/canaryConfig.service';
6
4
  import { difference, get, has, isEmpty, isString, map, uniq } from 'lodash';
7
5
 
8
- import { IPipeline, Registry } from '@spinnaker/core';
6
+ import { IPipeline } from '@spinnaker/core';
9
7
 
10
8
  import { CanaryExecutionLabel } from './CanaryExecutionLabel';
11
- import { KAYENTA_ANALYSIS_TYPE_COMPONENT } from './analysisType.component';
12
- import { FOR_ANALYSIS_TYPE_COMPONENT } from './forAnalysisType.component';
13
- import { KayentaStageController } from './kayentaStage.controller';
14
- import { KAYENTA_STAGE_TRANSFORMER, KayentaStageTransformer } from './kayentaStage.transformer';
15
- import { KAYENTA_STAGE_CONFIG_SECTION } from './kayentaStageConfigSection.component';
16
- import { KAYENTA_STAGE_EXECUTION_DETAILS_CONTROLLER } from './kayentaStageExecutionDetails.controller';
17
9
 
18
10
  const isExpression = (value: string) => isString(value) && value.includes('${');
19
11
 
@@ -75,175 +67,155 @@ const allConfiguredScopesMustBeDefined = (_pipeline: IPipeline, stage: IKayentaS
75
67
  });
76
68
  };
77
69
 
78
- export const KAYENTA_CANARY_STAGE = 'spinnaker.kayenta.canaryStage';
79
- module(KAYENTA_CANARY_STAGE, [
80
- CANARY_SCORES_CONFIG_COMPONENT,
81
- KAYENTA_ANALYSIS_TYPE_COMPONENT,
82
- KAYENTA_STAGE_CONFIG_SECTION,
83
- KAYENTA_STAGE_TRANSFORMER,
84
- KAYENTA_STAGE_EXECUTION_DETAILS_CONTROLLER,
85
- FOR_ANALYSIS_TYPE_COMPONENT,
86
- ])
87
- .config(() => {
88
- 'ngInject';
89
- Registry.pipeline.registerStage({
90
- label: CanarySettings.stageName || 'Canary Analysis',
91
- description: CanarySettings.stageDescription || 'Runs a canary task',
92
- key: 'kayentaCanary',
93
- templateUrl: require('./kayentaStage.html'),
94
- controller: 'KayentaCanaryStageCtrl',
95
- controllerAs: 'kayentaCanaryStageCtrl',
96
- executionDetailsUrl: require('./kayentaStageExecutionDetails.html'),
97
- executionLabelComponent: CanaryExecutionLabel,
98
- validators: [
99
- { type: 'requiredField', fieldName: 'canaryConfig.canaryConfigId', fieldLabel: 'Config Name' },
100
- { type: 'requiredField', fieldName: 'canaryConfig.metricsAccountName', fieldLabel: 'Metrics Account' },
101
- { type: 'requiredField', fieldName: 'canaryConfig.storageAccountName', fieldLabel: 'Storage Account' },
102
- {
103
- type: 'custom',
104
- validate: requiredForAnalysisTypes(
105
- [KayentaAnalysisType.RealTimeAutomatic],
106
- 'deployments.serverGroupPairs[0].control',
107
- 'Baseline & Canary Server Groups',
108
- ),
109
- },
110
- {
111
- type: 'custom',
112
- validate: requiredForAnalysisTypes(
113
- [KayentaAnalysisType.RealTimeAutomatic],
114
- 'deployments.baseline.cluster',
115
- 'Baseline Cluster',
116
- ),
117
- },
118
- {
119
- type: 'custom',
120
- validate: requiredForAnalysisTypes(
121
- [KayentaAnalysisType.RealTimeAutomatic],
122
- 'deployments.baseline.account',
123
- 'Baseline Account',
124
- ),
125
- },
126
- {
127
- type: 'custom',
128
- validate: requiredForAnalysisTypes(
129
- [KayentaAnalysisType.RealTime, KayentaAnalysisType.Retrospective],
130
- 'canaryConfig.scopes[0].controlScope',
131
- 'Baseline Scope',
132
- ),
133
- },
134
- {
135
- type: 'custom',
136
- validate: requiredForAnalysisTypes(
137
- [KayentaAnalysisType.RealTime, KayentaAnalysisType.Retrospective],
138
- 'canaryConfig.scopes[0].experimentScope',
139
- 'Canary Scope',
140
- ),
141
- },
142
- {
143
- type: 'custom',
144
- validate: requiredForAnalysisTypes(
145
- [KayentaAnalysisType.RealTime, KayentaAnalysisType.RealTimeAutomatic],
146
- 'canaryConfig.lifetimeDuration',
147
- 'Lifetime',
148
- ),
149
- },
150
- {
151
- type: 'custom',
152
- validate: requiredForAnalysisTypes(
153
- [KayentaAnalysisType.Retrospective],
154
- 'canaryConfig.scopes[0].startTimeIso',
155
- 'Start Time',
156
- ),
157
- },
158
- {
159
- type: 'custom',
160
- validate: requiredForAnalysisTypes(
161
- [KayentaAnalysisType.Retrospective],
162
- 'canaryConfig.scopes[0].endTimeIso',
163
- 'End Time',
164
- ),
165
- },
166
- {
167
- type: 'custom',
168
- validate: (_pipeline: IPipeline, stage: IKayentaStage) => {
169
- if (
170
- !has(stage, 'canaryConfig.canaryConfigId') ||
171
- stage.analysisType === KayentaAnalysisType.RealTimeAutomatic
172
- ) {
173
- return null;
174
- }
70
+ export const kayentaCanaryStage = {
71
+ label: CanarySettings.stageName || 'Canary Analysis',
72
+ description: CanarySettings.stageDescription || 'Runs a canary task',
73
+ key: 'kayentaCanary',
74
+ templateUrl: require('./kayentaStage.html'),
75
+ controller: 'KayentaCanaryStageCtrl',
76
+ controllerAs: 'kayentaCanaryStageCtrl',
77
+ executionDetailsUrl: require('./kayentaStageExecutionDetails.html'),
78
+ executionLabelComponent: CanaryExecutionLabel,
79
+ validators: [
80
+ { type: 'requiredField', fieldName: 'canaryConfig.canaryConfigId', fieldLabel: 'Config Name' },
81
+ { type: 'requiredField', fieldName: 'canaryConfig.metricsAccountName', fieldLabel: 'Metrics Account' },
82
+ { type: 'requiredField', fieldName: 'canaryConfig.storageAccountName', fieldLabel: 'Storage Account' },
83
+ {
84
+ type: 'custom',
85
+ validate: requiredForAnalysisTypes(
86
+ [KayentaAnalysisType.RealTimeAutomatic],
87
+ 'deployments.serverGroupPairs[0].control',
88
+ 'Baseline & Canary Server Groups',
89
+ ),
90
+ },
91
+ {
92
+ type: 'custom',
93
+ validate: requiredForAnalysisTypes(
94
+ [KayentaAnalysisType.RealTimeAutomatic],
95
+ 'deployments.baseline.cluster',
96
+ 'Baseline Cluster',
97
+ ),
98
+ },
99
+ {
100
+ type: 'custom',
101
+ validate: requiredForAnalysisTypes(
102
+ [KayentaAnalysisType.RealTimeAutomatic],
103
+ 'deployments.baseline.account',
104
+ 'Baseline Account',
105
+ ),
106
+ },
107
+ {
108
+ type: 'custom',
109
+ validate: requiredForAnalysisTypes(
110
+ [KayentaAnalysisType.RealTime, KayentaAnalysisType.Retrospective],
111
+ 'canaryConfig.scopes[0].controlScope',
112
+ 'Baseline Scope',
113
+ ),
114
+ },
115
+ {
116
+ type: 'custom',
117
+ validate: requiredForAnalysisTypes(
118
+ [KayentaAnalysisType.RealTime, KayentaAnalysisType.Retrospective],
119
+ 'canaryConfig.scopes[0].experimentScope',
120
+ 'Canary Scope',
121
+ ),
122
+ },
123
+ {
124
+ type: 'custom',
125
+ validate: requiredForAnalysisTypes(
126
+ [KayentaAnalysisType.RealTime, KayentaAnalysisType.RealTimeAutomatic],
127
+ 'canaryConfig.lifetimeDuration',
128
+ 'Lifetime',
129
+ ),
130
+ },
131
+ {
132
+ type: 'custom',
133
+ validate: requiredForAnalysisTypes(
134
+ [KayentaAnalysisType.Retrospective],
135
+ 'canaryConfig.scopes[0].startTimeIso',
136
+ 'Start Time',
137
+ ),
138
+ },
139
+ {
140
+ type: 'custom',
141
+ validate: requiredForAnalysisTypes(
142
+ [KayentaAnalysisType.Retrospective],
143
+ 'canaryConfig.scopes[0].endTimeIso',
144
+ 'End Time',
145
+ ),
146
+ },
147
+ {
148
+ type: 'custom',
149
+ validate: (_pipeline: IPipeline, stage: IKayentaStage) => {
150
+ if (
151
+ !has(stage, 'canaryConfig.canaryConfigId') ||
152
+ stage.analysisType === KayentaAnalysisType.RealTimeAutomatic
153
+ ) {
154
+ return null;
155
+ }
175
156
 
176
- return getCanaryConfigById(get(stage, 'canaryConfig.canaryConfigId')).then((configDetails) => {
177
- if (
178
- get(configDetails, 'metrics[0].query.type') === 'atlas' &&
179
- !get(stage, 'canaryConfig.scopes[0].extendedScopeParams.type')
180
- ) {
181
- return 'Scope Type is required';
182
- } else {
183
- return null;
184
- }
185
- });
186
- },
187
- },
188
- {
189
- type: 'custom',
190
- validate: allScopesMustBeConfigured,
191
- },
192
- {
193
- type: 'custom',
194
- validate: allConfiguredScopesMustBeDefined,
195
- },
196
- {
197
- type: 'custom',
198
- validate: (_pipeline: IPipeline, { canaryConfig }: IKayentaStage) => {
199
- if (!CanarySettings.legacySiteLocalFieldsEnabled) {
200
- return null;
201
- }
202
- const notificationEmail = get(canaryConfig, 'siteLocal.notificationEmail');
203
- if (!notificationEmail) {
204
- return null;
205
- }
206
- const emails = Array.isArray(notificationEmail) ? notificationEmail : [notificationEmail];
207
- const invalidEmail = emails.find((email) => !isValidEmail(email));
208
- return invalidEmail ? `Invalid <strong>Notification Email</strong> (${invalidEmail})` : null;
209
- },
210
- },
211
- {
212
- type: 'custom',
213
- validate: (_pipeline: IPipeline, stage: IKayentaStage) => {
214
- const startTime: string = get(stage, 'canaryConfig.scopes[0].startTimeIso');
215
- if (
216
- stage.analysisType === KayentaAnalysisType.Retrospective &&
217
- !isEmpty(startTime) &&
218
- !isValidUtcInstant(startTime)
219
- ) {
220
- return '<strong>Start Time</strong> must be formatted as a UTC instant using ISO-8601 instant format (e.g., 2018-07-12T20:28:29Z).';
221
- }
157
+ return getCanaryConfigById(get(stage, 'canaryConfig.canaryConfigId')).then((configDetails) => {
158
+ if (
159
+ get(configDetails, 'metrics[0].query.type') === 'atlas' &&
160
+ !get(stage, 'canaryConfig.scopes[0].extendedScopeParams.type')
161
+ ) {
162
+ return 'Scope Type is required';
163
+ } else {
222
164
  return null;
223
- },
224
- },
225
- {
226
- type: 'custom',
227
- validate: (_pipeline: IPipeline, stage: IKayentaStage) => {
228
- const endTime: string = get(stage, 'canaryConfig.scopes[0].endTimeIso');
229
- if (
230
- stage.analysisType === KayentaAnalysisType.Retrospective &&
231
- !isEmpty(endTime) &&
232
- !isValidUtcInstant(endTime)
233
- ) {
234
- return '<strong>End Time</strong> must be formatted as a UTC instant using ISO-8601 instant format (e.g., 2018-07-12T20:28:29Z).';
235
- }
236
- return null;
237
- },
238
- },
239
- ],
240
- });
241
- })
242
- .controller('KayentaCanaryStageCtrl', KayentaStageController)
243
- .run([
244
- 'kayentaStageTransformer',
245
- (kayentaStageTransformer: KayentaStageTransformer) => {
246
- 'ngInject';
247
- Registry.pipeline.registerTransformer(kayentaStageTransformer);
165
+ }
166
+ });
167
+ },
168
+ },
169
+ {
170
+ type: 'custom',
171
+ validate: allScopesMustBeConfigured,
172
+ },
173
+ {
174
+ type: 'custom',
175
+ validate: allConfiguredScopesMustBeDefined,
176
+ },
177
+ {
178
+ type: 'custom',
179
+ validate: (_pipeline: IPipeline, { canaryConfig }: IKayentaStage) => {
180
+ if (!CanarySettings.legacySiteLocalFieldsEnabled) {
181
+ return null;
182
+ }
183
+ const notificationEmail = get(canaryConfig, 'siteLocal.notificationEmail');
184
+ if (!notificationEmail) {
185
+ return null;
186
+ }
187
+ const emails = Array.isArray(notificationEmail) ? notificationEmail : [notificationEmail];
188
+ const invalidEmail = emails.find((email) => !isValidEmail(email));
189
+ return invalidEmail ? `Invalid <strong>Notification Email</strong> (${invalidEmail})` : null;
190
+ },
248
191
  },
249
- ]);
192
+ {
193
+ type: 'custom',
194
+ validate: (_pipeline: IPipeline, stage: IKayentaStage) => {
195
+ const startTime: string = get(stage, 'canaryConfig.scopes[0].startTimeIso');
196
+ if (
197
+ stage.analysisType === KayentaAnalysisType.Retrospective &&
198
+ !isEmpty(startTime) &&
199
+ !isValidUtcInstant(startTime)
200
+ ) {
201
+ return '<strong>Start Time</strong> must be formatted as a UTC instant using ISO-8601 instant format (e.g., 2018-07-12T20:28:29Z).';
202
+ }
203
+ return null;
204
+ },
205
+ },
206
+ {
207
+ type: 'custom',
208
+ validate: (_pipeline: IPipeline, stage: IKayentaStage) => {
209
+ const endTime: string = get(stage, 'canaryConfig.scopes[0].endTimeIso');
210
+ if (
211
+ stage.analysisType === KayentaAnalysisType.Retrospective &&
212
+ !isEmpty(endTime) &&
213
+ !isValidUtcInstant(endTime)
214
+ ) {
215
+ return '<strong>End Time</strong> must be formatted as a UTC instant using ISO-8601 instant format (e.g., 2018-07-12T20:28:29Z).';
216
+ }
217
+ return null;
218
+ },
219
+ },
220
+ ],
221
+ };
package/src/lazy.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { UIRouter } from '@uirouter/core';
2
+ import 'kayenta/metricStore/index';
3
+ import 'kayenta/report/detail/graph/semiotic';
4
+
5
+ import { ApplicationStateProvider } from '@spinnaker/core';
6
+
7
+ // This import has a side effect of instantiating the canary redux store
8
+ import { bridgeKayentaDataSourceToReduxStore } from './kayenta/canary.dataSource.bridge';
9
+ import { registerStates, registerTransitionHooks } from './kayenta/navigation/canary.states';
10
+
11
+ export function lazyInitializeKayenta(applicationState: ApplicationStateProvider, uiRouter: UIRouter) {
12
+ const { stateRegistry } = uiRouter;
13
+
14
+ // deregister the stub states, starting with the deepest children first
15
+ stateRegistry
16
+ .get()
17
+ .filter((state) => state.name.match(/home.(project|applications).application.canary/))
18
+ .sort((a, b) => b.name.length - a.name.length)
19
+ .forEach((stub) => stateRegistry.deregister(stub));
20
+
21
+ // Now register the full states
22
+ registerStates(uiRouter, applicationState);
23
+ registerTransitionHooks(uiRouter);
24
+
25
+ // Patch the data source so data flows into the redux store
26
+ bridgeKayentaDataSourceToReduxStore();
27
+
28
+ return {};
29
+ }
package/src/stub.ts ADDED
@@ -0,0 +1,60 @@
1
+ import { UIRouter } from '@uirouter/core';
2
+ import { module } from 'angular';
3
+ import { registerKayentaDataSourceStubs } from 'kayenta/canary.dataSource.stub';
4
+ import 'kayenta/canary.help';
5
+ import { CanarySettings } from 'kayenta/canary.settings';
6
+ import { registerKayentaStateStubs } from 'kayenta/navigation/canary.states.stub';
7
+
8
+ import { ApplicationStateProvider, Registry } from '@spinnaker/core';
9
+
10
+ import { CANARY_SCORE_COMPONENT } from './kayenta/components/canaryScore.component';
11
+ import { CANARY_SCORES_CONFIG_COMPONENT } from './kayenta/components/canaryScores.component';
12
+ import { KAYENTA_ANALYSIS_TYPE_COMPONENT } from './kayenta/stages/kayentaStage/analysisType.component';
13
+ import { FOR_ANALYSIS_TYPE_COMPONENT } from './kayenta/stages/kayentaStage/forAnalysisType.component';
14
+ import { kayentaCanaryStage } from './kayenta/stages/kayentaStage/kayentaStage';
15
+ import { KayentaStageController } from './kayenta/stages/kayentaStage/kayentaStage.controller';
16
+ import { KayentaStageTransformer } from './kayenta/stages/kayentaStage/kayentaStage.transformer';
17
+ import { KAYENTA_STAGE_CONFIG_SECTION } from './kayenta/stages/kayentaStage/kayentaStageConfigSection.component';
18
+ import { KAYENTA_STAGE_EXECUTION_DETAILS_CONTROLLER } from './kayenta/stages/kayentaStage/kayentaStageExecutionDetails.controller';
19
+
20
+ /**
21
+ * This is the stub for Kayenta in deck
22
+ *
23
+ * - Registers all AngularJS components and controllers
24
+ * - Registers the full Kayenta Stage with Deck
25
+ * - Registers STUB routes for canary configs and canary reports (see: registerKayentaStateStubs)
26
+ * - These stub routes are names and URLs only
27
+ * - A lazyLoad router hook runs when the user navigates to a stub route and loads the remainder of Kayenta
28
+ * - Registers a DataSource that fetches kayenta canary/report data (and provides the nav items)
29
+ *
30
+ * See: lazy.ts for what happens next
31
+ */
32
+
33
+ export const KAYENTA_MODULE = 'spinnaker.kayenta';
34
+
35
+ if (CanarySettings.featureDisabled) {
36
+ module(KAYENTA_MODULE, []);
37
+ } else {
38
+ module(KAYENTA_MODULE, [
39
+ 'ui.router',
40
+ CANARY_SCORES_CONFIG_COMPONENT,
41
+ CANARY_SCORE_COMPONENT,
42
+ FOR_ANALYSIS_TYPE_COMPONENT,
43
+ KAYENTA_ANALYSIS_TYPE_COMPONENT,
44
+ KAYENTA_STAGE_CONFIG_SECTION,
45
+ KAYENTA_STAGE_EXECUTION_DETAILS_CONTROLLER,
46
+ ])
47
+ .controller('KayentaCanaryStageCtrl', KayentaStageController)
48
+ .run([
49
+ '$uiRouter',
50
+ 'applicationState',
51
+ function ($uiRouter: UIRouter, applicationState: ApplicationStateProvider) {
52
+ registerKayentaDataSourceStubs();
53
+ registerKayentaStateStubs(applicationState, $uiRouter);
54
+ if (CanarySettings.stagesEnabled !== false) {
55
+ Registry.pipeline.registerStage(kayentaCanaryStage);
56
+ Registry.pipeline.registerTransformer(new KayentaStageTransformer());
57
+ }
58
+ },
59
+ ]);
60
+ }
@@ -1,2 +0,0 @@
1
- export declare const CANARY_DATA_SOURCE = "spinnaker.kayenta.canary.dataSource";
2
- //# sourceMappingURL=canary.dataSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"canary.dataSource.d.ts","sourceRoot":"","sources":["../../../src/kayenta/canary.dataSource.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,kBAAkB,wCAAwC,CAAC"}
@@ -1,5 +0,0 @@
1
- import 'kayenta/canary.help';
2
- import 'kayenta/metricStore/index';
3
- import 'kayenta/report/detail/graph/semiotic';
4
- export declare const KAYENTA_MODULE = "spinnaker.kayenta";
5
- //# sourceMappingURL=canary.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"canary.module.d.ts","sourceRoot":"","sources":["../../../src/kayenta/canary.module.ts"],"names":[],"mappings":"AAEA,OAAO,qBAAqB,CAAC;AAG7B,OAAO,2BAA2B,CAAC;AAEnC,OAAO,sCAAsC,CAAC;AAK9C,eAAO,MAAM,cAAc,sBAAsB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const CANARY_COMPONENTS = "spinnaker.kayenta.components.module";
2
- //# sourceMappingURL=components.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.module.d.ts","sourceRoot":"","sources":["../../../../src/kayenta/components/components.module.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,wCAAwC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const CANARY_STAGES = "spinnaker.kayenta.stages.module";
2
- //# sourceMappingURL=stages.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stages.module.d.ts","sourceRoot":"","sources":["../../../../src/kayenta/stages/stages.module.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,oCAAoC,CAAC"}
@@ -1,131 +0,0 @@
1
- import { IQService, module } from 'angular';
2
- import { CanarySettings } from 'kayenta/canary.settings';
3
-
4
- import { Application, ApplicationDataSourceRegistry } from '@spinnaker/core';
5
-
6
- import * as Creators from './actions/creators';
7
- import { canaryStore } from './canary';
8
- import { ICanaryExecutionStatusResult } from './domain/ICanaryExecutionStatusResult';
9
- import { ICanaryConfigSummary, IJudge } from './domain/index';
10
- import { getCanaryConfigSummaries, listJudges } from './service/canaryConfig.service';
11
- import { listCanaryExecutions } from './service/canaryRun.service';
12
-
13
- export const CANARY_DATA_SOURCE = 'spinnaker.kayenta.canary.dataSource';
14
- module(CANARY_DATA_SOURCE, []).run([
15
- '$q',
16
- ($q: IQService) => {
17
- 'ngInject';
18
-
19
- if (CanarySettings.featureDisabled) {
20
- return;
21
- }
22
-
23
- // TODO: IDataSourceConfig expects an IPromise (not a Promise) from the loaders in this function, which is why we're using $q.resolve(...).
24
- const loadCanaryConfigs = (application: Application) => {
25
- const request = CanarySettings.showAllConfigs
26
- ? getCanaryConfigSummaries()
27
- : getCanaryConfigSummaries(application.name);
28
- return $q.resolve(request);
29
- };
30
-
31
- const configsLoaded = (_application: Application, summaries: ICanaryConfigSummary[]) => {
32
- return $q.resolve(summaries);
33
- };
34
-
35
- const afterConfigsLoad = (application: Application) => {
36
- if (application !== canaryStore.getState().data.application) {
37
- return;
38
- }
39
- canaryStore.dispatch(
40
- Creators.updateConfigSummaries({
41
- configSummaries: application.getDataSource('canaryConfigs').data as ICanaryConfigSummary[],
42
- }),
43
- );
44
- };
45
-
46
- ApplicationDataSourceRegistry.registerDataSource({
47
- optIn: !CanarySettings.optInAll,
48
- optional: true,
49
- loader: loadCanaryConfigs,
50
- onLoad: configsLoaded,
51
- afterLoad: afterConfigsLoad,
52
- description: 'Canary analysis configuration and reporting',
53
- key: 'canaryConfigs',
54
- label: 'Canary',
55
- defaultData: [],
56
- });
57
-
58
- const loadCanaryJudges = () => $q.resolve(listJudges());
59
-
60
- const judgesLoaded = (_application: Application, judges: IJudge[]) => {
61
- return $q.resolve(judges);
62
- };
63
-
64
- const afterJudgesLoad = (application: Application) => {
65
- if (application !== canaryStore.getState().data.application) {
66
- return;
67
- }
68
- canaryStore.dispatch(
69
- Creators.updateJudges({
70
- judges: application.getDataSource('canaryJudges').data as IJudge[],
71
- }),
72
- );
73
- };
74
-
75
- ApplicationDataSourceRegistry.registerDataSource({
76
- key: 'canaryJudges',
77
- label: 'Canary Configs',
78
- sref: '.canary.canaryConfig',
79
- activeState: '**.canaryConfig.**',
80
- category: 'delivery',
81
- requiresDataSource: 'canaryConfigs',
82
- loader: loadCanaryJudges,
83
- onLoad: judgesLoaded,
84
- afterLoad: afterJudgesLoad,
85
- lazy: true,
86
- autoActivate: true,
87
- defaultData: [],
88
- iconName: 'spMenuCanaryConfig',
89
- });
90
-
91
- const loadCanaryExecutions = (application: Application) => {
92
- const listExecutionsRequest = listCanaryExecutions(application.name);
93
-
94
- listExecutionsRequest.catch((error) => {
95
- canaryStore.dispatch(Creators.loadExecutionsFailure({ error }));
96
- });
97
-
98
- return $q.resolve(listExecutionsRequest);
99
- };
100
-
101
- const canaryExecutionsLoaded = (_application: Application, executions: ICanaryExecutionStatusResult[]) => {
102
- return $q.resolve(executions);
103
- };
104
-
105
- const afterCanaryExecutionsLoaded = (application: Application) => {
106
- if (application !== canaryStore.getState().data.application) {
107
- return;
108
- }
109
- canaryStore.dispatch(
110
- Creators.loadExecutionsSuccess({
111
- executions: application.getDataSource('canaryExecutions').data as ICanaryExecutionStatusResult[],
112
- }),
113
- );
114
- };
115
-
116
- ApplicationDataSourceRegistry.registerDataSource({
117
- key: 'canaryExecutions',
118
- label: 'Canary Reports',
119
- sref: '.canary.report',
120
- activeState: '**.report.**',
121
- category: 'delivery',
122
- requiresDataSource: 'canaryConfigs',
123
- loader: loadCanaryExecutions,
124
- onLoad: canaryExecutionsLoaded,
125
- afterLoad: afterCanaryExecutionsLoaded,
126
- lazy: true,
127
- defaultData: [],
128
- iconName: 'spMenuCanaryReport',
129
- });
130
- },
131
- ]);
@@ -1,20 +0,0 @@
1
- import { module } from 'angular';
2
- import { CANARY_DATA_SOURCE } from 'kayenta/canary.dataSource';
3
- import 'kayenta/canary.help';
4
- import { CanarySettings } from 'kayenta/canary.settings';
5
- import { CANARY_COMPONENTS } from 'kayenta/components/components.module';
6
- import 'kayenta/metricStore/index';
7
- import { CANARY_STATES } from 'kayenta/navigation/canary.states';
8
- import 'kayenta/report/detail/graph/semiotic';
9
- import { CANARY_STAGES } from 'kayenta/stages/stages.module';
10
-
11
- const modules = [CANARY_COMPONENTS, CANARY_DATA_SOURCE, CANARY_STATES];
12
-
13
- export const KAYENTA_MODULE = 'spinnaker.kayenta';
14
- if (CanarySettings.featureDisabled) {
15
- module(KAYENTA_MODULE, []);
16
- } else if (CanarySettings.stagesEnabled === false) {
17
- module(KAYENTA_MODULE, modules);
18
- } else {
19
- module(KAYENTA_MODULE, [CANARY_STAGES, ...modules]);
20
- }
@@ -1,7 +0,0 @@
1
- import { module } from 'angular';
2
-
3
- import { CANARY_SCORE_COMPONENT } from './canaryScore.component';
4
- import { CANARY_SCORES_CONFIG_COMPONENT } from './canaryScores.component';
5
-
6
- export const CANARY_COMPONENTS = 'spinnaker.kayenta.components.module';
7
- module(CANARY_COMPONENTS, [CANARY_SCORE_COMPONENT, CANARY_SCORES_CONFIG_COMPONENT]);
@@ -1,10 +0,0 @@
1
- import { GraphType, metricSetPairGraphService } from '../metricSetPairGraph.service';
2
- import SemioticGraph from './semioticGraph';
3
-
4
- const supportedGraphTypes: GraphType[] = [GraphType.TimeSeries, GraphType.Histogram, GraphType.BoxPlot];
5
- // Semiotic component registration
6
- metricSetPairGraphService.register({
7
- name: 'semiotic',
8
- handlesGraphType: (type) => supportedGraphTypes.includes(type),
9
- getGraph: () => SemioticGraph,
10
- });