fba-cli 1.0.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/README.md +101 -0
- package/dist/adltRemoteClient.js +430 -0
- package/dist/adltRemoteClient.js.map +1 -0
- package/dist/cmdExec.js +452 -0
- package/dist/cmdExec.js.map +1 -0
- package/dist/execReport.js +155 -0
- package/dist/execReport.js.map +1 -0
- package/dist/fbaFormat.js +434 -0
- package/dist/fbaFormat.js.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/remote_types.js +504 -0
- package/dist/remote_types.js.map +1 -0
- package/dist/util.js +26 -0
- package/dist/util.js.map +1 -0
- package/jest.config.ts +9 -0
- package/package.json +62 -0
package/dist/cmdExec.js
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* todos:
|
|
3
|
+
* [] add lifecycle summary/table to report
|
|
4
|
+
* [] add glob support for files passed as arguments
|
|
5
|
+
* [] add option to include matching messages in a collapsable section
|
|
6
|
+
* [] support markdown description from fba instructions and backgroundDescription
|
|
7
|
+
* [] add support for reports (either as html embedded or as non interactive pngs)
|
|
8
|
+
* [] support junit xml output format
|
|
9
|
+
*/
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
import os from 'os';
|
|
12
|
+
import crypto from 'crypto';
|
|
13
|
+
import { default as JSON5 } from 'json5';
|
|
14
|
+
import { default as jp } from 'jsonpath';
|
|
15
|
+
import chalk from 'chalk';
|
|
16
|
+
import { MultiBar } from 'cli-progress';
|
|
17
|
+
import { AdltRemoteClient, getAdltProcessAndPort } from './adltRemoteClient.js';
|
|
18
|
+
import { getFBDataFromText, rqUriDecode } from './fbaFormat.js';
|
|
19
|
+
import { fbReportToMdast, hideBadge2Value, hideBadgeValue, } from './execReport.js';
|
|
20
|
+
import { inspect } from 'unist-util-inspect';
|
|
21
|
+
import { filter } from 'unist-util-filter';
|
|
22
|
+
import { assert as mdassert } from 'mdast-util-assert';
|
|
23
|
+
import { toMarkdown } from 'mdast-util-to-markdown';
|
|
24
|
+
import path from 'path';
|
|
25
|
+
import { sleep } from './util.js';
|
|
26
|
+
const error = chalk.bold.red;
|
|
27
|
+
const warning = chalk.bold.yellow;
|
|
28
|
+
export const cmdExec = async (files, options) => {
|
|
29
|
+
// console.log('cmdExec', files, options)
|
|
30
|
+
const fbaFiles = [];
|
|
31
|
+
const nonFbaFiles = [];
|
|
32
|
+
// load json config?
|
|
33
|
+
let pluginCfgs = JSON.stringify([]);
|
|
34
|
+
if (options.config) {
|
|
35
|
+
try {
|
|
36
|
+
const config = JSON5.parse(fs.readFileSync(options.config, 'utf-8'));
|
|
37
|
+
const plugins = config['dlt-logs.plugins'];
|
|
38
|
+
if (plugins && Array.isArray(plugins)) {
|
|
39
|
+
pluginCfgs = JSON.stringify(config['dlt-logs.plugins']);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.log(error(`No 'dlt-logs.plugins' config array in config file '${options.config}'!`));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
console.log(error(`failed to load config file '${options.config}'! Got error:${e}`));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const sortOrderByTime = 'sortOrderByTime' in options ? !!options.sortOrderByTime : true;
|
|
52
|
+
for (const file of files) {
|
|
53
|
+
// check whether file exists otherwise apply glob pattern first todo
|
|
54
|
+
if (file.endsWith('.fba')) {
|
|
55
|
+
fbaFiles.push(file);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
nonFbaFiles.push(file);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// console.log('exec: fba files:', fbaFiles)
|
|
62
|
+
// console.log('exec: non fba files:', nonFbaFiles)
|
|
63
|
+
if (fbaFiles.length === 0) {
|
|
64
|
+
console.log(warning('no fba files found!'));
|
|
65
|
+
if (nonFbaFiles.length > 0) {
|
|
66
|
+
console.log(warning(`Dont' know what to do with the other ${nonFbaFiles.length} files!`));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
//console.log('exec: processing...')
|
|
71
|
+
const multibar = new MultiBar({
|
|
72
|
+
clearOnComplete: false,
|
|
73
|
+
hideCursor: true,
|
|
74
|
+
format: ' {bar} | {percentage}% | {value}/{total} | {file}',
|
|
75
|
+
});
|
|
76
|
+
const barAdlt = multibar.create(5, 0, { file: 'starting adlt' });
|
|
77
|
+
const barMsgsLoadedOptions = {
|
|
78
|
+
format: ' {duration}s | {total} msgs read',
|
|
79
|
+
};
|
|
80
|
+
const barMsgsLoaded = multibar.create(0, 0, {}, barMsgsLoadedOptions);
|
|
81
|
+
const barFbas = multibar.create(fbaFiles.length, 0);
|
|
82
|
+
const barQueries = multibar.create(0, 0, { file: 'queries' });
|
|
83
|
+
const fileBasedMsgsHandler = (msg) => {
|
|
84
|
+
try {
|
|
85
|
+
switch (msg.tag) {
|
|
86
|
+
case 'FileInfo':
|
|
87
|
+
const fi = msg.value;
|
|
88
|
+
barMsgsLoaded.setTotal(fi.nr_msgs);
|
|
89
|
+
break;
|
|
90
|
+
case 'Lifecycles':
|
|
91
|
+
const li = msg.value;
|
|
92
|
+
//multibar.log(`Got ${li.length} lifecycles ${char4U32LeToString(li[0]?.ecu || 0)}\n`)
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
console.warn(`fileBasedMsgsHandler got error:${e}\n`);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const adltClient = new AdltRemoteClient(fileBasedMsgsHandler);
|
|
101
|
+
// start adlt
|
|
102
|
+
multibar.log(`Starting/connecting to adlt...\n`);
|
|
103
|
+
let adltWssPort;
|
|
104
|
+
let adltProcess;
|
|
105
|
+
if (options.port) {
|
|
106
|
+
adltWssPort = options.port;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// try to start adlt locally and set the port variable:
|
|
110
|
+
// todo for now output to tmpdir file (for later provide better solution)
|
|
111
|
+
const adltOut = path.join(os.tmpdir(), `fba-cli.adlt-out.${crypto.randomBytes(16).toString('hex')}.txt`);
|
|
112
|
+
multibar.log(`adlt console output file:'${adltOut}'\n`);
|
|
113
|
+
//console.error(`tmpDir=${adltOut}`)
|
|
114
|
+
await getAdltProcessAndPort('adlt', fs.createWriteStream(adltOut /*os.devNull*/)).then(({ hostAndPort, process }) => {
|
|
115
|
+
adltWssPort = hostAndPort;
|
|
116
|
+
adltProcess = process;
|
|
117
|
+
}, (e) => {
|
|
118
|
+
console.log(error(`Failed to start adlt! Got error:${e}`));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (!adltWssPort) {
|
|
122
|
+
multibar.stop();
|
|
123
|
+
console.log(error(`No adlt remote host:port to use! Please ensure that adlt is running and provide the port via the -p option or have adlt in path and don't provide the -p option!`));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
let report;
|
|
127
|
+
// todo add parameter!
|
|
128
|
+
barAdlt.increment(1, { file: 'adlt connecting' });
|
|
129
|
+
adltClient
|
|
130
|
+
.connectToWebSocket(`ws://${adltWssPort}`)
|
|
131
|
+
.then(async (adltVersion) => {
|
|
132
|
+
//multibar.log(`Connected to adlt...\n`)
|
|
133
|
+
barAdlt.increment(1, { file: 'adlt connected' });
|
|
134
|
+
// open files
|
|
135
|
+
await adltClient
|
|
136
|
+
.sendAndRecvAdltMsg(`open {"sort":${sortOrderByTime},"files":${JSON.stringify(nonFbaFiles)},"plugins":${pluginCfgs}}`)
|
|
137
|
+
.then(async (response) => {
|
|
138
|
+
report = {
|
|
139
|
+
type: 'FbaExecReport',
|
|
140
|
+
data: {
|
|
141
|
+
date: new Date().toISOString(),
|
|
142
|
+
adltVersion,
|
|
143
|
+
files: nonFbaFiles,
|
|
144
|
+
pluginCfgs,
|
|
145
|
+
},
|
|
146
|
+
children: [],
|
|
147
|
+
};
|
|
148
|
+
// todo check response
|
|
149
|
+
// multibar.log(`Opened files...\n`)
|
|
150
|
+
barAdlt.increment(1, { file: 'adlt files opened' });
|
|
151
|
+
// load dlt files
|
|
152
|
+
multibar.log(`Processing DLT files...\n`);
|
|
153
|
+
// todo currently adlt doesn't indicate once it finished loading the files.
|
|
154
|
+
// so for now we do wait 2s until the msg.total don't change any more
|
|
155
|
+
let lastTotal = barAdlt.getTotal();
|
|
156
|
+
for (let i = 0; i < 1000; i++) {
|
|
157
|
+
await sleep(2000);
|
|
158
|
+
const curTotal = barAdlt.getTotal();
|
|
159
|
+
if (lastTotal === curTotal) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
lastTotal = curTotal;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
multibar.log(`Processing fba files...\n`);
|
|
167
|
+
// exec the fba files
|
|
168
|
+
for (const fbaFile of fbaFiles) {
|
|
169
|
+
const fbaResult = {
|
|
170
|
+
type: 'FbaResult',
|
|
171
|
+
data: {
|
|
172
|
+
fbaFileName: fbaFile,
|
|
173
|
+
errors: [],
|
|
174
|
+
},
|
|
175
|
+
children: [],
|
|
176
|
+
};
|
|
177
|
+
report.children.push(fbaResult);
|
|
178
|
+
barFbas.increment(1, { file: fbaFile });
|
|
179
|
+
// console.log(`executing fba file:'${fbaFile}'`)
|
|
180
|
+
await processFbaFile(fbaFile, fbaResult, adltClient).then(async function (promises) {
|
|
181
|
+
//barFbas.increment(nrOfFbas)
|
|
182
|
+
barQueries.setTotal(barQueries.getTotal() + promises.length);
|
|
183
|
+
await Promise.allSettled(promises).then((results) => {
|
|
184
|
+
barQueries.increment(results.length);
|
|
185
|
+
});
|
|
186
|
+
}, (e) => {
|
|
187
|
+
multibar.log(error(`Failed to process fba file:'${fbaFile}'! Got error:${e}`));
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
.catch((e) => {
|
|
192
|
+
console.log(error(`Failed to open DLT files! Got error:${e}`));
|
|
193
|
+
});
|
|
194
|
+
})
|
|
195
|
+
.catch((e) => {
|
|
196
|
+
console.log(error(`Failed to connect to adlt! Got error:${e}`));
|
|
197
|
+
})
|
|
198
|
+
.finally(() => {
|
|
199
|
+
multibar.stop();
|
|
200
|
+
adltClient.close();
|
|
201
|
+
if (adltProcess) {
|
|
202
|
+
try {
|
|
203
|
+
adltProcess.kill();
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
console.log(error(`Failed to kill adlt process! Got error:${e}`));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (report) {
|
|
210
|
+
//console.log(JSON.stringify(report, null, 2)) // use unist-util-inspect
|
|
211
|
+
// console.log(`report is=${is(report, 'FbaExecReport')}`)
|
|
212
|
+
// filter all value.badge = Number(0)
|
|
213
|
+
report = filter(report, (node) => {
|
|
214
|
+
return (node.type !== 'FbRootCauseResult' ||
|
|
215
|
+
!hideBadgeValue(node.value.badge) ||
|
|
216
|
+
!hideBadge2Value(node.value.badge2));
|
|
217
|
+
});
|
|
218
|
+
if (report) {
|
|
219
|
+
// convert by default to md/markdown
|
|
220
|
+
const reportAsMd = fbReportToMdast(report);
|
|
221
|
+
try {
|
|
222
|
+
mdassert(reportAsMd);
|
|
223
|
+
console.log(toMarkdown(reportAsMd));
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
console.log(inspect(reportAsMd));
|
|
227
|
+
console.warn(`reportAsMd got error:${e}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
console.log(warning('failed to generate a report!'));
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
function objectMember(obj, key) {
|
|
238
|
+
return {
|
|
239
|
+
get value() {
|
|
240
|
+
return obj[key];
|
|
241
|
+
},
|
|
242
|
+
set value(t) {
|
|
243
|
+
obj[key] = t;
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const processBadge = async (badge, adltClient, rcResult) => {
|
|
248
|
+
try {
|
|
249
|
+
if (badge.conv && badge.source.startsWith('ext:mbehr1.dlt-logs/')) {
|
|
250
|
+
const rq = rqUriDecode(badge.source);
|
|
251
|
+
// console.log(`rqCmd.path=${rqCmd.path}`)
|
|
252
|
+
if (rq.path.endsWith('/filters?')) {
|
|
253
|
+
//console.log(`rq.commands=${JSON.stringify(rq.commands)}`)
|
|
254
|
+
for (const cmd of rq.commands) {
|
|
255
|
+
rcResult.value = undefined;
|
|
256
|
+
if (cmd.cmd === 'query') {
|
|
257
|
+
// todo what if multiple queries?
|
|
258
|
+
const conv = badge.conv;
|
|
259
|
+
await adltClient.getMatchingMessages(JSON5.parse(cmd.param), 1000).then((msgs) => {
|
|
260
|
+
try {
|
|
261
|
+
// jsonPath expects restQuery results as:
|
|
262
|
+
// {data: [{id, type, attributes: {timeStamp, ecu, mcnt, ctid, apid, mtin, payloadString, lifecycle}}]}
|
|
263
|
+
const rqResult = {
|
|
264
|
+
data: msgs.map((msg, idx) => msg.asRestObject(idx)),
|
|
265
|
+
};
|
|
266
|
+
// console.log(`got ${msgs.length} msgs. jsonPath=${badge.jsonPath}\n`)
|
|
267
|
+
const jsonPath = badge.jsonPath;
|
|
268
|
+
let jsonPathResult;
|
|
269
|
+
if (jsonPath) {
|
|
270
|
+
jsonPathResult = jp.query(rqResult, jsonPath);
|
|
271
|
+
//console.log(`jsonPathResult.length=${jsonPathResult.length}`)
|
|
272
|
+
}
|
|
273
|
+
const result = jsonPathResult !== undefined ? jsonPathResult : rqResult;
|
|
274
|
+
const indexFirstC = conv.indexOf(':');
|
|
275
|
+
const convType = conv.slice(0, indexFirstC);
|
|
276
|
+
const convParam = conv.slice(indexFirstC + 1);
|
|
277
|
+
let convResult;
|
|
278
|
+
switch (convType) {
|
|
279
|
+
case 'length':
|
|
280
|
+
convResult = Array.isArray(result) ? result.length : Array.isArray(result.data) ? result.data.length : 0;
|
|
281
|
+
break;
|
|
282
|
+
case 'index':
|
|
283
|
+
convResult =
|
|
284
|
+
Array.isArray(result) && result.length > Number(convParam)
|
|
285
|
+
? typeof result[Number(convParam)] === 'string'
|
|
286
|
+
? result[Number(convParam)]
|
|
287
|
+
: JSON.stringify(result[Number(convParam)])
|
|
288
|
+
: 0;
|
|
289
|
+
break;
|
|
290
|
+
case 'func':
|
|
291
|
+
try {
|
|
292
|
+
if (!globalThis.JSON5) {
|
|
293
|
+
;
|
|
294
|
+
globalThis.JSON5 = JSON5;
|
|
295
|
+
}
|
|
296
|
+
const fn = Function('result', convParam);
|
|
297
|
+
const fnRes = fn(result);
|
|
298
|
+
switch (typeof fnRes) {
|
|
299
|
+
case 'string':
|
|
300
|
+
case 'number':
|
|
301
|
+
convResult = fnRes;
|
|
302
|
+
break;
|
|
303
|
+
case 'object':
|
|
304
|
+
convResult = JSON.stringify(fnRes);
|
|
305
|
+
break;
|
|
306
|
+
case 'undefined':
|
|
307
|
+
break;
|
|
308
|
+
default:
|
|
309
|
+
convResult = `unknown result type '${typeof fnRes}'. Please return string or number`;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
catch (e) {
|
|
314
|
+
console.warn(`processBadg.msgs func got error:${e}`);
|
|
315
|
+
}
|
|
316
|
+
break;
|
|
317
|
+
default:
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
if (rcResult.value !== undefined) {
|
|
321
|
+
rcResult.value = rcResult.value.toString() + (convResult !== undefined ? convResult.toString() : '<undefined>');
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
rcResult.value = convResult;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
catch (e) {
|
|
328
|
+
console.warn(`processBadge.msgs got error:${e}`);
|
|
329
|
+
rcResult.value += `processBadge.msgs got error:${e}`;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
console.log(`rq.cmd=${cmd} ignored!`);
|
|
335
|
+
rcResult.value = '<none>';
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
rcResult.value = '<no /filters>';
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
// silently skip/ignore rcResult.value = '<no ext:mbehr1.dlt-logs/>'
|
|
345
|
+
rcResult.value = undefined;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
catch (e) {
|
|
349
|
+
console.warn(`processBadge got error:${e}`);
|
|
350
|
+
rcResult.value = `processBadge got error:${e}`;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
function iterateFbEffects(fishbone, fbaResult, adltClient) {
|
|
354
|
+
const promises = [];
|
|
355
|
+
for (const effect of fishbone) {
|
|
356
|
+
const effectResult = {
|
|
357
|
+
type: 'FbEffectResult',
|
|
358
|
+
data: { ...effect },
|
|
359
|
+
children: [],
|
|
360
|
+
};
|
|
361
|
+
delete effectResult.data.categories;
|
|
362
|
+
delete effectResult.data.fbUid;
|
|
363
|
+
if (effect?.categories?.length) {
|
|
364
|
+
for (const category of effect.categories) {
|
|
365
|
+
const categoryResult = {
|
|
366
|
+
type: 'FbCategoryResult',
|
|
367
|
+
data: { ...category },
|
|
368
|
+
children: [],
|
|
369
|
+
};
|
|
370
|
+
delete categoryResult.data.rootCauses;
|
|
371
|
+
delete categoryResult.data.fbUid;
|
|
372
|
+
if (category?.rootCauses?.length) {
|
|
373
|
+
for (const rc of category.rootCauses) {
|
|
374
|
+
//console.log(`fbType=${fbType}, fbElement.type=${fbElement.type},fbElement.element=${fbElement.element} parent=${parent.name}`)
|
|
375
|
+
if (rc.props?.badge || rc.props?.badge2) {
|
|
376
|
+
const rcResult = {
|
|
377
|
+
type: 'FbRootCauseResult',
|
|
378
|
+
data: {
|
|
379
|
+
...rc,
|
|
380
|
+
name: rc.props.label,
|
|
381
|
+
backgroundDescription: rc.props.backgroundDescription,
|
|
382
|
+
instructions: rc.props.instructions,
|
|
383
|
+
},
|
|
384
|
+
value: {
|
|
385
|
+
badge: rc.props.badge ? '<pending>' : undefined,
|
|
386
|
+
badge2: rc.props.badge2 ? '<pending>' : undefined,
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
delete rcResult.data.type;
|
|
390
|
+
delete rcResult.data.element;
|
|
391
|
+
delete rcResult.data.fbUid;
|
|
392
|
+
delete rcResult.data.data;
|
|
393
|
+
delete rcResult.data.props;
|
|
394
|
+
categoryResult.children.push(rcResult);
|
|
395
|
+
if (rc.props.badge) {
|
|
396
|
+
promises.push(processBadge(rc.props.badge, adltClient, objectMember(rcResult.value, 'badge')));
|
|
397
|
+
}
|
|
398
|
+
if (rc.props.badge2) {
|
|
399
|
+
promises.push(processBadge(rc.props.badge2, adltClient, objectMember(rcResult.value, 'badge2')));
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
if (rc.type === 'nested' && Array.isArray(rc.data)) {
|
|
403
|
+
const nestedResult = {
|
|
404
|
+
type: 'FbaResult',
|
|
405
|
+
data: {
|
|
406
|
+
fbaTitle: rc.title,
|
|
407
|
+
errors: [],
|
|
408
|
+
},
|
|
409
|
+
children: [],
|
|
410
|
+
};
|
|
411
|
+
promises.push(...iterateFbEffects(rc.data, nestedResult, adltClient));
|
|
412
|
+
if (nestedResult.children.length) {
|
|
413
|
+
categoryResult.children.push(nestedResult);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (categoryResult.children.length) {
|
|
419
|
+
effectResult.children.push(categoryResult);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (effectResult.children.length) {
|
|
424
|
+
fbaResult.children.push(effectResult);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
return promises;
|
|
428
|
+
}
|
|
429
|
+
const processFbaFile = async (filePath, fbaResult, adltClient) => {
|
|
430
|
+
// try to open the file:
|
|
431
|
+
return new Promise((resolve, reject) => {
|
|
432
|
+
fs.readFile(filePath, 'utf-8', (err, fbaFileContent) => {
|
|
433
|
+
if (err) {
|
|
434
|
+
// console.log(error(`Failed to read fba file:'${filePath}'! Got error:${err}`))
|
|
435
|
+
fbaResult.data.errors.push(`Failed to read fba file due to: ${err}`);
|
|
436
|
+
reject(err);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
try {
|
|
440
|
+
const fba = getFBDataFromText(fbaFileContent);
|
|
441
|
+
fbaResult.data.fbaTitle = fba.title;
|
|
442
|
+
const promises = iterateFbEffects(fba.fishbone, fbaResult, adltClient);
|
|
443
|
+
resolve(promises);
|
|
444
|
+
}
|
|
445
|
+
catch (e) {
|
|
446
|
+
fbaResult.data.errors.push(`Processing fba got error: ${e}`);
|
|
447
|
+
reject(e);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
};
|
|
452
|
+
//# sourceMappingURL=cmdExec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmdExec.js","sourceRoot":"","sources":["../src/cmdExec.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAqD,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClI,OAAO,EAA2C,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACxG,OAAO,EAML,eAAe,EACf,eAAe,EACf,cAAc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
|
|
|
1
|
+
import { visit, CONTINUE, SKIP } from 'unist-util-visit';
|
|
2
|
+
import { is } from 'unist-util-is';
|
|
3
|
+
import { default as JSON5 } from 'json5';
|
|
4
|
+
import { version } from './util.js';
|
|
5
|
+
export const hideBadgeValue = (value) => value === undefined || (typeof value === 'string' && value.length === 0) || (typeof value === 'number' && value === 0);
|
|
6
|
+
export const hideBadge2Value = (value) => {
|
|
7
|
+
return value === undefined || (typeof value === 'string' && value.length === 0);
|
|
8
|
+
};
|
|
9
|
+
export function fbReportToMdast(report) {
|
|
10
|
+
const reportAsMd = {
|
|
11
|
+
type: 'root',
|
|
12
|
+
children: [],
|
|
13
|
+
};
|
|
14
|
+
// now traverse the report and add children
|
|
15
|
+
visit(report, (node) => {
|
|
16
|
+
if (is(node, 'FbRootCauseResult')) {
|
|
17
|
+
const rc = node;
|
|
18
|
+
reportAsMd.children.push({
|
|
19
|
+
type: 'heading',
|
|
20
|
+
depth: 5,
|
|
21
|
+
children: [{ type: 'text', value: `root cause: '${rc.data.name}'` }],
|
|
22
|
+
});
|
|
23
|
+
const badgeValue = rc.value.badge;
|
|
24
|
+
if (!hideBadgeValue(badgeValue)) {
|
|
25
|
+
reportAsMd.children.push({
|
|
26
|
+
type: 'paragraph',
|
|
27
|
+
children: [
|
|
28
|
+
{ type: 'text', value: '🔴: ' },
|
|
29
|
+
{ type: 'html', value: '<mark>' },
|
|
30
|
+
{ type: 'emphasis', children: [{ type: 'text', value: rc.value.badge?.toString() || '' }] },
|
|
31
|
+
{ type: 'html', value: '</mark>' },
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const badge2Value = rc.value.badge2;
|
|
36
|
+
if (!hideBadge2Value(badge2Value)) {
|
|
37
|
+
reportAsMd.children.push({
|
|
38
|
+
type: 'paragraph',
|
|
39
|
+
children: [
|
|
40
|
+
{ type: 'text', value: 'ℹ: ' },
|
|
41
|
+
{ type: 'text', value: rc.value.badge2?.toString() || '' },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// add backgroundDescription
|
|
46
|
+
if (rc.data.backgroundDescription) {
|
|
47
|
+
reportAsMd.children.push({
|
|
48
|
+
type: 'paragraph',
|
|
49
|
+
children: [
|
|
50
|
+
{ type: 'html', value: `<details>` },
|
|
51
|
+
{ type: 'html', value: `<summary>` },
|
|
52
|
+
{ type: 'text', value: `background:` },
|
|
53
|
+
{ type: 'html', value: `</summary><br>` },
|
|
54
|
+
{
|
|
55
|
+
type: 'text',
|
|
56
|
+
value: typeof rc.data.backgroundDescription === 'string' ? rc.data.backgroundDescription : rc.data.backgroundDescription.textValue, // todo embed markdown, rewrite headings to higher level...
|
|
57
|
+
},
|
|
58
|
+
{ type: 'html', value: `</details>` }, // or as 2nd paragraph?
|
|
59
|
+
],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return CONTINUE;
|
|
63
|
+
}
|
|
64
|
+
if (is(node, 'FbCategoryResult')) {
|
|
65
|
+
const rc = node;
|
|
66
|
+
reportAsMd.children.push({
|
|
67
|
+
type: 'heading',
|
|
68
|
+
depth: 4,
|
|
69
|
+
children: [{ type: 'text', value: `category: '${rc.data.name}'` }],
|
|
70
|
+
});
|
|
71
|
+
reportAsMd.children.push({
|
|
72
|
+
type: 'paragraph',
|
|
73
|
+
children: [],
|
|
74
|
+
});
|
|
75
|
+
return CONTINUE;
|
|
76
|
+
}
|
|
77
|
+
if (is(node, 'FbEffectResult')) {
|
|
78
|
+
const rc = node;
|
|
79
|
+
reportAsMd.children.push({
|
|
80
|
+
type: 'heading',
|
|
81
|
+
depth: 3,
|
|
82
|
+
children: [{ type: 'text', value: `effect: '${rc.data.name}'` }],
|
|
83
|
+
});
|
|
84
|
+
reportAsMd.children.push({
|
|
85
|
+
type: 'paragraph',
|
|
86
|
+
children: [],
|
|
87
|
+
});
|
|
88
|
+
return CONTINUE;
|
|
89
|
+
}
|
|
90
|
+
if (is(node, 'FbaResult')) {
|
|
91
|
+
const rc = node;
|
|
92
|
+
const isEmbedded = !rc.data.fbaFileName;
|
|
93
|
+
reportAsMd.children.push({
|
|
94
|
+
type: 'heading',
|
|
95
|
+
depth: isEmbedded ? 3 : 2,
|
|
96
|
+
children: [{ type: 'text', value: `${isEmbedded ? 'embedded ' : ''}fishbone: '${rc.data.fbaTitle}'` }],
|
|
97
|
+
});
|
|
98
|
+
if (rc.data.errors.length) {
|
|
99
|
+
reportAsMd.children.push({
|
|
100
|
+
type: 'paragraph',
|
|
101
|
+
children: [
|
|
102
|
+
{ type: 'text', value: `❌ ` },
|
|
103
|
+
{
|
|
104
|
+
type: 'emphasis',
|
|
105
|
+
children: rc.data.errors.map((e) => {
|
|
106
|
+
return { type: 'text', value: e };
|
|
107
|
+
}),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (rc.data.fbaFileName) {
|
|
113
|
+
reportAsMd.children.push({
|
|
114
|
+
type: 'paragraph',
|
|
115
|
+
children: [{ type: 'text', value: `file: ${rc.data.fbaFileName}` }],
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return CONTINUE;
|
|
119
|
+
}
|
|
120
|
+
if (is(node, 'FbaExecReport')) {
|
|
121
|
+
const rc = node;
|
|
122
|
+
reportAsMd.children.push({
|
|
123
|
+
type: 'heading',
|
|
124
|
+
depth: 1,
|
|
125
|
+
children: [{ type: 'text', value: `fba-cli execution report` }], // rc.children,
|
|
126
|
+
});
|
|
127
|
+
// output some data:
|
|
128
|
+
reportAsMd.children.push({
|
|
129
|
+
type: 'paragraph',
|
|
130
|
+
children: [
|
|
131
|
+
{ type: 'text', value: `date: ${rc.data.date}, ` },
|
|
132
|
+
{ type: 'text', value: `adlt v${rc.data.adltVersion}, fba-cli v${version()} ` },
|
|
133
|
+
{ type: 'break' },
|
|
134
|
+
{ type: 'text', value: `files: ${rc.data.files.join(', ')}` },
|
|
135
|
+
{ type: 'break' },
|
|
136
|
+
{ type: 'html', value: `<details>` },
|
|
137
|
+
{ type: 'html', value: `<summary>` },
|
|
138
|
+
{ type: 'text', value: `pluginCfgs:` },
|
|
139
|
+
{ type: 'html', value: `</summary><br>` },
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
reportAsMd.children.push({
|
|
143
|
+
type: 'code',
|
|
144
|
+
lang: 'json',
|
|
145
|
+
value: JSON.stringify(JSON5.parse(rc.data.pluginCfgs), undefined, 2),
|
|
146
|
+
});
|
|
147
|
+
reportAsMd.children.push({ type: 'html', value: `</details>` });
|
|
148
|
+
return CONTINUE; // traverse children as well SKIP // dont traverse children
|
|
149
|
+
}
|
|
150
|
+
console.log(`skipping children of node.type=${node.type}`);
|
|
151
|
+
return SKIP; // if we reach here we dont know the node!
|
|
152
|
+
});
|
|
153
|
+
return reportAsMd;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=execReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execReport.js","sourceRoot":"","sources":["../src/execReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAQ,MAAM,kBAAkB,CAAA;AAE9D,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4DnC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAkC,EAAW,EAAE,CAC5E,KAAK,KAAK,SAAS,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,CAAC,CAAC,CAAA;AAExH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAkC,EAAW,EAAE;IAC7E,OAAO,KAAK,KAAK,SAAS,IAAI,CAAC,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