-
-
Notifications
You must be signed in to change notification settings - Fork 32k
permission: propagate permission model flags on spawn #58853
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
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
Since |
a397ace
to
ecf6a03
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #58853 +/- ##
==========================================
- Coverage 90.11% 90.07% -0.04%
==========================================
Files 640 640
Lines 188363 188485 +122
Branches 36931 36965 +34
==========================================
+ Hits 169739 169784 +45
- Misses 11341 11390 +49
- Partials 7283 7311 +28
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
Adding notable-change label as it will impact current users of |
ecf6a03
to
29b915a
Compare
|
||
function copyPermissionModelFlagsToEnv(env, key, args) { | ||
// Do not override if permission was already passed to file | ||
if (args.includes('--permission') || (env[key] && env[key].indexOf('--permission') !== -1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify this expression a bit with...
env?.[key]?.indexOf(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How? We need to compare the result with !== -1
and also handle the case when the key is undefined
. Leaving it as env?.[key]?.indexOf('--permission')
might return 0
, which is truthy in this case, so I don't see how using env?.[key]?.indexOf(...)
would simplify this.
|
||
if (!common.hasCrypto) { | ||
common.skip('no crypto'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment in here about why/how this test depends on crypto, as it's not obvious.
Previously, only child_process.fork propagated the exec arguments (execvArgs) to the child process. This commit adds support for spawn and spawnSync to propagate permission model flags — except when they are already provided explicitly via arguments or through NODE_OPTIONS. Signed-off-by: RafaelGSS <[email protected]>
29b915a
to
1f5354a
Compare
Previously, only child_process.fork propagated the exec arguments (execvArgs) to the child process.
This commit adds support for spawn and spawnSync to propagate permission model flags — except when they are already provided explicitly via arguments or through NODE_OPTIONS.