Skip to content

src: support namespace options in configuration #58073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pmarchini
Copy link
Member

@pmarchini pmarchini commented Apr 29, 2025

This PR introduces namespace-scoped configuration options, starting with the testRunner namespace.

Adding a namespace corresponds to introducing a new parameter at the AddOption level:

 AddOption("--test-shard",
           "run test at specific shard",
           &EnvironmentOptions::test_shard,
           kAllowedInEnvvar,
+          OptionNamespaces::kTestRunnerNamespace);

Namespaces are centrally declared using:

#define OPTION_NAMESPACE_LIST(V) \
  V(kNoNamespace, "") \
  V(kTestRunnerNamespace, "testRunner")

All defined namespaces are automatically exposed via JSON Schema at doc/node-config-schema.json.

This addresses #57559 while setting the foundation for future namespace adoption and structured configuration!

Here is an extract of the new namespace:

.......
  "testRunner": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "experimental-test-coverage": {
        "type": "boolean"
      },
      "experimental-test-module-mocks": {
        "type": "boolean"
      },
      "test-concurrency": {
        "type": "number"
      },
      "test-coverage-branches": {
        "type": "number"
      },
      "test-coverage-exclude": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "items": {
              "type": "string",
              "minItems": 1
            },
            "type": "array"
          }
        ]
      },
.......

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 29, 2025

Review requested:

  • @nodejs/config
  • @nodejs/cpp-reviewers
  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 29, 2025
@marco-ippolito marco-ippolito added the config Issues or PRs related to the config subsystem label Apr 29, 2025
@pmarchini pmarchini force-pushed the feat/config-file-namespaces branch 2 times, most recently from e882bbf to 7b398ee Compare May 15, 2025 10:47
@pmarchini pmarchini force-pushed the feat/config-file-namespaces branch 5 times, most recently from 0aeba3a to 738f977 Compare May 26, 2025 12:15
@pmarchini pmarchini force-pushed the feat/config-file-namespaces branch 2 times, most recently from 81bdb6e to fee75a3 Compare May 26, 2025 15:49
@pmarchini pmarchini force-pushed the feat/config-file-namespaces branch from fee75a3 to edf3ab8 Compare May 26, 2025 16:13
@pmarchini pmarchini marked this pull request as ready for review May 26, 2025 16:16
@marco-ippolito marco-ippolito added the semver-minor PRs that contain new features and should be released in the next minor version. label Jun 5, 2025
@pmarchini pmarchini added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 5, 2025
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jun 5, 2025
Copy link
Contributor

github-actions bot commented Jun 5, 2025

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - src: support namespace options in configuration file
   ⚠  - fixup! src: support namespace options in configuration file
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/15474767772

@nodejs-github-bot
Copy link
Collaborator

@marco-ippolito marco-ippolito added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jun 6, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 6, 2025
@nodejs-github-bot nodejs-github-bot merged commit c1f090d into nodejs:main Jun 6, 2025
68 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in c1f090d

targos pushed a commit that referenced this pull request Jun 7, 2025
PR-URL: #58073
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Giovanni Bucci <[email protected]>
Reviewed-By: Daniel Lemire <[email protected]>
nodejs-github-bot added a commit that referenced this pull request Jun 8, 2025
Notable changes:

doc:
  * deprecate utilisNativeError in favor of ErrorisError (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate Symbol.dispose/asyncDispose from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add autoClose option to FileHandle readableWebStream (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 8, 2025
Notable changes:

doc:
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 8, 2025
Notable changes:

doc:
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 9, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) #58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) #58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 9, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) #58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) #58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 9, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) #58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) #58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 9, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) #58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) #58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 9, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) #58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) #58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
aduh95 pushed a commit that referenced this pull request Jun 9, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) #58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) #58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) #58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) #58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) #58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) #57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) #58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) #58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) #58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) #58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) #58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) #58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) #58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) #58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) #58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) #58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) #58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) #58385

PR-URL: #58635
seriousme pushed a commit to seriousme/node that referenced this pull request Jun 10, 2025
Notable changes:

doc:
  * add Filip Skokan to TSC (Rafael Gonzaga) nodejs#58499
  * deprecate `util.isNativeError` in favor of `Error.isError` (Miguel Marcondes Filho) nodejs#58262
  * deprecate passing an empty string to `options.shell` (Antoine du Hamel) nodejs#58564
  * deprecate HTTP/2 priority signaling (Matteo Collina) nodejs#58313
  * (SEMVER-MINOR) graduate `Symbol.dispose`/`asyncDispose` from experimental (James M Snell) nodejs#58467
esm:
  * (SEMVER-MINOR) implement import.meta.main (Joe) nodejs#57804
fs:
  * (SEMVER-MINOR) add `autoClose` option to `FileHandle` `readableWebStream` (James M Snell) nodejs#58548
http:
  * deprecate instantiating classes without new (Yagiz Nizipli) nodejs#58518
http2:
  * (SEMVER-MINOR) add diagnostics channel 'http2.server.stream.finish' (Darshan Sen) nodejs#58560
  * (SEMVER-MAJOR) remove support for priority signaling (Matteo Collina) nodejs#58293
lib:
  * (SEMVER-MINOR) graduate error codes that have been around for years (James M Snell) nodejs#58541
perf_hooks:
  * (SEMVER-MINOR) make event loop delay histogram disposable (James M Snell) nodejs#58384
src:
  * (SEMVER-MINOR) support namespace options in configuration file (Pietro Marchini) nodejs#58073
permission:
  * implicit allow-fs-read to app entrypoint (Rafael Gonzaga) nodejs#58579
test:
  * (SEMVER-MINOR) add disposable histogram test (James M Snell) nodejs#58384
  * (SEMVER-MINOR) add test for async disposable worker thread (James M Snell) nodejs#58385
util:
  * (SEMVER-MINOR) add 'none' style to styleText (James M Snell) nodejs#58437
worker:
  * (SEMVER-MINOR) make Worker async disposable (James M Snell) nodejs#58385

PR-URL: nodejs#58635
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. config Issues or PRs related to the config subsystem lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. review wanted PRs that need reviews. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants