@lage-run/reporters 0.2.44 → 0.3.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.json +43 -1
- package/CHANGELOG.md +20 -2
- package/lib/AdoReporter.js +6 -2
- package/lib/LogReporter.js +5 -1
- package/lib/components/SummaryInfo.js +4 -3
- package/lib/slowestTargetRuns.d.ts +2 -0
- package/lib/slowestTargetRuns.js +12 -0
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,49 @@
|
|
|
2
2
|
"name": "@lage-run/reporters",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 27 Jan 2023 00:28:03 GMT",
|
|
6
|
+
"tag": "@lage-run/reporters_v0.3.1",
|
|
7
|
+
"version": "0.3.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "@lage-run/reporters",
|
|
13
|
+
"commit": "b0f0b5a7773a71c111799f3a3b0a48a7824b838b",
|
|
14
|
+
"comment": "fixing profiler so that it will load correctly in the tracing UI"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 18 Jan 2023 18:18:35 GMT",
|
|
21
|
+
"tag": "@lage-run/reporters_v0.3.0",
|
|
22
|
+
"version": "0.3.0",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"author": "kchau@microsoft.com",
|
|
27
|
+
"package": "@lage-run/reporters",
|
|
28
|
+
"commit": "71b5b1452ee25148a637894d1bf99cf1cc6a80a7",
|
|
29
|
+
"comment": "Using lage for prune and clear on cache and get reporter in shape for ADO"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@lage-run/reporters",
|
|
34
|
+
"comment": "Bump @lage-run/scheduler-types to v0.3.0",
|
|
35
|
+
"commit": "71b5b1452ee25148a637894d1bf99cf1cc6a80a7"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@lage-run/reporters",
|
|
40
|
+
"comment": "Bump @lage-run/format-hrtime to v0.1.4",
|
|
41
|
+
"commit": "71b5b1452ee25148a637894d1bf99cf1cc6a80a7"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"date": "Thu, 05 Jan 2023 00:40:50 GMT",
|
|
6
48
|
"tag": "@lage-run/reporters_v0.2.44",
|
|
7
49
|
"version": "0.2.44",
|
|
8
50
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @lage-run/reporters
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 27 Jan 2023 00:28:03 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.3.1
|
|
8
|
+
|
|
9
|
+
Fri, 27 Jan 2023 00:28:03 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- fixing profiler so that it will load correctly in the tracing UI (kchau@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 0.3.0
|
|
16
|
+
|
|
17
|
+
Wed, 18 Jan 2023 18:18:35 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Using lage for prune and clear on cache and get reporter in shape for ADO (kchau@microsoft.com)
|
|
22
|
+
- Bump @lage-run/scheduler-types to v0.3.0
|
|
23
|
+
- Bump @lage-run/format-hrtime to v0.1.4
|
|
24
|
+
|
|
7
25
|
## 0.2.44
|
|
8
26
|
|
|
9
|
-
Thu, 05 Jan 2023 00:40:
|
|
27
|
+
Thu, 05 Jan 2023 00:40:50 GMT
|
|
10
28
|
|
|
11
29
|
### Patches
|
|
12
30
|
|
package/lib/AdoReporter.js
CHANGED
|
@@ -10,6 +10,7 @@ const _formatHrtime = require("@lage-run/format-hrtime");
|
|
|
10
10
|
const _isTargetStatusLogEntryJs = require("./isTargetStatusLogEntry.js");
|
|
11
11
|
const _logger = require("@lage-run/logger");
|
|
12
12
|
const _chalk = /*#__PURE__*/ _interopRequireDefault(require("chalk"));
|
|
13
|
+
const _slowestTargetRunsJs = require("./slowestTargetRuns.js");
|
|
13
14
|
function _interopRequireDefault(obj) {
|
|
14
15
|
return obj && obj.__esModule ? obj : {
|
|
15
16
|
default: obj
|
|
@@ -101,7 +102,7 @@ class AdoReporter {
|
|
|
101
102
|
const { packageName: packageName1 , task: task1 } = target1;
|
|
102
103
|
const normalizedArgs1 = this.options.grouped ? normalize(entry.msg) : normalize(getTaskLogPrefix(packageName1 ?? "<root>", task1), entry.msg);
|
|
103
104
|
return this.logStream.write(format(entry.level, normalizedArgs1.prefix, colorFn("| " + normalizedArgs1.message)));
|
|
104
|
-
} else {
|
|
105
|
+
} else if (entry?.msg.trim() !== "") {
|
|
105
106
|
return this.logStream.write(format(entry.level, "", entry.msg));
|
|
106
107
|
}
|
|
107
108
|
}
|
|
@@ -137,7 +138,10 @@ class AdoReporter {
|
|
|
137
138
|
};
|
|
138
139
|
this.logStream.write(_chalk.default.cyanBright(`##[section]Summary\n`));
|
|
139
140
|
if (targetRuns.size > 0) {
|
|
140
|
-
|
|
141
|
+
const slowestTargets = (0, _slowestTargetRunsJs.slowestTargetRuns)([
|
|
142
|
+
...targetRuns.values()
|
|
143
|
+
]);
|
|
144
|
+
for (const wrappedTarget of slowestTargets){
|
|
141
145
|
const colorFn = statusColorFn[wrappedTarget.status];
|
|
142
146
|
const target = wrappedTarget.target;
|
|
143
147
|
this.logStream.write(format(_logger.LogLevel.info, getTaskLogPrefix(target.packageName || "[GLOBAL]", target.task), colorFn(`${wrappedTarget.status}${wrappedTarget.duration ? `, took ${(0, _formatHrtime.formatDuration)((0, _formatHrtime.hrToSeconds)(wrappedTarget.duration))}` : ""}`)));
|
package/lib/LogReporter.js
CHANGED
|
@@ -14,6 +14,7 @@ const _chalk = /*#__PURE__*/ _interopRequireDefault(require("chalk"));
|
|
|
14
14
|
const _gradientString = /*#__PURE__*/ _interopRequireDefault(require("gradient-string"));
|
|
15
15
|
const _crypto = /*#__PURE__*/ _interopRequireDefault(require("crypto"));
|
|
16
16
|
const _formatBytesJs = require("./formatBytes.js");
|
|
17
|
+
const _slowestTargetRunsJs = require("./slowestTargetRuns.js");
|
|
17
18
|
function _interopRequireDefault(obj) {
|
|
18
19
|
return obj && obj.__esModule ? obj : {
|
|
19
20
|
default: obj
|
|
@@ -181,7 +182,10 @@ class LogReporter {
|
|
|
181
182
|
if (targetRuns.size > 0) {
|
|
182
183
|
this.print(_chalk.default.cyanBright(`\nSummary`));
|
|
183
184
|
this.hr();
|
|
184
|
-
|
|
185
|
+
const slowestTargets = (0, _slowestTargetRunsJs.slowestTargetRuns)([
|
|
186
|
+
...targetRuns.values()
|
|
187
|
+
]);
|
|
188
|
+
for (const wrappedTarget of slowestTargets){
|
|
185
189
|
if (wrappedTarget.target.hidden) {
|
|
186
190
|
continue;
|
|
187
191
|
}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "SummaryInfo", {
|
|
|
9
9
|
const _formatHrtime = require("@lage-run/format-hrtime");
|
|
10
10
|
const _ink = require("ink");
|
|
11
11
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
12
|
+
const _slowestTargetRuns = require("../slowestTargetRuns");
|
|
12
13
|
const _errorMessages = require("./ErrorMessages");
|
|
13
14
|
function _getRequireWildcardCache(nodeInterop) {
|
|
14
15
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -53,9 +54,9 @@ function SummaryInfo(props) {
|
|
|
53
54
|
const { summary } = props;
|
|
54
55
|
const { schedulerRunSummary , logEntries } = summary;
|
|
55
56
|
const { targetRunByStatus , targetRuns , duration } = schedulerRunSummary;
|
|
56
|
-
const
|
|
57
|
+
const slowestTargets = (0, _slowestTargetRuns.slowestTargetRuns)([
|
|
57
58
|
...targetRuns.values()
|
|
58
|
-
]
|
|
59
|
+
]);
|
|
59
60
|
const { failed , aborted , skipped , success , pending } = targetRunByStatus;
|
|
60
61
|
const errors = failed && failed.length > 0 ? new Map(failed.map((targetId)=>[
|
|
61
62
|
targetId,
|
|
@@ -71,7 +72,7 @@ function SummaryInfo(props) {
|
|
|
71
72
|
flexDirection: "column",
|
|
72
73
|
marginLeft: 2,
|
|
73
74
|
marginY: 1
|
|
74
|
-
},
|
|
75
|
+
}, slowestTargets.slice(0, 10).filter((run)=>!run.target.hidden).map((targetRun)=>/*#__PURE__*/ _react.createElement(_ink.Text, {
|
|
75
76
|
key: targetRun.target.id
|
|
76
77
|
}, targetRun.target.id, " - ", (0, _formatHrtime.formatDuration)((0, _formatHrtime.hrToSeconds)(targetRun.duration))))), errors.size > 0 ? /*#__PURE__*/ _react.createElement(_errorMessages.ErrorMessages, {
|
|
77
78
|
errors: errors
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "slowestTargetRuns", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>slowestTargetRuns
|
|
8
|
+
});
|
|
9
|
+
const _formatHrtime = require("@lage-run/format-hrtime");
|
|
10
|
+
function slowestTargetRuns(targetRuns) {
|
|
11
|
+
return targetRuns.sort((a, b)=>parseFloat((0, _formatHrtime.hrToSeconds)((0, _formatHrtime.hrtimeDiff)(a.duration, b.duration)))).filter((run)=>run.status !== "skipped" && !run.target.hidden);
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/reporters",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Log reporters for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/microsoft/lage"
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@lage-run/logger": "^1.2.2",
|
|
19
|
-
"@lage-run/scheduler-types": "^0.
|
|
19
|
+
"@lage-run/scheduler-types": "^0.3.0",
|
|
20
20
|
"@lage-run/target-graph": "^0.6.1",
|
|
21
|
-
"@lage-run/format-hrtime": "^0.1.
|
|
21
|
+
"@lage-run/format-hrtime": "^0.1.4",
|
|
22
22
|
"chalk": "^4.0.0",
|
|
23
23
|
"ansi-regex": "^5.0.1",
|
|
24
24
|
"gradient-string": "^2.0.1",
|