Skip to content

Commit e78b1c7

Browse files
authored
Merge branch 'main' into git-node-release-promote
2 parents 55e4a79 + f43c721 commit e78b1c7

27 files changed

+192
-74
lines changed

.github/workflows/release-please.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
release-please:
1013
runs-on: ubuntu-latest
1114
outputs:
1215
release_created: ${{ steps.release.outputs.release_created }}
1316
steps:
14-
- uses: google-github-actions/release-please-action@v4
17+
- uses: googleapis/release-please-action@v4
1518
id: release
1619
with:
1720
release-type: node
21+
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}
1822
npm-publish:
1923
needs: release-please
2024
if: ${{ needs.release-please.outputs.release_created }}

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## [5.5.1](https://github.com/nodejs/node-core-utils/compare/v5.5.0...v5.5.1) (2024-09-26)
4+
5+
6+
### Bug Fixes
7+
8+
* **git-node:** ignore all non-gha nodes when checking for GitHub CI ([#857](https://github.com/nodejs/node-core-utils/issues/857)) ([342ff5b](https://github.com/nodejs/node-core-utils/commit/342ff5baddbccd12d605547e718cec7508a50280))
9+
* **ncu-ci:** fix cache and stats option, and use tmpdir for cache ([#849](https://github.com/nodejs/node-core-utils/issues/849)) ([aa25318](https://github.com/nodejs/node-core-utils/commit/aa25318cd46e3698f59da59bf8e1ed6809da5ada))
10+
* **v8:** handle error in git apply ([#851](https://github.com/nodejs/node-core-utils/issues/851)) ([11d0a04](https://github.com/nodejs/node-core-utils/commit/11d0a04aa08a221b400515801a99702c339fd832))
11+
12+
## [5.5.0](https://github.com/nodejs/node-core-utils/compare/v5.4.0...v5.5.0) (2024-09-01)
13+
14+
15+
### Features
16+
17+
* add git node security --cleanup ([#833](https://github.com/nodejs/node-core-utils/issues/833)) ([871a16f](https://github.com/nodejs/node-core-utils/commit/871a16f7968d112468f751ab019ca575151745d2))
18+
* add warning when fail on all platforms ([#843](https://github.com/nodejs/node-core-utils/issues/843)) ([4f7ec3e](https://github.com/nodejs/node-core-utils/commit/4f7ec3e7923592dbfef32206bf1c2b21a36e15dd))
19+
* **git-node:** auto-fetch comparison branch when preparing release ([#846](https://github.com/nodejs/node-core-utils/issues/846)) ([a8529ed](https://github.com/nodejs/node-core-utils/commit/a8529edaab765e293965054b7027774a3f4938f2))
20+
* **git-node:** auto-fetch latest release tag when preparing release ([#842](https://github.com/nodejs/node-core-utils/issues/842)) ([15ae401](https://github.com/nodejs/node-core-utils/commit/15ae4013b2cbf56ec7f3356d8a8bb682ceef29c3))
21+
* update next-security-release folder on cleanup ([#840](https://github.com/nodejs/node-core-utils/issues/840)) ([f420432](https://github.com/nodejs/node-core-utils/commit/f420432c6cbdba51da734276d20f73c75728b409))
22+
* **v8:** add fast_float to V8 deps ([#844](https://github.com/nodejs/node-core-utils/issues/844)) ([4e8ec9c](https://github.com/nodejs/node-core-utils/commit/4e8ec9c072283c8cb31155c66815027ed82fa210))
23+
24+
25+
### Bug Fixes
26+
27+
* landing session on different repo/org ([#847](https://github.com/nodejs/node-core-utils/issues/847)) ([7734954](https://github.com/nodejs/node-core-utils/commit/77349540beee5c8d8808f5783e72e106b02f113b))
28+
329
## [5.4.0](https://github.com/nodejs/node-core-utils/compare/v5.3.1...v5.4.0) (2024-08-07)
430

531

bin/ncu-ci.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ const args = yargs(hideBin(process.argv))
7777
})
7878
.option('stats', {
7979
default: false,
80+
type: 'boolean',
8081
describe: 'Aggregate the results'
8182
})
8283
.option('cache', {
8384
default: false,
84-
describe: 'Cache the responses from Jenkins in .ncu/cache/ under' +
85-
' the node-core-utils installation directory'
85+
type: 'boolean',
86+
describe: 'Cache the responses from Jenkins in $tmpdir/ncu/cache for testing'
8687
})
8788
.option('limit', {
8889
default: 99,
@@ -199,13 +200,14 @@ const args = yargs(hideBin(process.argv))
199200
builder: (yargs) => {
200201
yargs
201202
.option('stats', {
203+
type: 'boolean',
202204
default: false,
203205
describe: 'Aggregate the results'
204206
})
205207
.option('cache', {
208+
type: 'boolean',
206209
default: false,
207-
describe: 'Cache the responses from Jenkins in .ncu/cache/ under' +
208-
' the node-core-utils installation directory'
210+
describe: 'Cache the responses from Jenkins in $tmpdir/ncu/cache for testing'
209211
})
210212
.option('limit', {
211213
default: 15,

components/git/release.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ const releaseOptions = {
2828
describe: 'Promote new release of Node.js',
2929
type: 'boolean'
3030
},
31-
'gpg-sign': {
32-
describe: 'GPG-sign commits, will be passed to the git process',
33-
alias: 'S'
31+
releaseDate: {
32+
describe: 'Default relase date when --prepare is used. It must be YYYY-MM-DD',
33+
type: 'string'
3434
},
3535
security: {
3636
describe: 'Demarcate the new security release as a security release',
@@ -44,13 +44,22 @@ const releaseOptions = {
4444
describe: 'Labels separated by "," to filter security PRs',
4545
type: 'string'
4646
},
47+
'gpg-sign': {
48+
describe: 'GPG-sign commits, will be passed to the git process',
49+
alias: 'S'
50+
},
4751
skipBranchDiff: {
4852
describe: 'Skips the initial branch-diff check when preparing releases',
4953
type: 'boolean'
5054
},
5155
startLTS: {
5256
describe: 'Mark the release as the transition from Current to LTS',
5357
type: 'boolean'
58+
},
59+
yes: {
60+
type: 'boolean',
61+
default: false,
62+
describe: 'Skip all prompts and run non-interactively'
5463
}
5564
};
5665

@@ -90,6 +99,10 @@ function release(state, argv) {
9099
const cli = new CLI(logStream);
91100
const dir = process.cwd();
92101

102+
if (argv.yes) {
103+
cli.setAssumeYes();
104+
}
105+
93106
return runPromise(main(state, argv, cli, dir)).catch((err) => {
94107
if (cli.spinner.enabled) {
95108
cli.spinner.fail();

components/git/v8.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function builder(yargs) {
2222
default: 'lkgr'
2323
});
2424
yargs.option('version-bump', {
25+
type: 'boolean',
2526
describe: 'Bump the NODE_MODULE_VERSION constant',
2627
default: true
2728
});
@@ -39,10 +40,12 @@ export function builder(yargs) {
3940
builder: (yargs) => {
4041
yargs
4142
.option('bump', {
43+
type: 'boolean',
4244
describe: 'Bump V8 embedder version number or patch version',
4345
default: true
4446
})
4547
.option('squash', {
48+
type: 'boolean',
4649
describe:
4750
'If multiple commits are backported, squash them into one',
4851
default: false
@@ -62,8 +65,8 @@ export function builder(yargs) {
6265
describe: 'Directory of an existing V8 clone'
6366
})
6467
.option('verbose', {
68+
type: 'boolean',
6569
describe: 'Enable verbose output',
66-
boolean: true,
6770
default: false
6871
});
6972
}

docs/git-node.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ Options:
223223
--prepare Prepare a new release of Node.js [boolean]
224224
--security Demarcate the new security release as a security release [boolean]
225225
--startLTS Mark the release as the transition from Current to LTS [boolean]
226+
--yes Skip all prompts and run non-interactively [boolean]
226227
--filterLabel Filter PR by label when preparing a security release [string]
228+
--releaseDate Default relase date when --prepare is used.
229+
It must be YYYY-MM-DD [string]
227230
```
228231

229232
### Example
@@ -462,7 +465,7 @@ It will retrieve all the triaged HackerOne reports and add creates the `vulnerab
462465

463466
This command updates the `vulnerabilities.json` with target date of the security release.
464467
Example:
465-
468+
466469
```sh
467470
git node security --update-date=2023/12/31
468471
```
@@ -471,7 +474,7 @@ Example:
471474

472475
This command creates a pre-release announcement for the security release.
473476
Example:
474-
477+
475478
```sh
476479
git node security --pre-release
477480
```

docs/ncu-ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Possible use cases:
111111
is run, it picks up cached data written on disk for jobs whose results
112112
are known.
113113

114-
Note: results are cached in `${ncu_installation_path}/.ncu/cache`, so you
114+
Note: results are cached in `$tmpdir/ncu/cache`, so you
115115
may want to clean it up from time to time.
116116

117117
```

lib/cache.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
import path from 'node:path';
22
import fs from 'node:fs';
3-
import { fileURLToPath } from 'node:url';
3+
import os from 'node:os';
44

55
import { writeJson, readJson, writeFile, readFile } from './file.js';
66

77
function isAsync(fn) {
88
return fn[Symbol.toStringTag] === 'AsyncFunction';
99
}
1010

11-
const parentDir = fileURLToPath(new URL('..', import.meta.url));
12-
1311
export default class Cache {
1412
constructor(dir) {
15-
this.dir = dir || this.computeCacheDir(parentDir);
13+
this.dir = dir || this.computeCacheDir(os.tmpdir());
1614
this.originals = {};
1715
this.disabled = true;
1816
}
1917

2018
computeCacheDir(base) {
21-
return path.join(base, '.ncu', 'cache');
19+
return path.join(base, 'ncu', 'cache');
2220
}
2321

2422
disable() {

lib/cli.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ora from 'ora';
22
import chalk from 'chalk';
3-
import inquirer from 'inquirer';
3+
import * as inquirer from '@inquirer/prompts';
44

55
import { warning, error, info, success } from './figures.js';
66

@@ -81,12 +81,10 @@ export default class CLI {
8181
return defaultAnswer;
8282
}
8383

84-
const { answer } = await inquirer.prompt([{
85-
type: questionType,
86-
name: 'answer',
84+
const answer = await inquirer[questionType]({
8785
message: question,
8886
default: defaultAnswer
89-
}]);
87+
});
9088

9189
if (isSpinning) {
9290
this.spinner.start(spinningMessage);

lib/github/tree.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@ export default class GitHubTree {
3535
branch,
3636
path
3737
});
38-
return data.repository.ref.target.history.nodes[0].oid;
38+
39+
const targetHistoryNodes = data.repository.ref.target.history.nodes;
40+
if (!targetHistoryNodes.length) {
41+
this.cli.stopSpinner(
42+
`Cannot find commit for "${path}". Please check the path name.`,
43+
this.cli.SPINNER_STATUS.FAILED
44+
);
45+
throw new Error(`Cannot find commit for "${path}"`);
46+
}
47+
return targetHistoryNodes[0].oid;
3948
}
4049

4150
/**

0 commit comments

Comments
 (0)