@node-core/utils 4.0.0 → 4.1.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/bin/ncu-ci.js +11 -2
- package/lib/ci/build-types/commit_build.js +7 -1
- package/lib/ci/build-types/pr_build.js +3 -3
- package/lib/ci/failure_aggregator.js +5 -3
- package/lib/github/templates/next-security-release.md +1 -1
- package/lib/links.js +2 -2
- package/lib/update-v8/applyNodeChanges.js +1 -6
- package/lib/update-v8/backport.js +5 -17
- package/lib/update-v8/index.js +1 -5
- package/lib/update-v8/majorUpdate.js +1 -6
- package/lib/update-v8/minorUpdate.js +1 -6
- package/lib/update-v8/updateV8Clone.js +1 -6
- package/lib/update-v8/updateVersionNumbers.js +1 -6
- package/package.json +10 -10
package/bin/ncu-ci.js
CHANGED
@@ -215,6 +215,11 @@ const args = yargs(hideBin(process.argv))
|
|
215
215
|
default: false,
|
216
216
|
type: 'boolean'
|
217
217
|
})
|
218
|
+
.option('skip-more-than', {
|
219
|
+
describe: 'Skip jobs that fail more than <limit> builds, when --stat is true, default to 10.',
|
220
|
+
type: 'number',
|
221
|
+
default: Infinity
|
222
|
+
})
|
218
223
|
.option('nobuild', {
|
219
224
|
describe: 'If running cigtm, whether or not jobid is citgm-nobuild.',
|
220
225
|
type: 'boolean',
|
@@ -325,15 +330,19 @@ class CICommand {
|
|
325
330
|
cli.separator('');
|
326
331
|
|
327
332
|
let build;
|
333
|
+
let { skipMoreThan } = argv;
|
334
|
+
if (argv.stats && argv.skipMoreThan === Infinity) {
|
335
|
+
skipMoreThan = 10;
|
336
|
+
}
|
328
337
|
switch (job.type) {
|
329
338
|
case 'health':
|
330
339
|
build = new HealthBuild(cli, request, job.ciType, job.builds);
|
331
340
|
break;
|
332
341
|
case PR:
|
333
|
-
build = new PRBuild(cli, request, job.jobid);
|
342
|
+
build = new PRBuild(cli, request, job.jobid, skipMoreThan);
|
334
343
|
break;
|
335
344
|
case COMMIT:
|
336
|
-
build = new CommitBuild(cli, request, job.jobid);
|
345
|
+
build = new CommitBuild(cli, request, job.jobid, skipMoreThan);
|
337
346
|
break;
|
338
347
|
case CITGM:
|
339
348
|
case CITGM_NOBUILD:
|
@@ -20,10 +20,11 @@ const {
|
|
20
20
|
} = CIFailureParser;
|
21
21
|
|
22
22
|
export class CommitBuild extends TestBuild {
|
23
|
-
constructor(cli, request, id) {
|
23
|
+
constructor(cli, request, id, skipMoreThan) {
|
24
24
|
const path = `job/node-test-commit/${id}/`;
|
25
25
|
const tree = COMMIT_TREE;
|
26
26
|
super(cli, request, path, tree);
|
27
|
+
this.skipMoreThan = skipMoreThan;
|
27
28
|
}
|
28
29
|
|
29
30
|
getBuilds({ result, subBuilds }) {
|
@@ -89,6 +90,11 @@ export class CommitBuild extends TestBuild {
|
|
89
90
|
return { result, builds, failures };
|
90
91
|
}
|
91
92
|
|
93
|
+
if (builds.failed.length > this.skipMoreThan) {
|
94
|
+
cli.log(`Failed ${builds.failed.length} builds (> ${this.skipMoreThan}), skipping`);
|
95
|
+
return { result, builds, failures: [] };
|
96
|
+
}
|
97
|
+
|
92
98
|
cli.startSpinner(`Querying failures of ${path}`);
|
93
99
|
const promises = builds.failed.map(({ jobName, buildNumber, url }) => {
|
94
100
|
if (jobName.includes('fanned')) {
|
@@ -15,11 +15,11 @@ const {
|
|
15
15
|
} = CIFailureParser;
|
16
16
|
|
17
17
|
export class PRBuild extends TestBuild {
|
18
|
-
constructor(cli, request, id) {
|
18
|
+
constructor(cli, request, id, skipMoreThan) {
|
19
19
|
const path = `job/node-test-pull-request/${id}/`;
|
20
20
|
const tree = PR_TREE;
|
21
21
|
super(cli, request, path, tree);
|
22
|
-
|
22
|
+
this.skipMoreThan = skipMoreThan;
|
23
23
|
this.commitBuild = null;
|
24
24
|
}
|
25
25
|
|
@@ -78,7 +78,7 @@ export class PRBuild extends TestBuild {
|
|
78
78
|
result, subBuilds: allBuilds, changeSet, actions, timestamp
|
79
79
|
};
|
80
80
|
const commitBuildId = commitBuild.buildNumber;
|
81
|
-
this.commitBuild = new CommitBuild(cli, request, commitBuildId);
|
81
|
+
this.commitBuild = new CommitBuild(cli, request, commitBuildId, this.skipMoreThan);
|
82
82
|
const { builds, failures } = await this.commitBuild.getResults(buildData);
|
83
83
|
|
84
84
|
// Set up aliases for display
|
@@ -43,7 +43,9 @@ export class FailureAggregator {
|
|
43
43
|
.sortBy((f) => parseJobFromURL(f.upstream).jobid)
|
44
44
|
.map((item) => ({ source: item.source, upstream: item.upstream }))
|
45
45
|
.value();
|
46
|
-
const machines = _.
|
46
|
+
const machines = _.uniqBy(
|
47
|
+
failures.map(f => ({ hostname: f.builtOn, url: f.url })),
|
48
|
+
'hostname');
|
47
49
|
data.push({
|
48
50
|
reason, type: failures[0].type, failures, prs, machines
|
49
51
|
});
|
@@ -91,7 +93,7 @@ export class FailureAggregator {
|
|
91
93
|
output += markdownRow('Reason', `<code>${reason}</code>`);
|
92
94
|
output += markdownRow('-', ':-');
|
93
95
|
output += markdownRow('Type', type);
|
94
|
-
const source = prs.map(f => f.source);
|
96
|
+
const source = prs.map(f => `[${f.source}](${f.upstream})`);
|
95
97
|
output += markdownRow(
|
96
98
|
'Failed PR', `${source.length} (${source.join(', ')})`
|
97
99
|
);
|
@@ -137,7 +139,7 @@ export class FailureAggregator {
|
|
137
139
|
return parsed ? `#${parsed.prid}` : f.source;
|
138
140
|
});
|
139
141
|
cli.table('Failed PR', `${source.length} (${source.join(', ')})`);
|
140
|
-
cli.table('Appeared', machines.join(', '));
|
142
|
+
cli.table('Appeared', machines.map(m => m.hostname).join(', '));
|
141
143
|
if (prs.length > 1) {
|
142
144
|
cli.table('First CI', `${prs[0].upstream}`);
|
143
145
|
}
|
@@ -62,7 +62,7 @@
|
|
62
62
|
|
63
63
|
* [ ] [Unlock CI](https://github.com/nodejs/build/blob/HEAD/doc/jenkins-guide.md#after-the-release)
|
64
64
|
|
65
|
-
* [ ] Post-release announcement to Nodejs.org blog:
|
65
|
+
* [ ] Post-release announcement to Nodejs.org blog:
|
66
66
|
* (Re-PR the pre-approved branch from nodejs-private/nodejs.org-private to
|
67
67
|
nodejs/nodejs.org)
|
68
68
|
|
package/lib/links.js
CHANGED
@@ -106,8 +106,8 @@ export function getPrURL({ owner, repo, prid }) {
|
|
106
106
|
return `https://github.com/${owner}/${repo}/pull/${prid}`;
|
107
107
|
};
|
108
108
|
|
109
|
-
export function getMachineUrl(
|
110
|
-
return `[${
|
109
|
+
export function getMachineUrl(machine) {
|
110
|
+
return `[${machine.hostname}](${machine.url})`;
|
111
111
|
};
|
112
112
|
|
113
113
|
const PR_URL_RE = /PR-URL: https:\/\/github.com\/.+/;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import path from 'node:path';
|
2
2
|
|
3
|
-
import Enquirer from 'enquirer';
|
4
3
|
import { Listr } from 'listr2';
|
5
4
|
|
6
5
|
import {
|
@@ -23,11 +22,7 @@ export default function applyNodeChanges() {
|
|
23
22
|
task: async(ctx) => {
|
24
23
|
const v8Version = await getNodeV8Version(ctx.nodeDir);
|
25
24
|
const list = filterForVersion(nodeChanges, v8Version);
|
26
|
-
return new Listr(list.map((change) => change.task())
|
27
|
-
injectWrapper: {
|
28
|
-
enquirer: new Enquirer()
|
29
|
-
}
|
30
|
-
});
|
25
|
+
return new Listr(list.map((change) => change.task()));
|
31
26
|
}
|
32
27
|
};
|
33
28
|
}
|
@@ -3,9 +3,9 @@ import {
|
|
3
3
|
promises as fs
|
4
4
|
} from 'node:fs';
|
5
5
|
|
6
|
-
import Enquirer from 'enquirer';
|
7
6
|
import inquirer from 'inquirer';
|
8
7
|
import { Listr } from 'listr2';
|
8
|
+
import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer';
|
9
9
|
|
10
10
|
import { shortSha } from '../utils.js';
|
11
11
|
|
@@ -51,11 +51,7 @@ export function doBackport(options) {
|
|
51
51
|
return {
|
52
52
|
title: 'V8 commit backport',
|
53
53
|
task: () => {
|
54
|
-
return new Listr(todo
|
55
|
-
injectWrapper: {
|
56
|
-
enquirer: new Enquirer()
|
57
|
-
}
|
58
|
-
});
|
54
|
+
return new Listr(todo);
|
59
55
|
}
|
60
56
|
};
|
61
57
|
};
|
@@ -169,11 +165,7 @@ function applyAndCommitPatches() {
|
|
169
165
|
return {
|
170
166
|
title: 'Apply and commit patches to deps/v8',
|
171
167
|
task: (ctx) => {
|
172
|
-
return new Listr(ctx.patches.map(applyPatchTask)
|
173
|
-
injectWrapper: {
|
174
|
-
enquirer: new Enquirer()
|
175
|
-
}
|
176
|
-
});
|
168
|
+
return new Listr(ctx.patches.map(applyPatchTask));
|
177
169
|
}
|
178
170
|
};
|
179
171
|
}
|
@@ -196,11 +188,7 @@ function applyPatchTask(patch) {
|
|
196
188
|
}
|
197
189
|
}
|
198
190
|
todo.push(commitPatch(patch));
|
199
|
-
return new Listr(todo
|
200
|
-
injectWrapper: {
|
201
|
-
enquirer: new Enquirer()
|
202
|
-
}
|
203
|
-
});
|
191
|
+
return new Listr(todo);
|
204
192
|
}
|
205
193
|
};
|
206
194
|
}
|
@@ -214,7 +202,7 @@ async function applyPatch(ctx, task, patch) {
|
|
214
202
|
);
|
215
203
|
} catch (e) {
|
216
204
|
patch.hadConflicts = true;
|
217
|
-
return task.prompt({
|
205
|
+
return task.prompt(ListrEnquirerPromptAdapter).run({
|
218
206
|
type: 'input',
|
219
207
|
message: "Resolve merge conflicts and enter 'RESOLVED'",
|
220
208
|
validate: value => value.toUpperCase() === 'RESOLVED'
|
package/lib/update-v8/index.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import Enquirer from 'enquirer';
|
2
1
|
import { Listr } from 'listr2';
|
3
2
|
|
4
3
|
import { checkOptions, doBackport } from './backport.js';
|
@@ -48,9 +47,6 @@ export async function backport(options) {
|
|
48
47
|
*/
|
49
48
|
function getOptions(opts) {
|
50
49
|
return {
|
51
|
-
renderer: opts.verbose ? 'verbose' : 'default'
|
52
|
-
injectWrapper: {
|
53
|
-
enquirer: new Enquirer()
|
54
|
-
}
|
50
|
+
renderer: opts.verbose ? 'verbose' : 'default'
|
55
51
|
};
|
56
52
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import path from 'node:path';
|
2
2
|
import { promises as fs } from 'node:fs';
|
3
3
|
|
4
|
-
import Enquirer from 'enquirer';
|
5
4
|
import { Listr } from 'listr2';
|
6
5
|
|
7
6
|
import { getCurrentV8Version } from './common.js';
|
@@ -30,11 +29,7 @@ export default function majorUpdate() {
|
|
30
29
|
addDepsV8(),
|
31
30
|
updateV8Deps(),
|
32
31
|
applyNodeChanges()
|
33
|
-
]
|
34
|
-
injectWrapper: {
|
35
|
-
enquirer: new Enquirer()
|
36
|
-
}
|
37
|
-
});
|
32
|
+
]);
|
38
33
|
}
|
39
34
|
};
|
40
35
|
};
|
@@ -2,7 +2,6 @@ import { spawn } from 'node:child_process';
|
|
2
2
|
import path from 'node:path';
|
3
3
|
import { promises as fs } from 'node:fs';
|
4
4
|
|
5
|
-
import Enquirer from 'enquirer';
|
6
5
|
import { Listr } from 'listr2';
|
7
6
|
|
8
7
|
import { getCurrentV8Version } from './common.js';
|
@@ -17,11 +16,7 @@ export default function minorUpdate() {
|
|
17
16
|
getCurrentV8Version(),
|
18
17
|
getLatestV8Version(),
|
19
18
|
doMinorUpdate()
|
20
|
-
]
|
21
|
-
injectWrapper: {
|
22
|
-
enquirer: new Enquirer()
|
23
|
-
}
|
24
|
-
});
|
19
|
+
]);
|
25
20
|
}
|
26
21
|
};
|
27
22
|
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { promises as fs } from 'node:fs';
|
2
2
|
|
3
|
-
import Enquirer from 'enquirer';
|
4
3
|
import { Listr } from 'listr2';
|
5
4
|
|
6
5
|
import { v8Git } from './constants.js';
|
@@ -10,11 +9,7 @@ export default function updateV8Clone() {
|
|
10
9
|
return {
|
11
10
|
title: 'Update local V8 clone',
|
12
11
|
task: () => {
|
13
|
-
return new Listr([fetchOrigin(), createClone()]
|
14
|
-
injectWrapper: {
|
15
|
-
enquirer: new Enquirer()
|
16
|
-
}
|
17
|
-
});
|
12
|
+
return new Listr([fetchOrigin(), createClone()]);
|
18
13
|
}
|
19
14
|
};
|
20
15
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import path from 'node:path';
|
2
2
|
import { promises as fs } from 'node:fs';
|
3
3
|
|
4
|
-
import Enquirer from 'enquirer';
|
5
4
|
import { Listr } from 'listr2';
|
6
5
|
|
7
6
|
import { getNodeV8Version } from './util.js';
|
@@ -10,11 +9,7 @@ export default function updateVersionNumbers() {
|
|
10
9
|
return {
|
11
10
|
title: 'Update version numbers',
|
12
11
|
task: () => {
|
13
|
-
return new Listr([resetEmbedderString(), bumpNodeModule()]
|
14
|
-
injectWrapper: {
|
15
|
-
enquirer: new Enquirer()
|
16
|
-
}
|
17
|
-
});
|
12
|
+
return new Listr([resetEmbedderString(), bumpNodeModule()]);
|
18
13
|
}
|
19
14
|
};
|
20
15
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@node-core/utils",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.1.0",
|
4
4
|
"description": "Utilities for Node.js core collaborators",
|
5
5
|
"type": "module",
|
6
6
|
"engines": {
|
@@ -34,36 +34,36 @@
|
|
34
34
|
],
|
35
35
|
"license": "MIT",
|
36
36
|
"dependencies": {
|
37
|
+
"@listr2/prompt-adapter-enquirer": "^1.0.1",
|
37
38
|
"@node-core/caritat": "^1.2.0",
|
39
|
+
"@pkgjs/nv": "^0.2.1",
|
38
40
|
"branch-diff": "^2.1.4",
|
39
41
|
"chalk": "^5.3.0",
|
40
42
|
"changelog-maker": "^3.2.4",
|
41
|
-
"@pkgjs/nv": "^0.2.1",
|
42
43
|
"cheerio": "^1.0.0-rc.12",
|
43
44
|
"clipboardy": "^3.0.0",
|
44
45
|
"core-validate-commit": "^4.0.0",
|
45
|
-
"enquirer": "^2.4.1",
|
46
46
|
"figures": "^5.0.0",
|
47
47
|
"ghauth": "^5.0.1",
|
48
|
-
"inquirer": "^9.2.
|
48
|
+
"inquirer": "^9.2.11",
|
49
49
|
"js-yaml": "^4.1.0",
|
50
|
-
"listr2": "^
|
50
|
+
"listr2": "^7.0.1",
|
51
51
|
"lodash": "^4.17.21",
|
52
52
|
"log-symbols": "^5.1.0",
|
53
53
|
"ora": "^7.0.1",
|
54
54
|
"replace-in-file": "^7.0.1",
|
55
|
-
"undici": "^5.
|
56
|
-
"which": "^
|
55
|
+
"undici": "^5.25.2",
|
56
|
+
"which": "^4.0.0",
|
57
57
|
"yargs": "^17.7.2"
|
58
58
|
},
|
59
59
|
"devDependencies": {
|
60
60
|
"@reporters/github": "^1.5.2",
|
61
61
|
"c8": "^8.0.1",
|
62
|
-
"eslint": "^8.
|
62
|
+
"eslint": "^8.50.0",
|
63
63
|
"eslint-config-standard": "^17.1.0",
|
64
64
|
"eslint-plugin-import": "^2.28.1",
|
65
|
-
"eslint-plugin-n": "^16.0
|
65
|
+
"eslint-plugin-n": "^16.1.0",
|
66
66
|
"eslint-plugin-promise": "^6.1.1",
|
67
|
-
"sinon": "^
|
67
|
+
"sinon": "^16.0.0"
|
68
68
|
}
|
69
69
|
}
|