Skip to content
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

src: namespace config file flags #57170

Closed

Conversation

marco-ippolito
Copy link
Member

follow-up: #57016 (comment)

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Feb 21, 2025
@marco-ippolito marco-ippolito force-pushed the namespacing-config-file branch from e2a1d89 to 453c339 Compare February 21, 2025 14:59
@marco-ippolito
Copy link
Member Author

🤔 no code-owners... wonder who I should ping, or create a team

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 96.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.35%. Comparing base (8fc919d) to head (c9fe4d6).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/node_config_file.cc 95.65% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #57170   +/-   ##
=======================================
  Coverage   90.35%   90.35%           
=======================================
  Files         629      629           
  Lines      184308   184394   +86     
  Branches    36015    36027   +12     
=======================================
+ Hits       166532   166617   +85     
+ Misses      10909    10902    -7     
- Partials     6867     6875    +8     
Files with missing lines Coverage Δ
lib/internal/options.js 100.00% <100.00%> (ø)
src/node_config_file.cc 71.96% <95.65%> (+8.94%) ⬆️

... and 25 files with indirect coverage changes

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not use the namespace and just specify a specific file that we use instead of letting the user define the filename.

@marco-ippolito
Copy link
Member Author

I would rather not use the namespace and just specify a specific file that we use instead of letting the user define the filename.

I added the default file in #57171, about namespacing I think its a necessary evil, otherwise we will regret it if the feature grows

@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 21, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 21, 2025
@nodejs-github-bot

This comment was marked as outdated.

@GeoffreyBooth
Copy link
Member

🤔 no code-owners... wonder who I should ping, or create a team

I think we need a @nodejs/cli team or something, to cover this feature and --env-file. Please add me if you create one.

Copy link
Member

@GeoffreyBooth GeoffreyBooth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was discussion in old issues about supporting various environments, like top-level fields such as dev or localhost or prod etc. I don't have an opinion as to how multiple environments or multiple config files should be handled, but I feel like this is something to be worked out now as we're discussing namespacing. If the answer is that we're just not going to provide any explicit support for merging config files or supporting multiple environments within one config file, that's fine, but I think we should have that discussion.

"watch-path": "src",
"watch-preserve-output": true
"nodeOptions": {
"experimental-transform-types": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we support all of experimental-transform-types, experimental_transform_types and experimentalTransformTypes for each flag? Just as currently the CLI supports either of the first two.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with the second, not sure how feasible is the third one. I think we can defer to a followup

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this is just a sample of how to use the config file to persist flags, would it be better to stick to non-experimental flags?

This example maximizes hiding of the dependency on experimental features, e.g. by disabling the warnings too. That's fine if you are experienced enough to understand the implications.

Whilst it's certainly possible to use configs for this purpose, having it as the shining model example seems risky IMO and may be construed as encouragement to use this pattern.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do in the followup PR #57171 since this is ready to land and we have added the not-land-on-v23

@marco-ippolito
Copy link
Member Author

I dont think we should support different environments in the same file, users can use the dev.config.json and the prod.config.json

@nodejs-github-bot

This comment was marked as outdated.

@marco-ippolito marco-ippolito force-pushed the namespacing-config-file branch from 83e5231 to c9fe4d6 Compare February 22, 2025 09:32
@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 22, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 22, 2025
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Feb 22, 2025

@marco-ippolito marco-ippolito added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. labels Feb 24, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 24, 2025
@nodejs-github-bot
Copy link
Collaborator

Landed in 992036e...044d69a

nodejs-github-bot pushed a commit that referenced this pull request Feb 24, 2025
PR-URL: #57170
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Feb 24, 2025
PR-URL: #57170
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
@marco-ippolito marco-ippolito added the dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. dont-land-on-v23.x PRs that should not land on the v23.x-staging branch and should not be released in v23.x. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants