@node-core/utils 5.9.0 → 5.11.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/git-node.js +2 -0
- package/components/git/metadata.js +1 -0
- package/lib/ci/build-types/health_build.js +4 -4
- package/lib/ci/build-types/test_build.js +2 -0
- package/lib/ci/ci_failure_parser.js +0 -1
- package/lib/cli.js +1 -0
- package/lib/collaborators.js +0 -2
- package/lib/prepare_release.js +2 -3
- package/lib/prepare_security.js +18 -14
- package/lib/release/utils.js +0 -2
- package/lib/request.js +9 -5
- package/lib/security-release/security-release.js +1 -1
- package/lib/security_blog.js +3 -7
- package/lib/team_info.js +0 -1
- package/lib/update-v8/constants.js +18 -0
- package/lib/update-v8/majorUpdate.js +0 -2
- package/lib/voting_session.js +2 -1
- package/package.json +21 -18
package/bin/git-node.js
CHANGED
@@ -20,10 +20,10 @@ class Health {
|
|
20
20
|
formatAsMarkdown() {
|
21
21
|
const { success, pending, aborted, failed, unstable, count } = this;
|
22
22
|
const rate = `${(success / (count - pending - aborted) * 100).toFixed(2)}%`;
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
let result =
|
24
|
+
'| UTC Time | RUNNING | SUCCESS | UNSTABLE | ABORTED | FAILURE | Green Rate |\n';
|
25
|
+
result +=
|
26
|
+
'| ---------------- | ------- | ------- | -------- | ------- | ------- | ---------- |\n';
|
27
27
|
const time = new Date().toISOString().slice(0, 16).replace('T', ' ');
|
28
28
|
result += `| ${time} | ${pad(pending, 7)} | ${pad(success, 8)}|`;
|
29
29
|
result += ` ${pad(unstable, 8)} | ${pad(aborted, 7)} | ${pad(failed, 7)} |`;
|
@@ -204,7 +204,6 @@ const FAILURE_FILTERS = [{
|
|
204
204
|
context: { index: 0, contextBefore: 0, contextAfter: 0 }
|
205
205
|
}, {
|
206
206
|
pattern:
|
207
|
-
// eslint-disable-next-line max-len
|
208
207
|
/error: Your local changes to the following files[\s\S]+Failed to merge in the changes./g,
|
209
208
|
context: { index: 0, contextBefore: 0, contextAfter: 0 }
|
210
209
|
}, {
|
package/lib/cli.js
CHANGED
package/lib/collaborators.js
CHANGED
@@ -105,7 +105,6 @@ function parseCollaborators(readme, cli) {
|
|
105
105
|
|
106
106
|
// We also assume that TSC & TSC Emeriti are also listed as collaborators
|
107
107
|
CONTACT_RE.lastIndex = tscIndex;
|
108
|
-
// eslint-disable-next-line no-cond-assign
|
109
108
|
while ((m = CONTACT_RE.exec(readme)) && CONTACT_RE.lastIndex < tscrIndex) {
|
110
109
|
const login = m[1].toLowerCase();
|
111
110
|
const user = new Collaborator(m[1], m[2], m[3], TSC);
|
@@ -113,7 +112,6 @@ function parseCollaborators(readme, cli) {
|
|
113
112
|
}
|
114
113
|
|
115
114
|
CONTACT_RE.lastIndex = clIndex;
|
116
|
-
// eslint-disable-next-line no-cond-assign
|
117
115
|
while ((m = CONTACT_RE.exec(readme)) &&
|
118
116
|
CONTACT_RE.lastIndex < cleIndex) {
|
119
117
|
const login = m[1].toLowerCase();
|
package/lib/prepare_release.js
CHANGED
@@ -40,7 +40,7 @@ export default class ReleasePreparation extends Session {
|
|
40
40
|
const { cli } = this;
|
41
41
|
|
42
42
|
cli.warn(`PR#${pr.number} - ${pr.title} is not 'MERGEABLE'.
|
43
|
-
|
43
|
+
Status: ${pr.mergeable}`);
|
44
44
|
}
|
45
45
|
|
46
46
|
async getOpenPRs(filterLabels) {
|
@@ -66,7 +66,6 @@ export default class ReleasePreparation extends Session {
|
|
66
66
|
for (const pr of prs) {
|
67
67
|
if (pr.mergeable !== 'MERGEABLE') {
|
68
68
|
this.warnForNonMergeablePR(pr);
|
69
|
-
continue;
|
70
69
|
}
|
71
70
|
const cp = new CherryPick(pr.number, this.dir, cli, {
|
72
71
|
owner: this.owner,
|
@@ -486,7 +485,7 @@ export default class ReleasePreparation extends Session {
|
|
486
485
|
let releaseHeader = `## ${date}, Version ${newVersion}` +
|
487
486
|
` ${releaseInfo}, @${username}\n`;
|
488
487
|
if (isSecurityRelease) {
|
489
|
-
releaseHeader += '\nThis is a security release
|
488
|
+
releaseHeader += '\nThis is a security release.\n';
|
490
489
|
}
|
491
490
|
|
492
491
|
const topHeader =
|
package/lib/prepare_security.js
CHANGED
@@ -52,24 +52,27 @@ export default class PrepareSecurityRelease extends SecurityRelease {
|
|
52
52
|
await this.closeAndRequestDisclosure(vulnerabilityJSON.reports);
|
53
53
|
|
54
54
|
this.cli.info('Closing pull requests');
|
55
|
-
// For now, close the ones with
|
56
|
-
await this.closePRWithLabel(
|
55
|
+
// For now, close the ones with Security Release label
|
56
|
+
await this.closePRWithLabel('Security Release');
|
57
57
|
|
58
|
-
const updateFolder = this.cli.prompt(
|
59
|
-
|
60
|
-
|
58
|
+
const updateFolder = await this.cli.prompt(
|
59
|
+
`Would you like to update the next-security-release folder to ${
|
60
|
+
vulnerabilityJSON.releaseDate}?`,
|
61
61
|
{ defaultAnswer: true });
|
62
62
|
if (updateFolder) {
|
63
|
-
|
63
|
+
this.updateReleaseFolder(
|
64
|
+
vulnerabilityJSON.releaseDate.replaceAll('/', '-')
|
65
|
+
);
|
66
|
+
const securityReleaseFolder = path.join(process.cwd(), 'security-release');
|
64
67
|
commitAndPushVulnerabilitiesJSON(
|
65
|
-
|
68
|
+
securityReleaseFolder,
|
66
69
|
'chore: change next-security-release folder',
|
67
70
|
{ cli: this.cli, repository: this.repository }
|
68
71
|
);
|
69
72
|
}
|
70
73
|
this.cli.info(`Merge pull request with:
|
71
74
|
- git checkout main
|
72
|
-
- git merge
|
75
|
+
- git merge ${NEXT_SECURITY_RELEASE_BRANCH} --no-ff -m "chore: add latest security release"
|
73
76
|
- git push origin main`);
|
74
77
|
this.cli.ok('Done!');
|
75
78
|
}
|
@@ -306,16 +309,17 @@ export default class PrepareSecurityRelease extends SecurityRelease {
|
|
306
309
|
labels = [labels];
|
307
310
|
}
|
308
311
|
|
309
|
-
const url = 'https://github.com/nodejs-private/node-private/
|
312
|
+
const url = 'https://github.com/nodejs-private/node-private/pull';
|
310
313
|
this.cli.startSpinner('Closing GitHub Pull Requests...');
|
311
314
|
// At this point, GitHub does not provide filters through their REST API
|
312
|
-
const prs = this.req.getPullRequest(url);
|
315
|
+
const prs = await this.req.getPullRequest(url);
|
313
316
|
for (const pr of prs) {
|
314
|
-
if (pr.labels.some((l) => labels.includes(l))) {
|
315
|
-
this.cli.updateSpinner(`Closing Pull Request: ${pr.
|
316
|
-
await this.req.closePullRequest(pr.
|
317
|
+
if (pr.labels.some((l) => labels.includes(l.name))) {
|
318
|
+
this.cli.updateSpinner(`Closing Pull Request: ${pr.number}`);
|
319
|
+
await this.req.closePullRequest(pr.number,
|
320
|
+
{ owner: 'nodejs-private', repo: 'node-private' });
|
317
321
|
}
|
318
322
|
}
|
319
|
-
this.cli.
|
323
|
+
this.cli.stopSpinner('Closed GitHub Pull Requests.');
|
320
324
|
}
|
321
325
|
}
|
package/lib/release/utils.js
CHANGED
@@ -21,12 +21,10 @@ export function getStartLTSBlurb({ date, ltsCodename, versionComponents }) {
|
|
21
21
|
const eol = eolDate.toLocaleString('en-US', dateFormat);
|
22
22
|
const { major } = versionComponents;
|
23
23
|
return [
|
24
|
-
/* eslint-disable max-len */
|
25
24
|
`This release marks the transition of Node.js ${major}.x into Long Term Support (LTS)`,
|
26
25
|
`with the codename '${ltsCodename}'. The ${major}.x release line now moves into "Active LTS"`,
|
27
26
|
`and will remain so until ${mainStart}. After that time, it will move into`,
|
28
27
|
`"Maintenance" until end of life in ${eol}.`
|
29
|
-
/* eslint-enable */
|
30
28
|
].join('\n');
|
31
29
|
}
|
32
30
|
|
package/lib/request.js
CHANGED
@@ -109,14 +109,15 @@ export default class Request {
|
|
109
109
|
return this.json(url, options);
|
110
110
|
}
|
111
111
|
|
112
|
-
async closePullRequest({ owner, repo }) {
|
113
|
-
const url = `https://api.github.com/repos/${owner}/${repo}/pulls`;
|
112
|
+
async closePullRequest(id, { owner, repo }) {
|
113
|
+
const url = `https://api.github.com/repos/${owner}/${repo}/pulls/${id}`;
|
114
114
|
const options = {
|
115
115
|
method: 'POST',
|
116
116
|
headers: {
|
117
117
|
Authorization: `Basic ${this.credentials.github}`,
|
118
118
|
'User-Agent': 'node-core-utils',
|
119
|
-
Accept: 'application/vnd.github+json'
|
119
|
+
Accept: 'application/vnd.github+json',
|
120
|
+
'Content-Type': 'application/json'
|
120
121
|
},
|
121
122
|
body: JSON.stringify({
|
122
123
|
state: 'closed'
|
@@ -230,7 +231,8 @@ export default class Request {
|
|
230
231
|
headers: {
|
231
232
|
Authorization: `Basic ${this.credentials.h1}`,
|
232
233
|
'User-Agent': 'node-core-utils',
|
233
|
-
Accept: 'application/json'
|
234
|
+
Accept: 'application/json',
|
235
|
+
'Content-Type': 'application/json'
|
234
236
|
},
|
235
237
|
body: JSON.stringify({
|
236
238
|
data: {
|
@@ -252,11 +254,13 @@ export default class Request {
|
|
252
254
|
headers: {
|
253
255
|
Authorization: `Basic ${this.credentials.h1}`,
|
254
256
|
'User-Agent': 'node-core-utils',
|
255
|
-
Accept: 'application/json'
|
257
|
+
Accept: 'application/json',
|
258
|
+
'Content-Type': 'application/json'
|
256
259
|
},
|
257
260
|
body: JSON.stringify({
|
258
261
|
data: {
|
259
262
|
attributes: {
|
263
|
+
message: 'Requesting disclosure',
|
260
264
|
// default to limited version
|
261
265
|
substate: 'no-content'
|
262
266
|
}
|
@@ -236,7 +236,7 @@ export class SecurityRelease {
|
|
236
236
|
updateReleaseFolder(releaseDate) {
|
237
237
|
const folder = path.join(process.cwd(),
|
238
238
|
NEXT_SECURITY_RELEASE_FOLDER);
|
239
|
-
const newFolder = path.join(process.cwd(), releaseDate);
|
239
|
+
const newFolder = path.join(process.cwd(), 'security-release', releaseDate);
|
240
240
|
fs.renameSync(folder, newFolder);
|
241
241
|
return newFolder;
|
242
242
|
}
|
package/lib/security_blog.js
CHANGED
@@ -101,7 +101,7 @@ export default class SecurityBlog extends SecurityRelease {
|
|
101
101
|
dependencyUpdates: content.dependencies
|
102
102
|
};
|
103
103
|
|
104
|
-
const pathToBlogPosts = path.resolve(nodejsOrgFolder, 'apps/site/pages/en/blog/
|
104
|
+
const pathToBlogPosts = path.resolve(nodejsOrgFolder, 'apps/site/pages/en/blog/vulnerability');
|
105
105
|
const pathToBannerJson = path.resolve(nodejsOrgFolder, 'apps/site/site.json');
|
106
106
|
|
107
107
|
const preReleasePath = path.resolve(pathToBlogPosts, data.slug + '.md');
|
@@ -250,12 +250,8 @@ export default class SecurityBlog extends SecurityRelease {
|
|
250
250
|
if (Object.keys(dependencyUpdates).length === 0) return '';
|
251
251
|
let template = '\nThis security release includes the following dependency' +
|
252
252
|
' updates to address public vulnerabilities:\n';
|
253
|
-
for (const
|
254
|
-
|
255
|
-
const title = dependency.title.substring(dependency.title.indexOf(':') + ':'.length).trim();
|
256
|
-
template += `- ${title}\
|
257
|
-
on ${dependency.affectedVersions.join(', ')}\n`;
|
258
|
-
}
|
253
|
+
for (const [dependency, { versions, affectedVersions }] of Object.entries(dependencyUpdates)) {
|
254
|
+
template += `- ${dependency} (${versions.join(', ')}) on ${affectedVersions.join(', ')}\n`;
|
259
255
|
}
|
260
256
|
return template;
|
261
257
|
}
|
package/lib/team_info.js
CHANGED
@@ -41,6 +41,9 @@ const fp16Ignore = `!/third_party/fp16
|
|
41
41
|
const fastFloatReplace = `/third_party/fast_float/src/*
|
42
42
|
!/third_party/fast_float/src/include`;
|
43
43
|
|
44
|
+
const highwayIgnore = `/third_party/highway/src/*
|
45
|
+
!/third_party/highway/src/hwy`;
|
46
|
+
|
44
47
|
export const v8Deps = [
|
45
48
|
{
|
46
49
|
name: 'trace_event',
|
@@ -115,5 +118,20 @@ export const v8Deps = [
|
|
115
118
|
replace: fastFloatReplace
|
116
119
|
},
|
117
120
|
since: 130
|
121
|
+
},
|
122
|
+
{
|
123
|
+
name: 'highway',
|
124
|
+
repo: 'third_party/highway/src',
|
125
|
+
gitignore: {
|
126
|
+
match: '/third_party/highway/src',
|
127
|
+
replace: highwayIgnore
|
128
|
+
},
|
129
|
+
since: 134
|
130
|
+
},
|
131
|
+
{
|
132
|
+
name: 'simdutf',
|
133
|
+
repo: 'third_party/simdutf',
|
134
|
+
gitignore: '!/third_party/simdutf',
|
135
|
+
since: 134
|
118
136
|
}
|
119
137
|
];
|
@@ -119,7 +119,6 @@ function updateV8Deps() {
|
|
119
119
|
path: v8Dep.repo
|
120
120
|
})), newV8Version);
|
121
121
|
if (deps.length === 0) return;
|
122
|
-
/* eslint-disable no-await-in-loop */
|
123
122
|
for (const dep of deps) {
|
124
123
|
if (dep.gitignore) {
|
125
124
|
if (typeof dep.gitignore === 'string') {
|
@@ -132,7 +131,6 @@ function updateV8Deps() {
|
|
132
131
|
const thePath = path.join(ctx.nodeDir, 'deps/v8', dep.path);
|
133
132
|
await fetchFromGit(thePath, repo, commit);
|
134
133
|
}
|
135
|
-
/* eslint-enable */
|
136
134
|
}
|
137
135
|
};
|
138
136
|
}
|
package/lib/voting_session.js
CHANGED
@@ -10,6 +10,7 @@ import {
|
|
10
10
|
getEditor, isGhAvailable
|
11
11
|
} from './utils.js';
|
12
12
|
|
13
|
+
// eslint-disable-next-line import/no-unresolved
|
13
14
|
import voteUsingGit from '@node-core/caritat/voteUsingGit';
|
14
15
|
import * as yaml from 'js-yaml';
|
15
16
|
|
@@ -97,7 +98,7 @@ export default class VotingSession extends Session {
|
|
97
98
|
cp.stdin.end(share);
|
98
99
|
const [code] = await Promise.race([
|
99
100
|
once(cp, 'exit'),
|
100
|
-
once(cp, 'error').then((er) =>
|
101
|
+
once(cp, 'error').then((er) => { throw er; })
|
101
102
|
]);
|
102
103
|
if (code !== 0) throw new Error('failed', { cause: code });
|
103
104
|
return Buffer.concat(await stdout);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@node-core/utils",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.11.0",
|
4
4
|
"description": "Utilities for Node.js core collaborators",
|
5
5
|
"type": "module",
|
6
6
|
"engines": {
|
@@ -34,37 +34,40 @@
|
|
34
34
|
],
|
35
35
|
"license": "MIT",
|
36
36
|
"dependencies": {
|
37
|
-
"@inquirer/prompts": "^
|
38
|
-
"@listr2/prompt-adapter-enquirer": "^2.0.
|
37
|
+
"@inquirer/prompts": "^7.2.3",
|
38
|
+
"@listr2/prompt-adapter-enquirer": "^2.0.12",
|
39
39
|
"@node-core/caritat": "^1.6.0",
|
40
40
|
"@pkgjs/nv": "^0.2.2",
|
41
41
|
"branch-diff": "^3.1.1",
|
42
|
-
"chalk": "^5.
|
43
|
-
"changelog-maker": "^4.3.
|
42
|
+
"chalk": "^5.4.1",
|
43
|
+
"changelog-maker": "^4.3.2",
|
44
44
|
"cheerio": "^1.0.0",
|
45
45
|
"clipboardy": "^4.0.0",
|
46
46
|
"core-validate-commit": "^4.1.0",
|
47
47
|
"figures": "^6.1.0",
|
48
|
-
"ghauth": "^6.0.
|
48
|
+
"ghauth": "^6.0.10",
|
49
49
|
"git-secure-tag": "^2.3.1",
|
50
50
|
"js-yaml": "^4.1.0",
|
51
|
-
"listr2": "^8.2.
|
51
|
+
"listr2": "^8.2.5",
|
52
52
|
"lodash": "^4.17.21",
|
53
53
|
"log-symbols": "^7.0.0",
|
54
|
-
"ora": "^8.1.
|
55
|
-
"replace-in-file": "^8.
|
56
|
-
"
|
57
|
-
"
|
54
|
+
"ora": "^8.1.1",
|
55
|
+
"replace-in-file": "^8.3.0",
|
56
|
+
"semver": "^7.6.3",
|
57
|
+
"undici": "^7.3.0",
|
58
|
+
"which": "^5.0.0",
|
58
59
|
"yargs": "^17.7.2"
|
59
60
|
},
|
60
61
|
"devDependencies": {
|
61
|
-
"@
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"eslint
|
65
|
-
"eslint-plugin-import": "^2.
|
66
|
-
"eslint-plugin-n": "^
|
67
|
-
"eslint-plugin-promise": "^
|
62
|
+
"@eslint/js": "^9.19.0",
|
63
|
+
"@reporters/github": "^1.7.2",
|
64
|
+
"c8": "^10.1.3",
|
65
|
+
"eslint": "^9.19.0",
|
66
|
+
"eslint-plugin-import": "^2.31.0",
|
67
|
+
"eslint-plugin-n": "^17.15.1",
|
68
|
+
"eslint-plugin-promise": "^7.2.1",
|
69
|
+
"globals": "^15.14.0",
|
70
|
+
"neostandard": "^0.12.0",
|
68
71
|
"sinon": "^19.0.2"
|
69
72
|
}
|
70
73
|
}
|