@appland/appmap 3.96.3 → 3.97.1
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 +21 -0
- package/built/cmds/archive/analyzeTask.js +0 -7
- package/built/cmds/archive/analyzeTask.js.map +1 -1
- package/built/cmds/compare/ChangeReporter.js +3 -3
- package/built/cmds/compare/ChangeReporter.js.map +1 -1
- package/built/cmds/compare/loadFindings.js +1 -1
- package/built/cmds/compare/loadFindings.js.map +1 -1
- package/built/cmds/compare-report/ChangeReport.js +199 -0
- package/built/cmds/compare-report/ChangeReport.js.map +1 -0
- package/built/cmds/compare-report/MarkdownReport.js +52 -200
- package/built/cmds/compare-report/MarkdownReport.js.map +1 -1
- package/built/cmds/compare-report/Preprocessor.js +115 -0
- package/built/cmds/compare-report/Preprocessor.js.map +1 -0
- package/built/cmds/compare-report/ReportSection.js +167 -0
- package/built/cmds/compare-report/ReportSection.js.map +1 -0
- package/built/cmds/compare-report/compareReport.js +1 -2
- package/built/cmds/compare-report/compareReport.js.map +1 -1
- package/built/html/appmap.js +17 -17
- package/built/html/appmap.js.map +2 -2
- package/built/html/sequenceDiagram.js +17 -17
- package/built/html/sequenceDiagram.js.map +2 -2
- package/built/lib/processAppMapDir.js +0 -2
- package/built/lib/processAppMapDir.js.map +1 -1
- package/package.json +2 -3
- package/resources/change-report/changed-appmaps/details.hbs +25 -0
- package/resources/change-report/changed-appmaps/heading.hbs +7 -0
- package/resources/change-report/failed-tests/details.hbs +57 -0
- package/resources/change-report/failed-tests/heading.hbs +1 -0
- package/resources/change-report/findings/details.hbs +80 -0
- package/resources/change-report/findings/heading.hbs +13 -0
- package/resources/change-report/new-appmaps/details.hbs +11 -0
- package/resources/change-report/new-appmaps/heading.hbs +3 -0
- package/resources/change-report/openapi-diff/details.hbs +55 -0
- package/resources/change-report/openapi-diff/heading.hbs +8 -0
- package/built/lib/findings.js +0 -6
- package/built/lib/findings.js.map +0 -1
- package/resources/change-report.hbs +0 -279
|
@@ -1,216 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.EXPERIMENTAL_SECTIONS = exports.SECTIONS = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
]
|
|
18
|
-
.map((fileName) => (0, path_1.join)(__dirname, fileName))
|
|
19
|
-
.find((fileName) => (0, fs_1.existsSync)(fileName));
|
|
20
|
-
function isURL(path) {
|
|
21
|
-
try {
|
|
22
|
-
new URL(path);
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.SECTIONS = ['failed-tests', 'openapi-diff', 'findings', 'new-appmaps'];
|
|
30
|
-
exports.EXPERIMENTAL_SECTIONS = ['changed-appmaps'];
|
|
30
|
+
const ChangeReport_1 = __importDefault(require("./ChangeReport"));
|
|
31
|
+
const ReportSection_1 = __importStar(require("./ReportSection"));
|
|
32
|
+
// TODO: Get this from the type?
|
|
33
|
+
exports.SECTIONS = [
|
|
34
|
+
ReportSection_1.Section.FailedTests,
|
|
35
|
+
ReportSection_1.Section.OpenAPIDiff,
|
|
36
|
+
ReportSection_1.Section.Findings,
|
|
37
|
+
ReportSection_1.Section.NewAppMaps,
|
|
38
|
+
];
|
|
39
|
+
exports.EXPERIMENTAL_SECTIONS = [ReportSection_1.ExperimentalSection.ChangedAppMaps];
|
|
31
40
|
class MarkdownReport {
|
|
32
41
|
constructor(appmapURL, sourceURL) {
|
|
33
42
|
this.appmapURL = appmapURL;
|
|
34
43
|
this.sourceURL = sourceURL;
|
|
35
44
|
}
|
|
36
|
-
async generateReport(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
failure.changedAppMap = changedAppMap;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
const appmapNames = new Map();
|
|
51
|
-
for (const { appmap } of changeReport.testFailures) {
|
|
52
|
-
const metadata = JSON.parse(await (0, promises_1.readFile)((0, path_1.join)('head', appmap, 'metadata.json'), 'utf-8'));
|
|
53
|
-
appmapNames.set(appmap, metadata.name.replace(/_/g, ' '));
|
|
54
|
-
}
|
|
55
|
-
// Resolve the test location to a source path relative to baseDir.
|
|
56
|
-
changeReport.testFailures
|
|
57
|
-
.filter((failure) => failure.testLocation)
|
|
58
|
-
.forEach((failure) => {
|
|
59
|
-
const tokens = failure.testLocation.split(':');
|
|
60
|
-
tokens.pop();
|
|
61
|
-
let testPath = tokens.join(':');
|
|
62
|
-
let path;
|
|
63
|
-
if (isURL(baseDir)) {
|
|
64
|
-
path = new URL(testPath, baseDir).toString();
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
path = (0, path_1.join)(baseDir, testPath);
|
|
68
|
-
}
|
|
69
|
-
failure.testPath = path;
|
|
70
|
-
failure.testName = appmapNames.get(failure.appmap) || testPath;
|
|
71
|
-
if (failure.testSnippet) {
|
|
72
|
-
const [, lineno] = (failure.failureLocation || '').split(':');
|
|
73
|
-
failure.failureLine = lineno;
|
|
74
|
-
failure.testSnippet.codeFragment = failure.testSnippet.codeFragment
|
|
75
|
-
.split('\n')
|
|
76
|
-
.map((line, index) => `${(index + failure.testSnippet.startLine).toString() === lineno ? '> ' : ' '} ${index + failure.testSnippet.startLine}: ${line}`)
|
|
77
|
-
.join('\n');
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
const wordify = (s) => s.replace(/([-_])/g, ' ').toLowerCase();
|
|
81
|
-
const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
82
|
-
const explainAPIChange = (change) => {
|
|
83
|
-
const { action, entity } = change;
|
|
84
|
-
const entityTokens = entity.split('.');
|
|
85
|
-
change.title = [capitalize(wordify(action)), ...entityTokens.map(wordify)].join(' ');
|
|
45
|
+
async generateReport(changeReportData) {
|
|
46
|
+
const sections = [
|
|
47
|
+
...exports.SECTIONS.filter((section) => { var _a; return !((_a = this.excludeSections) === null || _a === void 0 ? void 0 : _a.includes(section)); }),
|
|
48
|
+
...exports.EXPERIMENTAL_SECTIONS.filter((section) => { var _a; return (_a = this.includeSections) === null || _a === void 0 ? void 0 : _a.includes(section); }),
|
|
49
|
+
];
|
|
50
|
+
const changeReport = await ChangeReport_1.default.build(changeReportData);
|
|
51
|
+
const headings = new Array();
|
|
52
|
+
const details = new Array();
|
|
53
|
+
const reportOptions = {
|
|
54
|
+
sourceURL: this.sourceURL,
|
|
55
|
+
appmapURL: this.appmapURL,
|
|
86
56
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(((_d = changeReport.apiDiff.breakingDifferences) === null || _d === void 0 ? void 0 : _d.length) || 0) +
|
|
94
|
-
(((_e = changeReport.apiDiff.nonBreakingDifferences) === null || _e === void 0 ? void 0 : _e.length) || 0) +
|
|
95
|
-
(((_f = changeReport.apiDiff.unclassifiedDifferences) === null || _f === void 0 ? void 0 : _f.length) || 0);
|
|
96
|
-
changeReport.apiDiff.breakingDifferenceCount =
|
|
97
|
-
((_g = changeReport.apiDiff.breakingDifferences) === null || _g === void 0 ? void 0 : _g.length) || 0;
|
|
98
|
-
changeReport.apiDiff.nonBreakingDifferenceCount =
|
|
99
|
-
((_h = changeReport.apiDiff.nonBreakingDifferences) === null || _h === void 0 ? void 0 : _h.length) || 0;
|
|
100
|
-
if (changeReport.apiDiff.differenceCount > 0) {
|
|
101
|
-
const sourceDiff = (await (0, executeCommand_1.executeCommand)(`diff -u base/openapi.yml head/openapi.yml`, (0, utils_1.verbose)(), (0, utils_1.verbose)(), (0, utils_1.verbose)(), [0, 1])).trim();
|
|
102
|
-
changeReport.apiDiff.sourceDiff = sourceDiff;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
changeReport.sequenceDiagramDiffSnippetCount = Object.keys(changeReport.sequenceDiagramDiff || {}).length;
|
|
106
|
-
if (changeReport.findingDiff) {
|
|
107
|
-
Object.keys(changeReport.findingDiff).forEach((key) => {
|
|
108
|
-
(0, assert_1.default)(changeReport.findingDiff);
|
|
109
|
-
changeReport.findingDiff[key].forEach((finding) => (finding.appmap = finding.appMapFile));
|
|
110
|
-
});
|
|
57
|
+
for (const sectionName of sections) {
|
|
58
|
+
const section = await ReportSection_1.default.build(sectionName);
|
|
59
|
+
const heading = section.generateHeading(changeReport, reportOptions);
|
|
60
|
+
const detail = section.generateDetails(changeReport, reportOptions);
|
|
61
|
+
headings.push(heading);
|
|
62
|
+
details.push(detail);
|
|
111
63
|
}
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
var _a, _b;
|
|
115
|
-
if (exports.SECTIONS.includes(section) && !((_a = self.excludeSections) === null || _a === void 0 ? void 0 : _a.includes(section)))
|
|
116
|
-
return true;
|
|
117
|
-
if (exports.EXPERIMENTAL_SECTIONS.includes(section) && ((_b = self.includeSections) === null || _b === void 0 ? void 0 : _b.includes(section)))
|
|
118
|
-
return true;
|
|
119
|
-
return false;
|
|
120
|
-
});
|
|
121
|
-
handlebars_1.default.registerHelper('inspect', function (value) {
|
|
122
|
-
return new handlebars_1.default.SafeString(JSON.stringify(value, null, 2));
|
|
123
|
-
});
|
|
124
|
-
handlebars_1.default.registerHelper('defined', function (...list) {
|
|
125
|
-
const _fn = list.pop();
|
|
126
|
-
let result = false;
|
|
127
|
-
for (const item of list)
|
|
128
|
-
if (item !== undefined)
|
|
129
|
-
result = true;
|
|
130
|
-
return result;
|
|
131
|
-
});
|
|
132
|
-
handlebars_1.default.registerHelper('length', function (...list) {
|
|
133
|
-
const _fn = list.pop();
|
|
134
|
-
let result = 0;
|
|
135
|
-
for (const item of list) {
|
|
136
|
-
if (Array.isArray(item)) {
|
|
137
|
-
result += item.length;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return result;
|
|
141
|
-
});
|
|
142
|
-
handlebars_1.default.registerHelper('has_source_diff', function (appmap) {
|
|
143
|
-
if (appmap.endsWith('.appmap.json'))
|
|
144
|
-
appmap = appmap.slice(0, '.appmap.json'.length * -1);
|
|
145
|
-
const changedAppMap = changeReport.changedAppMaps.find((change) => change.appmap === appmap);
|
|
146
|
-
return !!changedAppMap && !!changedAppMap.sourceDiff;
|
|
147
|
-
});
|
|
148
|
-
handlebars_1.default.registerHelper('source_diff', function (appmap) {
|
|
149
|
-
var _a;
|
|
150
|
-
if (appmap.endsWith('.appmap.json'))
|
|
151
|
-
appmap = appmap.slice(0, '.appmap.json'.length * -1);
|
|
152
|
-
const diffText = (_a = changeReport.changedAppMaps.find((change) => change.appmap === appmap)) === null || _a === void 0 ? void 0 : _a.sourceDiff;
|
|
153
|
-
return diffText ? new handlebars_1.default.SafeString(diffText) : undefined;
|
|
154
|
-
});
|
|
155
|
-
handlebars_1.default.registerHelper('appmap_diff_url', function (diagram) {
|
|
156
|
-
if (diagram.startsWith('./'))
|
|
157
|
-
diagram = diagram.slice('./'.length);
|
|
158
|
-
if (diagram.startsWith('diff/'))
|
|
159
|
-
diagram = diagram.slice('diff/'.length);
|
|
160
|
-
if (diagram.endsWith('.diff.sequence.json'))
|
|
161
|
-
diagram = diagram.slice(0, '.diff.sequence.json'.length * -1);
|
|
162
|
-
const path = ['diff', `${diagram}.diff.sequence.json`].join('/');
|
|
163
|
-
if (self.appmapURL) {
|
|
164
|
-
const url = new URL(self.appmapURL.toString());
|
|
165
|
-
url.searchParams.append('path', path);
|
|
166
|
-
return new handlebars_1.default.SafeString(url.toString());
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
return new handlebars_1.default.SafeString(path);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
handlebars_1.default.registerHelper('appmap_url', function (dir, appmap) {
|
|
173
|
-
if (appmap.startsWith('./'))
|
|
174
|
-
appmap = appmap.slice('./'.length);
|
|
175
|
-
if (appmap.endsWith('.appmap.json'))
|
|
176
|
-
appmap = appmap.slice(0, '.appmap.json'.length * -1);
|
|
177
|
-
const path = [dir, `${appmap}.appmap.json`].join('/');
|
|
178
|
-
if (self.appmapURL) {
|
|
179
|
-
const url = new URL(self.appmapURL.toString());
|
|
180
|
-
url.searchParams.append('path', path);
|
|
181
|
-
return new handlebars_1.default.SafeString(url.toString());
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
return new handlebars_1.default.SafeString(path);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
handlebars_1.default.registerHelper('source_url', function (location, fileLinenoSeparator = '#L') {
|
|
188
|
-
if (typeof fileLinenoSeparator === 'object') {
|
|
189
|
-
fileLinenoSeparator = '#L';
|
|
190
|
-
}
|
|
191
|
-
const [path, lineno] = location.split(':');
|
|
192
|
-
if ((0, path_1.isAbsolute)(path))
|
|
193
|
-
return;
|
|
194
|
-
if (path.startsWith('vendor/') || path.startsWith('node_modules/'))
|
|
195
|
-
return;
|
|
196
|
-
if (self.sourceURL) {
|
|
197
|
-
const url = new URL(self.sourceURL.toString());
|
|
198
|
-
if (url.protocol === 'file:') {
|
|
199
|
-
const sourcePath = (0, path_1.relative)(process.cwd(), (0, path_1.join)(url.pathname, path));
|
|
200
|
-
return new handlebars_1.default.SafeString([sourcePath, lineno].filter(Boolean).join(fileLinenoSeparator));
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
url.pathname = (0, path_1.join)(url.pathname, path);
|
|
204
|
-
if (lineno)
|
|
205
|
-
url.hash = `L${lineno}`;
|
|
206
|
-
return new handlebars_1.default.SafeString(url.toString());
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
return new handlebars_1.default.SafeString(location);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
return Template(changeReport);
|
|
64
|
+
const heading = ['# AppMap', '', '| Summary | Status |', '| --- | --- |', ...headings, ''].join('\n');
|
|
65
|
+
return [heading, ...details].join('\n');
|
|
214
66
|
}
|
|
215
67
|
}
|
|
216
68
|
exports.default = MarkdownReport;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownReport.js","sourceRoot":"","sources":["../../../src/cmds/compare-report/MarkdownReport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownReport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AC,KAAK,CAAC,WAAW,CAAC,CAAC;YACvD,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;YACrE,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;YAEpE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACtB;QAED,MAAM,OAAO,GAAG,CAAC,UAAU,EAAE,EAAE,EAAE,sBAAsB,EAAE,eAAe,EAAE,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAC7F,IAAI,CACL,CAAC;QACF,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF;AAlCD,iCAkCC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const console_1 = require("console");
|
|
4
|
+
const ReportSection_1 = require("./ReportSection");
|
|
5
|
+
class FailedTestsPreprocessor {
|
|
6
|
+
constructor(report) {
|
|
7
|
+
this.report = report;
|
|
8
|
+
}
|
|
9
|
+
get numElements() {
|
|
10
|
+
return this.report.testFailures.length;
|
|
11
|
+
}
|
|
12
|
+
prune(numElements) {
|
|
13
|
+
return { testFailures: this.report.testFailures.slice(0, numElements) };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class OpenAPIDiffPreprocessor {
|
|
17
|
+
constructor(report) {
|
|
18
|
+
this.report = report;
|
|
19
|
+
}
|
|
20
|
+
get numElements() {
|
|
21
|
+
return this.report.openapiDiff.differenceCount;
|
|
22
|
+
}
|
|
23
|
+
prune(numElements) {
|
|
24
|
+
const openapiDiff = Object.assign({}, this.report.openapiDiff);
|
|
25
|
+
let numRemaining = numElements;
|
|
26
|
+
{
|
|
27
|
+
numRemaining -= openapiDiff.breakingDifferences.length;
|
|
28
|
+
openapiDiff.breakingDifferences = openapiDiff.breakingDifferences.slice(0, numElements);
|
|
29
|
+
}
|
|
30
|
+
if (numRemaining > 0) {
|
|
31
|
+
numRemaining -= openapiDiff.nonBreakingDifferences.length;
|
|
32
|
+
openapiDiff.nonBreakingDifferences = openapiDiff.nonBreakingDifferences.slice(0, numElements);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
openapiDiff.nonBreakingDifferences = [];
|
|
36
|
+
}
|
|
37
|
+
if (numRemaining > 0) {
|
|
38
|
+
numRemaining -= openapiDiff.unclassifiedDifferences.length;
|
|
39
|
+
openapiDiff.unclassifiedDifferences = openapiDiff.unclassifiedDifferences.slice(0, numElements);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
openapiDiff.unclassifiedDifferences = [];
|
|
43
|
+
}
|
|
44
|
+
return { openapiDiff };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class FindingDiffPreprocessor {
|
|
48
|
+
constructor(report) {
|
|
49
|
+
this.report = report;
|
|
50
|
+
}
|
|
51
|
+
get numElements() {
|
|
52
|
+
return (this.report.findingDiff.newFindings.length + this.report.findingDiff.resolvedFindings.length);
|
|
53
|
+
}
|
|
54
|
+
prune(numElements) {
|
|
55
|
+
const findingDiff = Object.assign({}, this.report.findingDiff);
|
|
56
|
+
let numRemaining = numElements;
|
|
57
|
+
{
|
|
58
|
+
numRemaining -= findingDiff.newFindings.length;
|
|
59
|
+
findingDiff.newFindings = findingDiff.newFindings.slice(0, numElements);
|
|
60
|
+
}
|
|
61
|
+
if (numRemaining > 0) {
|
|
62
|
+
numRemaining -= findingDiff.resolvedFindings.length;
|
|
63
|
+
findingDiff.resolvedFindings = findingDiff.resolvedFindings.slice(0, numElements);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
findingDiff.resolvedFindings = [];
|
|
67
|
+
}
|
|
68
|
+
return { findingDiff };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
class NewAppMapsPreprocessor {
|
|
72
|
+
constructor(report) {
|
|
73
|
+
this.report = report;
|
|
74
|
+
}
|
|
75
|
+
get numElements() {
|
|
76
|
+
return this.report.newAppMaps.length;
|
|
77
|
+
}
|
|
78
|
+
prune(numElements) {
|
|
79
|
+
return {
|
|
80
|
+
newAppMaps: this.report.newAppMaps.slice(0, numElements),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
class ChangedAppMapsPreprocessor {
|
|
85
|
+
constructor(report) {
|
|
86
|
+
this.report = report;
|
|
87
|
+
}
|
|
88
|
+
get numElements() {
|
|
89
|
+
return Object.keys(this.report.changedAppMaps).length;
|
|
90
|
+
}
|
|
91
|
+
prune(numElements) {
|
|
92
|
+
const retainKeys = Object.keys(this.report.changedAppMaps).slice(0, numElements);
|
|
93
|
+
return {
|
|
94
|
+
changedAppMaps: retainKeys.reduce((memo, key) => ((memo[key] = this.report.changedAppMaps[key]), memo), {}),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function buildPreprocessor(section, report) {
|
|
99
|
+
switch (section) {
|
|
100
|
+
case ReportSection_1.Section.FailedTests:
|
|
101
|
+
return new FailedTestsPreprocessor(report);
|
|
102
|
+
case ReportSection_1.Section.OpenAPIDiff:
|
|
103
|
+
return new OpenAPIDiffPreprocessor(report);
|
|
104
|
+
case ReportSection_1.Section.Findings:
|
|
105
|
+
return new FindingDiffPreprocessor(report);
|
|
106
|
+
case ReportSection_1.Section.NewAppMaps:
|
|
107
|
+
return new NewAppMapsPreprocessor(report);
|
|
108
|
+
case ReportSection_1.ExperimentalSection.ChangedAppMaps:
|
|
109
|
+
return new ChangedAppMapsPreprocessor(report);
|
|
110
|
+
default:
|
|
111
|
+
(0, console_1.warn)(`No Preprocessor for section ${section}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.default = buildPreprocessor;
|
|
115
|
+
//# sourceMappingURL=Preprocessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Preprocessor.js","sourceRoot":"","sources":["../../../src/cmds/compare-report/Preprocessor.ts"],"names":[],"mappings":";;AAAA,qCAA+B;AAE/B,mDAA+D;AAQ/D,MAAM,uBAAuB;IAC3B,YAAmB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAE3C,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,WAAmB;QACvB,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;IAC1E,CAAC;CACF;AAED,MAAM,uBAAuB;IAC3B,YAAmB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAE3C,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,WAAmB;QACvB,MAAM,WAAW,qBAAQ,IAAI,CAAC,MAAM,CAAC,WAAW,CAAE,CAAC;QAEnD,IAAI,YAAY,GAAG,WAAW,CAAC;QAC/B;YACE,YAAY,IAAI,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC;YACvD,WAAW,CAAC,mBAAmB,GAAG,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;SACzF;QAED,IAAI,YAAY,GAAG,CAAC,EAAE;YACpB,YAAY,IAAI,WAAW,CAAC,sBAAsB,CAAC,MAAM,CAAC;YAC1D,WAAW,CAAC,sBAAsB,GAAG,WAAW,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;SAC/F;aAAM;YACL,WAAW,CAAC,sBAAsB,GAAG,EAAE,CAAC;SAC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;YACrB,OAAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAC5C,KAAK,mCAAmB,CAAC,cAAc;YACrC,OAAO,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;QAChD;YACE,IAAA,cAAI,EAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;KAClD;AACH,CAAC;AAlBD,oCAkBC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExperimentalSection = exports.Section = exports.DEFAULT_MAX_ELEMENTS = void 0;
|
|
7
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const promises_1 = require("fs/promises");
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const assert_1 = __importDefault(require("assert"));
|
|
12
|
+
const Preprocessor_1 = __importDefault(require("./Preprocessor"));
|
|
13
|
+
const TemplateDirectory = [
|
|
14
|
+
'../../../resources/change-report',
|
|
15
|
+
'../../../../resources/change-report', // In development
|
|
16
|
+
]
|
|
17
|
+
.map((dirName) => (0, path_1.join)(__dirname, dirName))
|
|
18
|
+
.find((dirName) => (0, fs_1.existsSync)(dirName));
|
|
19
|
+
(0, assert_1.default)(TemplateDirectory, "Report template directory 'change-report' not found");
|
|
20
|
+
exports.DEFAULT_MAX_ELEMENTS = 10;
|
|
21
|
+
var Section;
|
|
22
|
+
(function (Section) {
|
|
23
|
+
Section["FailedTests"] = "failed-tests";
|
|
24
|
+
Section["OpenAPIDiff"] = "openapi-diff";
|
|
25
|
+
Section["Findings"] = "findings";
|
|
26
|
+
Section["NewAppMaps"] = "new-appmaps";
|
|
27
|
+
})(Section = exports.Section || (exports.Section = {}));
|
|
28
|
+
var ExperimentalSection;
|
|
29
|
+
(function (ExperimentalSection) {
|
|
30
|
+
ExperimentalSection["ChangedAppMaps"] = "changed-appmaps";
|
|
31
|
+
})(ExperimentalSection = exports.ExperimentalSection || (exports.ExperimentalSection = {}));
|
|
32
|
+
class ReportSection {
|
|
33
|
+
constructor(section, headingTemplate, detailsTemplate) {
|
|
34
|
+
this.section = section;
|
|
35
|
+
this.headingTemplate = headingTemplate;
|
|
36
|
+
this.detailsTemplate = detailsTemplate;
|
|
37
|
+
}
|
|
38
|
+
generateHeading(changeReport, options) {
|
|
39
|
+
return this.headingTemplate(changeReport, {
|
|
40
|
+
helpers: ReportSection.helpers(options),
|
|
41
|
+
allowProtoPropertiesByDefault: true,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
generateDetails(changeReport, options) {
|
|
45
|
+
const report = Object.assign({}, changeReport);
|
|
46
|
+
let maxElements = options.maxElements || exports.DEFAULT_MAX_ELEMENTS;
|
|
47
|
+
const preprocessor = (0, Preprocessor_1.default)(this.section, report);
|
|
48
|
+
if (preprocessor) {
|
|
49
|
+
const { numElements } = preprocessor;
|
|
50
|
+
if (numElements > maxElements) {
|
|
51
|
+
const pruneResult = preprocessor.prune(maxElements);
|
|
52
|
+
for (const key of Object.keys(pruneResult)) {
|
|
53
|
+
report[key] = pruneResult[key];
|
|
54
|
+
}
|
|
55
|
+
report.pruned = true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return this.detailsTemplate(report, {
|
|
59
|
+
helpers: ReportSection.helpers(options),
|
|
60
|
+
allowProtoPropertiesByDefault: true,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
static helpers(options) {
|
|
64
|
+
let { baseDir } = options;
|
|
65
|
+
if (!baseDir)
|
|
66
|
+
baseDir = process.cwd();
|
|
67
|
+
const inspect = (value) => {
|
|
68
|
+
return new handlebars_1.default.SafeString(JSON.stringify(value, null, 2));
|
|
69
|
+
};
|
|
70
|
+
const length = (...list) => {
|
|
71
|
+
const _fn = list.pop();
|
|
72
|
+
let result = 0;
|
|
73
|
+
for (const item of list) {
|
|
74
|
+
if (Array.isArray(item)) {
|
|
75
|
+
result += item.length;
|
|
76
|
+
}
|
|
77
|
+
else if (item.constructor === Map) {
|
|
78
|
+
result += item.size;
|
|
79
|
+
}
|
|
80
|
+
else if (typeof item === 'object') {
|
|
81
|
+
result += Object.keys(item).length;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
const coalesce = (...list) => {
|
|
87
|
+
const _fn = list.pop();
|
|
88
|
+
return list.find((item) => item !== undefined && item !== '');
|
|
89
|
+
};
|
|
90
|
+
const source_url = (location, fileLinenoSeparator = '#L') => {
|
|
91
|
+
if (typeof fileLinenoSeparator === 'object') {
|
|
92
|
+
fileLinenoSeparator = '#L';
|
|
93
|
+
}
|
|
94
|
+
const [path, lineno] = location.split(':');
|
|
95
|
+
if ((0, path_1.isAbsolute)(path))
|
|
96
|
+
return;
|
|
97
|
+
if (path.startsWith('vendor/') || path.startsWith('node_modules/'))
|
|
98
|
+
return;
|
|
99
|
+
if (options.sourceURL) {
|
|
100
|
+
const url = new URL(options.sourceURL.toString());
|
|
101
|
+
if (url.protocol === 'file:') {
|
|
102
|
+
(0, assert_1.default)(baseDir);
|
|
103
|
+
const sourcePath = (0, path_1.relative)(baseDir, (0, path_1.join)(url.pathname, path));
|
|
104
|
+
return new handlebars_1.default.SafeString([sourcePath, lineno].filter(Boolean).join(fileLinenoSeparator));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
url.pathname = (0, path_1.join)(url.pathname, path);
|
|
108
|
+
if (lineno)
|
|
109
|
+
url.hash = `L${lineno}`;
|
|
110
|
+
return new handlebars_1.default.SafeString(url.toString());
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return new handlebars_1.default.SafeString(location);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const appmap_title = (appmap) => {
|
|
118
|
+
const tokens = [];
|
|
119
|
+
if (appmap.recorderName)
|
|
120
|
+
tokens.push(['[', appmap.recorderName, ']'].join(''));
|
|
121
|
+
tokens.push(appmap.displayName);
|
|
122
|
+
return tokens.join(' ');
|
|
123
|
+
};
|
|
124
|
+
const appmap_url = (revisionName, appmap) => {
|
|
125
|
+
let { id } = appmap;
|
|
126
|
+
const path = [revisionName, `${id}.appmap.json`].join('/');
|
|
127
|
+
if (options.appmapURL) {
|
|
128
|
+
const url = new URL(options.appmapURL.toString());
|
|
129
|
+
url.searchParams.append('path', path);
|
|
130
|
+
return new handlebars_1.default.SafeString(url.toString());
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return new handlebars_1.default.SafeString(path);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const appmap_diff_url = (appmap) => {
|
|
137
|
+
const path = ['diff', `${appmap.id}.diff.sequence.json`].join('/');
|
|
138
|
+
if (options.appmapURL) {
|
|
139
|
+
const url = new URL(options.appmapURL.toString());
|
|
140
|
+
url.searchParams.append('path', path);
|
|
141
|
+
return new handlebars_1.default.SafeString(url.toString());
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return new handlebars_1.default.SafeString(path);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
inspect,
|
|
149
|
+
length,
|
|
150
|
+
coalesce,
|
|
151
|
+
appmap_title,
|
|
152
|
+
appmap_url,
|
|
153
|
+
appmap_diff_url,
|
|
154
|
+
source_url,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
static async build(section, templateDir = TemplateDirectory) {
|
|
158
|
+
(0, assert_1.default)(templateDir);
|
|
159
|
+
const headingTemplateFile = (0, path_1.join)(templateDir, section, 'heading.hbs');
|
|
160
|
+
const headingTemplate = handlebars_1.default.compile(await (0, promises_1.readFile)(headingTemplateFile, 'utf8'));
|
|
161
|
+
const detailsTemplateFile = (0, path_1.join)(templateDir, section, 'details.hbs');
|
|
162
|
+
const detailsTemplate = handlebars_1.default.compile(await (0, promises_1.readFile)(detailsTemplateFile, 'utf8'));
|
|
163
|
+
return new ReportSection(section, headingTemplate, detailsTemplate);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
exports.default = ReportSection;
|
|
167
|
+
//# sourceMappingURL=ReportSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportSection.js","sourceRoot":"","sources":["../../../src/cmds/compare-report/ReportSection.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoD;AACpD,+BAAkD;AAElD,0CAAuC;AAEvC,2BAAgC;AAChC,oDAA4B;AAE5B,kEAA+C;AAE/C,MAAM,iBAAiB,GAAG;IACxB,kCAAkC;IAClC,qCAAqC,EAAE,iBAAiB;CACzD;KACE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;KAC1C,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,eAAU,EAAC,OAAO,CAAC,CAAC,CAAC;AAC1C,IAAA,gBAAM,EAAC,iBAAiB,EAAE,qDAAqD,CAAC,CAAC;AAEpE,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,uCAA4B,CAAA;IAC5B,uCAA4B,CAAA;IAC5B,gCAAqB,CAAA;IACrB,qCAA0B,CAAA;AAC5B,CAAC,EALW,OAAO,GAAP,eAAO,KAAP,eAAO,QAKlB;AAED,IAAY,mBAEX;AAFD,WAAY,mBAAmB;IAC7B,yDAAkC,CAAA;AACpC,CAAC,EAFW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAE9B;AASD,MAAqB,aAAa;IAChC,YACS,OAAsC,EACrC,eAA2C,EAC3C,eAA2C;QAF5C,YAAO,GAAP,OAAO,CAA+B;QACrC,oBAAe,GAAf,eAAe,CAA4B;QAC3C,oBAAe,GAAf,eA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aACxC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,OAAO;YACP,MAAM;YACN,QAAQ;YACR,YAAY;YACZ,UAAU;YACV,eAAe;YACf,UAAU;SACX,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,KAAK,CAChB,OAAsC,EACtC,WAAW,GAAG,iBAAiB;QAE/B,IAAA,gBAAM,EAAC,WAAW,CAAC,CAAC;QACpB,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QACtE,MAAM,eAAe,GAAG,oBAAU,CAAC,OAAO,CAAC,MAAM,IAAA,mBAAQ,EAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;QAExF,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QACtE,MAAM,eAAe,GAAG,oBAAU,CAAC,OAAO,CAAC,MAAM,IAAA,mBAAQ,EAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC;QAExF,OAAO,IAAI,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;IACtE,CAAC;CACF;AApJD,gCAoJC"}
|
|
@@ -65,7 +65,6 @@ const handler = async (argv) => {
|
|
|
65
65
|
(0, utils_1.verbose)(argv.verbose);
|
|
66
66
|
const { directory, includeSection: includeSections, excludeSection: excludeSections } = argv;
|
|
67
67
|
(0, handleWorkingDirectory_1.handleWorkingDirectory)(directory);
|
|
68
|
-
const baseDir = process.cwd();
|
|
69
68
|
const { reportDirectory, sourceUrl, appmapUrl } = argv;
|
|
70
69
|
process.chdir(reportDirectory);
|
|
71
70
|
const makeArray = (arg) => {
|
|
@@ -79,7 +78,7 @@ const handler = async (argv) => {
|
|
|
79
78
|
mdReport.includeSections = makeArray(includeSections);
|
|
80
79
|
if (excludeSections)
|
|
81
80
|
mdReport.excludeSections = makeArray(excludeSections);
|
|
82
|
-
const reportMD = await mdReport.generateReport(report
|
|
81
|
+
const reportMD = await mdReport.generateReport(report);
|
|
83
82
|
await (0, promises_1.writeFile)('report.md', reportMD);
|
|
84
83
|
};
|
|
85
84
|
exports.handler = handler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareReport.js","sourceRoot":"","sources":["../../../src/cmds/compare-report/compareReport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAkD;AAElD,6EAA0E;AAC1E,uCAAsC;AAEtC,mEAAmF;AAGtE,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,QAAQ,GACnB,mFAAmF,CAAC;AAE/E,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAE,EAAE;IAC1C,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE;QAClC,QAAQ,EAAE,0CAA0C;QACpD,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QACxB,QAAQ,EAAE,wGAAwG;QAClH,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QACxB,QAAQ,EAAE,yIAAyI;QACnJ,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;QACvB,QAAQ,EAAE,2BAA2B;QACrC,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;KACX,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;QAC7B,QAAQ,EACN,8JAA8J;YAC9J,kCAAkC,sCAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACtE,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;QAC7B,QAAQ,EAAE,wEAAwE,yBAAQ,CAAC,IAAI,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