From d7c30d682f90a2bcb61563e2f7067b432ad293f0 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Fri, 1 Nov 2024 15:50:14 -0300 Subject: [PATCH 1/4] feat: add --yes option 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 | 10 ++++++++++ docs/git-node.md | 10 ++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/components/git/release.js b/components/git/release.js index ae82e0ae..f28c2d00 100644 --- a/components/git/release.js +++ b/components/git/release.js @@ -32,6 +32,12 @@ const releaseOptions = { startLTS: { describe: 'Mark the release as the transition from Current to LTS', type: 'boolean' + }, + yes: { + type: 'boolean', + default: false, + describe: 'Assume "yes" as answer to all prompts and run ' + + 'non-interactively.' } }; @@ -66,6 +72,10 @@ function release(state, argv) { const cli = new CLI(logStream); const dir = process.cwd(); + if (argv.yes) { + cli.setAssumeYes(); + } + return runPromise(main(state, argv, cli, dir)).catch((err) => { if (cli.spinner.enabled) { cli.spinner.fail(); diff --git a/docs/git-node.md b/docs/git-node.md index b539a69f..4fe89e4d 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] + --yes Assume "yes" as answer to all prompts and run + non-interactively. [boolean] [default: false] ``` ### 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 ``` From 811dc66f80c9f1faae173ad5cc584f755a18f0bb Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 2 Nov 2024 16:46:48 -0300 Subject: [PATCH 2/4] Update docs/git-node.md Co-authored-by: Antoine du Hamel --- docs/git-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/git-node.md b/docs/git-node.md index 4fe89e4d..1614cb9b 100644 --- a/docs/git-node.md +++ b/docs/git-node.md @@ -224,7 +224,7 @@ 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] - --yes Assume "yes" as answer to all prompts and run + --yes Skip all prompts and run non-interactively. [boolean] [default: false] ``` From 87af049170373f777f4f56cb8fa50e1f94b22677 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 2 Nov 2024 18:39:30 -0300 Subject: [PATCH 3/4] 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 1614cb9b..c699251d 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. From 6145da241557bc4c4636636637ae1bde4fa8b882 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Sat, 2 Nov 2024 18:52:23 -0300 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Antoine du Hamel --- components/git/release.js | 3 +-- docs/git-node.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/git/release.js b/components/git/release.js index 004eae28..d87e92b4 100644 --- a/components/git/release.js +++ b/components/git/release.js @@ -40,8 +40,7 @@ const releaseOptions = { yes: { type: 'boolean', default: false, - describe: 'Assume "yes" as answer to all prompts and run ' + - 'non-interactively.', + describe: 'Skip all prompts and run non-interactively' } }; diff --git a/docs/git-node.md b/docs/git-node.md index ed468572..81149268 100644 --- a/docs/git-node.md +++ b/docs/git-node.md @@ -223,8 +223,7 @@ Options: --prepare Prepare a new release of Node.js [boolean] --security Demarcate the new security release as a security release [boolean] --startLTS Mark the release as the transition from Current to LTS [boolean] - --yes Skip all prompts and run - non-interactively. [boolean] [default: false] + --yes Skip all prompts and run non-interactively [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]