From e66583552bfe3743ad21c392aaceb1ccfb652bb8 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Sat, 2 Nov 2024 00:46:48 -0300 Subject: [PATCH 1/3] feat: add --releaseDate to git node release This will enable us to automate release proposal creation: https://github.com/nodejs/security-wg/issues/860 --- components/git/release.js | 4 ++++ docs/git-node.md | 10 ++++++---- lib/prepare_release.js | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/git/release.js b/components/git/release.js index ae82e0ae..6c340bf2 100644 --- a/components/git/release.js +++ b/components/git/release.js @@ -32,6 +32,10 @@ const releaseOptions = { startLTS: { describe: 'Mark the release as the transition from Current to LTS', type: 'boolean' + }, + releaseDate: { + describe: 'Default relase date when --prepare is used. It must be YYYY-MM-DD', + type: 'string' } }; diff --git a/docs/git-node.md b/docs/git-node.md index b539a69f..c882fd7c 100644 --- a/docs/git-node.md +++ b/docs/git-node.md @@ -224,6 +224,8 @@ Options: --security Demarcate the new security release as a security release [boolean] --startLTS Mark the release as the transition from Current to LTS [boolean] --filterLabel Filter PR by label when preparing a security release [string] + --releaseDate Default relase date when --prepare is used. + It must be YYYY-MM-DD [string] ``` ### Example @@ -336,7 +338,7 @@ ncu-config set waitTimeMultiApproval 48 ## `git node v8` -Update or patch the V8 engine. +Update or patch the V8 engine. This tool will maintain a clone of the V8 repository in `~/.update-v8/v8` if it's used without `--v8-dir`. @@ -373,7 +375,7 @@ Options: ### `git node v8 minor` Compare current V8 version with latest upstream of the same major. Applies a -patch if necessary. +patch if necessary. If the `git apply` command fails, a patch file will be written in the Node.js clone directory. @@ -462,7 +464,7 @@ It will retrieve all the triaged HackerOne reports and add creates the `vulnerab This command updates the `vulnerabilities.json` with target date of the security release. Example: - + ```sh git node security --update-date=2023/12/31 ``` @@ -471,7 +473,7 @@ Example: This command creates a pre-release announcement for the security release. Example: - + ```sh git node security --pre-release ``` diff --git a/lib/prepare_release.js b/lib/prepare_release.js index 6b0aa131..5169e331 100644 --- a/lib/prepare_release.js +++ b/lib/prepare_release.js @@ -25,6 +25,7 @@ export default class ReleasePreparation extends Session { this.isLTS = false; this.isLTSTransition = argv.startLTS; this.runBranchDiff = !argv.skipBranchDiff; + this.defaultReleaseDate = argv.releaseDate ?? new Date().toISOString().split('T')[0]; this.ltsCodename = ''; this.date = ''; this.filterLabels = argv.filterLabel && argv.filterLabel.split(','); @@ -241,9 +242,8 @@ export default class ReleasePreparation extends Session { cli.stopSpinner('Updated REPLACEME items in docs'); // Fetch date to use in release commit & changelogs. - const todayDate = new Date().toISOString().split('T')[0]; this.date = await cli.prompt('Enter release date in YYYY-MM-DD format:', - { questionType: 'input', defaultAnswer: todayDate }); + { questionType: 'input', defaultAnswer: this.defaultReleaseDate }); cli.startSpinner('Updating CHANGELOG.md'); await this.updateMainChangelog(); From 470bcf13bdfafe62d56f6051494475b9f91fb1df Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 2 Nov 2024 16:46:40 -0300 Subject: [PATCH 2/3] Update lib/prepare_release.js Co-authored-by: Antoine du Hamel --- lib/prepare_release.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prepare_release.js b/lib/prepare_release.js index 5169e331..41e7605b 100644 --- a/lib/prepare_release.js +++ b/lib/prepare_release.js @@ -25,7 +25,7 @@ export default class ReleasePreparation extends Session { this.isLTS = false; this.isLTSTransition = argv.startLTS; this.runBranchDiff = !argv.skipBranchDiff; - this.defaultReleaseDate = argv.releaseDate ?? new Date().toISOString().split('T')[0]; + this.defaultReleaseDate = argv.releaseDate ?? new Date().toISOString().slice(0, 10); this.ltsCodename = ''; this.date = ''; this.filterLabels = argv.filterLabel && argv.filterLabel.split(','); From ca4b89ee6065751ec60e127d27fe84af0310c5d7 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 2 Nov 2024 18:40:23 -0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Antoine du Hamel --- docs/git-node.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/git-node.md b/docs/git-node.md index c882fd7c..3d86a1c7 100644 --- a/docs/git-node.md +++ b/docs/git-node.md @@ -338,7 +338,7 @@ ncu-config set waitTimeMultiApproval 48 ## `git node v8` -Update or patch the V8 engine. +Update or patch the V8 engine. This tool will maintain a clone of the V8 repository in `~/.update-v8/v8` if it's used without `--v8-dir`. @@ -375,7 +375,7 @@ Options: ### `git node v8 minor` Compare current V8 version with latest upstream of the same major. Applies a -patch if necessary. +patch if necessary. If the `git apply` command fails, a patch file will be written in the Node.js clone directory.