@spinnaker/core 0.27.0 → 0.28.0
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/CHANGELOG.md +13 -0
- package/dist/config/settings.d.ts +1 -0
- package/dist/domain/IOrchestratedItem.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/orchestratedItem/orchestratedItem.transformer.d.ts +5 -4
- package/package.json +3 -3
- package/src/config/settings.ts +1 -0
- package/src/domain/IOrchestratedItem.ts +1 -0
- package/src/orchestratedItem/orchestratedItem.transformer.ts +21 -13
- package/src/plugins/sharedLibraries.ts +5 -1
- package/src/presentation/CollapsibleElement.tsx +5 -3
|
@@ -2,11 +2,12 @@ export declare class OrchestratedItemTransformer {
|
|
|
2
2
|
static addRunningTime(item: any): void;
|
|
3
3
|
private static shouldReplace;
|
|
4
4
|
static defineProperties(item: any): void;
|
|
5
|
-
private static
|
|
6
|
-
private static
|
|
5
|
+
private static getFailureMessagesAsString;
|
|
6
|
+
private static getFailureMessages;
|
|
7
|
+
private static getOrchestrationExceptionMessage;
|
|
7
8
|
private static getLockFailureException;
|
|
8
|
-
private static
|
|
9
|
-
private static
|
|
9
|
+
private static getCustomExceptionMessage;
|
|
10
|
+
private static getGeneralExceptionMessages;
|
|
10
11
|
private static calculateRunningTime;
|
|
11
12
|
private static normalizeStatus;
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinnaker/core",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.28.0",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"publishConfig": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@graphql-codegen/typescript-operations": "^1.18.3",
|
|
93
93
|
"@graphql-codegen/typescript-react-apollo": "^2.3.0",
|
|
94
94
|
"@spinnaker/eslint-plugin": "^3.0.2",
|
|
95
|
-
"@spinnaker/scripts": "^0.
|
|
95
|
+
"@spinnaker/scripts": "^0.4.0",
|
|
96
96
|
"@types/angular": "1.6.26",
|
|
97
97
|
"@types/angular-mocks": "1.5.10",
|
|
98
98
|
"@types/angular-ui-bootstrap": "0.13.41",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"shx": "0.3.3",
|
|
124
124
|
"typescript": "4.3.5"
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "20d6ca89f39a5f44a802a1ccaffd669587450d76"
|
|
127
127
|
}
|
package/src/config/settings.ts
CHANGED
|
@@ -75,8 +75,11 @@ export class OrchestratedItemTransformer {
|
|
|
75
75
|
item.originalStatus = item.status;
|
|
76
76
|
|
|
77
77
|
Object.defineProperties(item, {
|
|
78
|
+
failureMessages: {
|
|
79
|
+
get: (): string[] => this.getFailureMessages(item),
|
|
80
|
+
},
|
|
78
81
|
failureMessage: {
|
|
79
|
-
get: (): string => this.
|
|
82
|
+
get: (): string => this.getFailureMessagesAsString(item),
|
|
80
83
|
},
|
|
81
84
|
isCompleted: {
|
|
82
85
|
get: (): boolean => ['SUCCEEDED', 'SKIPPED'].includes(item.status),
|
|
@@ -131,19 +134,23 @@ export class OrchestratedItemTransformer {
|
|
|
131
134
|
});
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
private static
|
|
135
|
-
const exceptions =
|
|
136
|
-
this.getCustomException(item),
|
|
137
|
-
this.getGeneralException(item),
|
|
138
|
-
this.getOrchestrationException(item),
|
|
139
|
-
].filter((it) => !!it);
|
|
137
|
+
private static getFailureMessagesAsString(item: any): string | null {
|
|
138
|
+
const exceptions = this.getFailureMessages(item);
|
|
140
139
|
if (exceptions.length === 0) {
|
|
141
140
|
return null;
|
|
142
141
|
}
|
|
143
142
|
return exceptions.join('\n\n');
|
|
144
143
|
}
|
|
145
144
|
|
|
146
|
-
private static
|
|
145
|
+
private static getFailureMessages(task: ITask): string[] {
|
|
146
|
+
return [
|
|
147
|
+
this.getCustomExceptionMessage(task),
|
|
148
|
+
...this.getGeneralExceptionMessages(task),
|
|
149
|
+
this.getOrchestrationExceptionMessage(task),
|
|
150
|
+
].filter((it) => !!it);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private static getOrchestrationExceptionMessage(task: ITask): string {
|
|
147
154
|
const katoTasks: any[] = task.getValueFor('kato.tasks');
|
|
148
155
|
if (katoTasks && katoTasks.length) {
|
|
149
156
|
const failedTask: any = katoTasks.find((t) => t.status && t.status.failed);
|
|
@@ -190,7 +197,7 @@ export class OrchestratedItemTransformer {
|
|
|
190
197
|
return null;
|
|
191
198
|
}
|
|
192
199
|
|
|
193
|
-
private static
|
|
200
|
+
private static getCustomExceptionMessage(task: ITask): string {
|
|
194
201
|
const generalException: any = task.getValueFor('exception');
|
|
195
202
|
if (generalException) {
|
|
196
203
|
if (generalException.exceptionType && generalException.exceptionType === 'LockFailureException') {
|
|
@@ -200,16 +207,17 @@ export class OrchestratedItemTransformer {
|
|
|
200
207
|
return null;
|
|
201
208
|
}
|
|
202
209
|
|
|
203
|
-
private static
|
|
210
|
+
private static getGeneralExceptionMessages(task: ITask): string[] {
|
|
204
211
|
const generalException: any = task.getValueFor('exception');
|
|
205
212
|
if (generalException) {
|
|
206
213
|
const errors = (generalException.details?.errors ?? []).filter((m: any) => !!m);
|
|
207
214
|
if (errors.length) {
|
|
208
|
-
return errors
|
|
215
|
+
return errors;
|
|
209
216
|
}
|
|
210
|
-
|
|
217
|
+
|
|
218
|
+
return generalException.details?.error ? [generalException.details.error] : [];
|
|
211
219
|
}
|
|
212
|
-
return
|
|
220
|
+
return [];
|
|
213
221
|
}
|
|
214
222
|
|
|
215
223
|
private static calculateRunningTime(item: IOrchestratedItem): () => number {
|
|
@@ -8,7 +8,6 @@ import * as reactDOM from 'react-dom';
|
|
|
8
8
|
import * as rxjs from 'rxjs';
|
|
9
9
|
|
|
10
10
|
import * as spinnakerCore from '../index';
|
|
11
|
-
|
|
12
11
|
export const sharedLibraries = {
|
|
13
12
|
// This is the global (window) variable that the shared libs will be exposed on
|
|
14
13
|
globalVariablePrefix: 'spinnaker.plugins.sharedLibraries',
|
|
@@ -30,7 +29,9 @@ export const sharedLibraries = {
|
|
|
30
29
|
if (destinationObject) {
|
|
31
30
|
// Temporarily expose @spinnaker/core.
|
|
32
31
|
// This should be removed at some point and replaced with a much smaller spinnaker/ui module which doesn't yet exist
|
|
32
|
+
exposeSharedLibrary('ajv', require('ajv'));
|
|
33
33
|
exposeSharedLibrary('@spinnaker/core', spinnakerCore);
|
|
34
|
+
exposeSharedLibrary('@spinnaker/kayenta', require('@spinnaker/kayenta'));
|
|
34
35
|
exposeSharedLibrary('@uirouter/core', uiRouterCore);
|
|
35
36
|
exposeSharedLibrary('@uirouter/react', uiRouterReact);
|
|
36
37
|
exposeSharedLibrary('@uirouter/rx', uiRouterRx);
|
|
@@ -38,6 +39,9 @@ export const sharedLibraries = {
|
|
|
38
39
|
exposeSharedLibrary('prop-types', propTypes);
|
|
39
40
|
exposeSharedLibrary('react', react);
|
|
40
41
|
exposeSharedLibrary('react-dom', reactDOM);
|
|
42
|
+
exposeSharedLibrary('react-redux', require('react-redux'));
|
|
43
|
+
exposeSharedLibrary('redux-actions', require('redux-actions'));
|
|
44
|
+
exposeSharedLibrary('reselect', require('reselect'));
|
|
41
45
|
exposeSharedLibrary('rxjs', rxjs);
|
|
42
46
|
exposeSharedLibrary('rxjs/Observable', { Observable: rxjs.Observable });
|
|
43
47
|
}
|
|
@@ -12,9 +12,11 @@ export const CollapsibleElement: React.FC<{ maxHeight: number }> = ({ children,
|
|
|
12
12
|
setIsOverflowing(contentRef.current.offsetHeight < contentRef.current.scrollHeight);
|
|
13
13
|
}, []);
|
|
14
14
|
|
|
15
|
-
React.
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
React.useLayoutEffect(() => {
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
checkIsOverflowing();
|
|
18
|
+
});
|
|
19
|
+
}, [checkIsOverflowing]);
|
|
18
20
|
|
|
19
21
|
React.useEffect(() => {
|
|
20
22
|
window.addEventListener('resize', checkIsOverflowing);
|