Skip to content

process: generate list of allowed env flags programmatically - #22638

Closed
addaleax wants to merge 4 commits into
nodejs:masterfrom
addaleax:allowed-in-env-flags
Closed

process: generate list of allowed env flags programmatically#22638
addaleax wants to merge 4 commits into
nodejs:masterfrom
addaleax:allowed-in-env-flags

Conversation

@addaleax

Copy link
Copy Markdown
Member

Avoids having a separate, second source of truth on this matter.

The second diff is best viewed in whitespace-adjusted mode (append ?w=1 to GitHub URL).

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 31, 2018
@addaleax
addaleaxforce-pushed the allowed-in-env-flags branch from 901d187 to 290af4bCompareAugust 31, 2018 22:54
Comment threadlib/internal/bootstrap/node.js Outdated

@BridgeARBridgeARSep 2, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would prefer to pass through filter options into getOptions instead of doing the filtering here.
Since it has a string option at the moment, it would likely be best to accept an object for the options instead.

Another alternative to the current way would be to only iterate once over the entries (this is also nicer to read for me):

constallowedV8EnvironmentFlags=[];constallowedNodeEnvironmentFlags=[];for(const[name,info]ofoptions){if(info.envVarSettings===kAllowedInEnvironment){if(info.type===KV8Option){allowedV8EnvironmentFlags.push(name);}else{allowedNodeEnvironmentFlags.push(name);}}}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I’ve gone with the second option for now, but yes, ultimately it might be better to do this in C++ land.

Comment threadlib/internal/bootstrap/node.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: retrieving the value multiple times is not necessary.

@addaleax

Copy link
Copy Markdown
MemberAuthor

@addaleax

addaleax commented Sep 5, 2018

Copy link
Copy Markdown
MemberAuthor

New CI: https://ci.nodejs.org/job/node-test-pull-request/17028/ (:heavy_check_mark:)

@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 5, 2018
@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in 995782c, d994e26

@addaleaxaddaleax closed this Sep 9, 2018
@addaleax
addaleax deleted the allowed-in-env-flags branch September 9, 2018 14:23
addaleax added a commit that referenced this pull request Sep 9, 2018
Avoids having a separate, second source of truth on this matter.
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax added a commit that referenced this pull request Sep 9, 2018
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@targos

Copy link
Copy Markdown
Member

This needs a backport PR to land on v10.x-staging

addaleax added a commit that referenced this pull request Sep 13, 2018
Avoids having a separate, second source of truth on this matter.
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
addaleax added a commit that referenced this pull request Sep 13, 2018
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 15, 2018
Avoids having a separate, second source of truth on this matter.
Backport-PR-URL: #22847
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 15, 2018
Backport-PR-URL: #22847
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@targostargos mentioned this pull request Sep 18, 2018
targos pushed a commit that referenced this pull request Sep 19, 2018
Avoids having a separate, second source of truth on this matter.
Backport-PR-URL: #22847
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 19, 2018
Backport-PR-URL: #22847
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 20, 2018
Avoids having a separate, second source of truth on this matter.
Backport-PR-URL: #22847
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Sep 20, 2018
Backport-PR-URL: #22847
PR-URL: #22638
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@addaleax@nodejs-github-bot@targos@jasnell@BridgeAR