Skip to content

Commit f2f5bf8

Browse files
authored
Merge branch 'main' into add-assume-yes-git-node-release
2 parents 87af049 + 48cbfd6 commit f2f5bf8

17 files changed

+46
-19
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
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+
312
## [5.5.0](https://github.com/nodejs/node-core-utils/compare/v5.4.0...v5.5.0) (2024-09-01)
413

514

components/git/release.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const releaseOptions = {
1717
describe: 'Promote new release of Node.js',
1818
type: 'boolean'
1919
},
20+
releaseDate: {
21+
describe: 'Default relase date when --prepare is used. It must be YYYY-MM-DD',
22+
type: 'string'
23+
},
2024
security: {
2125
describe: 'Demarcate the new security release as a security release',
2226
type: 'boolean'
@@ -37,7 +41,7 @@ const releaseOptions = {
3741
type: 'boolean',
3842
default: false,
3943
describe: 'Assume "yes" as answer to all prompts and run ' +
40-
'non-interactively.'
44+
'non-interactively.',
4145
}
4246
};
4347

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,11 @@ 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-
--filterLabel Filter PR by label when preparing a security release [string]
227226
--yes Skip all prompts and run
228227
non-interactively. [boolean] [default: false]
228+
--filterLabel Filter PR by label when preparing a security release [string]
229+
--releaseDate Default relase date when --prepare is used.
230+
It must be YYYY-MM-DD [string]
229231
```
230232

231233
### Example

lib/pr_checker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const GITHUB_SUCCESS_CONCLUSIONS = ['SUCCESS', 'NEUTRAL', 'SKIPPED'];
2929
const FAST_TRACK_RE = /^Fast-track has been requested by @(.+?)\. Please 👍 to approve\.$/;
3030
const FAST_TRACK_MIN_APPROVALS = 2;
3131
const GIT_CONFIG_GUIDE_URL = 'https://github.com/nodejs/node/blob/99b1ada/doc/guides/contributing/pull-requests.md#step-1-fork';
32-
const IGNORED_CHECK_SLUGS = ['dependabot', 'codecov'];
3332

3433
// eslint-disable-next-line no-extend-native
3534
Array.prototype.findLastIndex ??= function findLastIndex(fn) {
@@ -374,9 +373,10 @@ export default class PRChecker {
374373

375374
// GitHub new Check API
376375
for (const { status, conclusion, app } of checkSuites.nodes) {
377-
if (app && IGNORED_CHECK_SLUGS.includes(app.slug)) {
378-
// Ignore Dependabot and Codecov check suites.
379-
// They are expected to show up sometimes and never complete.
376+
if (app.slug !== 'github-actions') {
377+
// Ignore all non-github check suites, such as Dependabot and Codecov.
378+
// They are expected to show up on PRs whose head branch is not on a
379+
// fork and never complete.
380380
continue;
381381
}
382382

lib/prepare_release.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class ReleasePreparation extends Session {
2525
this.isLTS = false;
2626
this.isLTSTransition = argv.startLTS;
2727
this.runBranchDiff = !argv.skipBranchDiff;
28+
this.defaultReleaseDate = argv.releaseDate ?? new Date().toISOString().slice(0, 10);
2829
this.ltsCodename = '';
2930
this.date = '';
3031
this.filterLabels = argv.filterLabel && argv.filterLabel.split(',');
@@ -241,9 +242,8 @@ export default class ReleasePreparation extends Session {
241242
cli.stopSpinner('Updated REPLACEME items in docs');
242243

243244
// Fetch date to use in release commit & changelogs.
244-
const todayDate = new Date().toISOString().split('T')[0];
245245
this.date = await cli.prompt('Enter release date in YYYY-MM-DD format:',
246-
{ questionType: 'input', defaultAnswer: todayDate });
246+
{ questionType: 'input', defaultAnswer: this.defaultReleaseDate });
247247

248248
cli.startSpinner('Updating CHANGELOG.md');
249249
await this.updateMainChangelog();
@@ -253,9 +253,6 @@ export default class ReleasePreparation extends Session {
253253
await this.updateMajorChangelog();
254254
cli.stopSpinner(`Updated CHANGELOG_V${versionComponents.major}.md`);
255255

256-
await cli.prompt('Finished editing the changelogs?',
257-
{ defaultAnswer: false });
258-
259256
// Create release commit.
260257
const shouldCreateReleaseCommit = await cli.prompt(
261258
'Create release commit?');
@@ -272,9 +269,7 @@ export default class ReleasePreparation extends Session {
272269
cli.warn(`Please manually edit commit ${lastCommitSha} by running ` +
273270
'`git commit --amend` before proceeding.');
274271

275-
await cli.prompt(
276-
'Finished editing the release commit?',
277-
{ defaultAnswer: false });
272+
await cli.prompt('Finished editing the release commit?');
278273
}
279274

280275
cli.separator();
@@ -625,8 +620,7 @@ export default class ReleasePreparation extends Session {
625620
]);
626621

627622
cli.log(`${messageTitle}\n\n${messageBody.join('')}`);
628-
const useMessage = await cli.prompt(
629-
'Continue with this commit message?', { defaultAnswer: false });
623+
const useMessage = await cli.prompt('Continue with this commit message?');
630624
return useMessage;
631625
}
632626

lib/request.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ export default class Request {
158158
Accept: 'application/json'
159159
}
160160
};
161-
return this.json(url, options);
161+
const data = await this.json(url, options);
162+
if (data?.errors) {
163+
throw new Error(
164+
`Request to fetch triaged reports failed with: ${JSON.stringify(data.errors)}`
165+
);
166+
}
167+
return data;
162168
}
163169

164170
async getPrograms() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@node-core/utils",
3-
"version": "5.5.0",
3+
"version": "5.5.1",
44
"description": "Utilities for Node.js core collaborators",
55
"type": "module",
66
"engines": {

test/fixtures/github-ci/both-apis-failure.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"checkSuites": {
1414
"nodes": [
1515
{
16+
"app": { "slug": "github-actions" },
1617
"status": "COMPLETED",
1718
"conclusion": "FAILURE"
1819
}

test/fixtures/github-ci/both-apis-success.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"checkSuites": {
1414
"nodes": [
1515
{
16+
"app": { "slug": "github-actions" },
1617
"status": "COMPLETED",
1718
"conclusion": "SUCCESS"
1819
}

0 commit comments

Comments
 (0)