@definitelytyped/dtslint-runner 0.1.17 → 0.1.19
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 +16 -0
- package/dist/post-results.js +42 -18
- package/dist/post-results.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @definitelytyped/dtslint-runner
|
|
2
2
|
|
|
3
|
+
## 0.1.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [946d3d4]
|
|
8
|
+
- @definitelytyped/definitions-parser@0.1.10
|
|
9
|
+
- @definitelytyped/dtslint@0.2.16
|
|
10
|
+
|
|
11
|
+
## 0.1.18
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [465dbce]
|
|
16
|
+
- Updated dependencies [5dae397]
|
|
17
|
+
- @definitelytyped/dtslint@0.2.15
|
|
18
|
+
|
|
3
19
|
## 0.1.17
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/post-results.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const rest_1 = require("@octokit/rest");
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const glob = require("glob");
|
|
6
|
-
// Args: [auth token] [buildId] [status comment] [user to tag] [issue] [job status] [?main errors file] [?branch errors file]
|
|
6
|
+
// Args: [auth token] [buildId] [status comment] [user to tag] [issue] [distinct id] [job status] [?main errors file] [?branch errors file]
|
|
7
7
|
async function main() {
|
|
8
|
-
const [auth, buildId, statusCommentId, userToTag, issue, status, mainErrorsPath, branchErrorsPath] = process.argv.slice(2);
|
|
8
|
+
const [auth, buildId, statusCommentId, userToTag, issue, distinctId, status, mainErrorsPath, branchErrorsPath] = process.argv.slice(2);
|
|
9
9
|
if (!auth)
|
|
10
10
|
throw new Error("First argument must be a GitHub auth token.");
|
|
11
11
|
if (!buildId)
|
|
@@ -16,8 +16,10 @@ async function main() {
|
|
|
16
16
|
throw new Error("Fourth argument must be a GitHub username.");
|
|
17
17
|
if (!issue)
|
|
18
18
|
throw new Error("Fifth argument must be a TypeScript issue/PR number.");
|
|
19
|
+
if (!distinctId)
|
|
20
|
+
throw new Error("Sixth argument must be a distinct ID.");
|
|
19
21
|
if (!status)
|
|
20
|
-
throw new Error("
|
|
22
|
+
throw new Error("Seventh argument must be a status ('ok' or 'fail').");
|
|
21
23
|
const gh = new rest_1.Octokit({ auth });
|
|
22
24
|
const checkLogsMessage = `\n[You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${buildId}&_a=summary).`;
|
|
23
25
|
try {
|
|
@@ -47,7 +49,12 @@ async function main() {
|
|
|
47
49
|
if (diffComment) {
|
|
48
50
|
newComment += `There were interesting changes:\n`;
|
|
49
51
|
if (newComment.length + diffComment.length + checkLogsMessage.length > 65535) {
|
|
50
|
-
|
|
52
|
+
// hardlink directly into the output of this script
|
|
53
|
+
const detailedLogUrl = `https://typescript.visualstudio.com/TypeScript/_build/results?buildId=${buildId}&view=logs&j=275f1d19-1bd8-5591-b06b-07d489ea915a&t=40b1ee41-44d6-5bba-aa04-4b76a5c732e5`;
|
|
54
|
+
newComment += `Changes are too big to display here, please check [the log](${detailedLogUrl}).`;
|
|
55
|
+
console.log("There were interesting changes:\n");
|
|
56
|
+
console.log(diffComment);
|
|
57
|
+
console.log("\n");
|
|
51
58
|
}
|
|
52
59
|
else {
|
|
53
60
|
newComment += diffComment;
|
|
@@ -58,28 +65,45 @@ async function main() {
|
|
|
58
65
|
}
|
|
59
66
|
newComment += checkLogsMessage;
|
|
60
67
|
}
|
|
61
|
-
const
|
|
68
|
+
const resultsComment = await gh.issues.createComment({
|
|
62
69
|
issue_number: +issue,
|
|
63
70
|
owner: "Microsoft",
|
|
64
71
|
repo: "TypeScript",
|
|
65
72
|
body: newComment,
|
|
66
73
|
});
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
const emoji = status !== "fail" ? "✅" : "👀";
|
|
75
|
+
const toReplace = `<!--result-${distinctId}-->`;
|
|
76
|
+
let posted = false;
|
|
77
|
+
for (let i = 0; i < 5; i++) {
|
|
78
|
+
// Get status comment contents
|
|
79
|
+
const statusComment = await gh.rest.issues.getComment({
|
|
80
|
+
comment_id: +statusCommentId,
|
|
81
|
+
owner: "Microsoft",
|
|
82
|
+
repo: "TypeScript",
|
|
83
|
+
});
|
|
84
|
+
const oldComment = statusComment.data.body;
|
|
85
|
+
if (!oldComment?.includes(toReplace)) {
|
|
86
|
+
posted = true;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
const newComment = oldComment.replace(toReplace, `[${emoji} Results](${resultsComment.data.html_url})`);
|
|
90
|
+
// Update status comment
|
|
91
|
+
await gh.rest.issues.updateComment({
|
|
92
|
+
comment_id: +statusCommentId,
|
|
93
|
+
owner: "Microsoft",
|
|
94
|
+
repo: "TypeScript",
|
|
95
|
+
body: newComment,
|
|
96
|
+
});
|
|
97
|
+
// Repeat; someone may have edited the comment at the same time.
|
|
98
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
99
|
+
}
|
|
100
|
+
if (!posted) {
|
|
101
|
+
throw new Error("Failed to update status comment");
|
|
102
|
+
}
|
|
80
103
|
}
|
|
81
104
|
catch (e) {
|
|
82
105
|
console.error(e);
|
|
106
|
+
// TODO(jakebailey): is this a good idea? all that can really fail here is the GH API.
|
|
83
107
|
await gh.issues.createComment({
|
|
84
108
|
issue_number: +issue,
|
|
85
109
|
owner: "Microsoft",
|
package/dist/post-results.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-results.js","sourceRoot":"","sources":["../src/post-results.ts"],"names":[],"mappings":";;AAAA,wCAAwC;AACxC,2BAAkC;AAClC,6BAA8B;AAI9B,
|
|
1
|
+
{"version":3,"file":"post-results.js","sourceRoot":"","sources":["../src/post-results.ts"],"names":[],"mappings":";;AAAA,wCAAwC;AACxC,2BAAkC;AAClC,6BAA8B;AAI9B,2IAA2I;AAC3I,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,CAAC,GAC5G,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAC1E,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACrE,IAAI,CAAC,eAAe;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACrF,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAC9E,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACpF,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC1E,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAEpF,MAAM,EAAE,GAAG,IAAI,cAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACjC,MAAM,gBAAgB,GAAG,sGAAsG,OAAO,eAAe,CAAC;IAEtJ,IAAI,CAAC;QACH,IAAI,UAAU,CAAC;QACf,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,UAAU;gBACR,QAAQ,SAAS,gFAAgF;oBACjG,gBAAgB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CAAC,MAAM;QACrC,CAAC,CAAC;;;;EAIJ,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,GAAG,CAAC,IAAI,qBAAqB,GAAG,CAAC,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;;CAEjG;QACG,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,kBAAkB,GAAG,WAAW,CAAC,MAAM;QAC3C,CAAC,CAAC;;;;EAIJ,WAAW;aACV,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,YAAY,GAAG,CAAC,IAAI,0BAA0B,GAAG,CAAC,SAAS,oCAAoC,GAAG,CAAC,WAAW,UAAU,CAC3H;aACA,IAAI,CAAC,MAAM,CAAC;;CAEd;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,iBAAiB,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAClE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@definitelytyped/dtslint-runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Run dtslint on DefinitelyTyped packages",
|
|
5
5
|
"homepage": "https://github.com/microsoft/DefinitelyTyped-tools/tree/main/packages/dtslint-runner#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@octokit/rest": "^20.0.2",
|
|
22
22
|
"yargs": "^17.7.2",
|
|
23
|
-
"@definitelytyped/definitions-parser": "0.1.
|
|
24
|
-
"@definitelytyped/
|
|
25
|
-
"@definitelytyped/
|
|
23
|
+
"@definitelytyped/definitions-parser": "0.1.10",
|
|
24
|
+
"@definitelytyped/utils": "0.1.5",
|
|
25
|
+
"@definitelytyped/dtslint": "0.2.16"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"glob": "^10.3.10"
|