From a243225aa2c016bc02471c5dd3bae3cf906f6d14 Mon Sep 17 00:00:00 2001 From: Rafael Gonzaga Date: Fri, 8 Nov 2024 14:49:43 -0300 Subject: [PATCH] src: add cli option to preserve env vars on dr PR-URL: https://github.com/nodejs/node/pull/55697 Reviewed-By: James M Snell Reviewed-By: Richard Lau --- doc/api/cli.md | 10 +++ doc/api/process.md | 10 +++ doc/api/report.md | 7 ++ lib/internal/process/report.js | 7 ++ src/env-inl.h | 4 + src/env.h | 2 + src/node_options.cc | 5 ++ src/node_options.h | 1 + src/node_report.cc | 55 ++++++++++--- src/node_report_module.cc | 15 ++++ test/common/report.js | 17 ++-- .../test-report-writereport-exclude-env.js | 80 +++++++++++++++++++ 12 files changed, 199 insertions(+), 14 deletions(-) create mode 100644 test/report/test-report-writereport-exclude-env.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 9d6797756c64ec..91ab8eb351cb43 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2056,6 +2056,15 @@ Enables report to be generated upon receiving the specified (or predefined) signal to the running Node.js process. The signal to trigger the report is specified through `--report-signal`. +### `--report-exclude-env` + + + +When `--report-exclude-env` is passed the diagnostic report generated will not +contain the `environmentVariables` data. + ### `--report-signal=signal` + +* {boolean} + +If `true`, a diagnostic report is generated without the environment variables. + ### `process.report.signal`