From ccb69bb8d5ebe5b40ca2c433b1725aa696d210f2 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 3cd18736534a7b..73f66b9fc59fd3 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2057,6 +2057,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`