-
Notifications
You must be signed in to change notification settings - Fork 534
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
fix(instrumentation-fs): allow realpath.native and realpathSync.native #1332
fix(instrumentation-fs): allow realpath.native and realpathSync.native #1332
Conversation
Will this also fix the issue with using `fs/promises? |
No, sorry |
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.
Thanks for working on this fix.
Added a few comments, mainly about style and types.
change indexFs return types and object properties of return
previously ['realpath', 'native'] now 'realpath.native' also moved exported yet private functions to utils file fixed tests to follow these changes refactored patching code to function with added comment
@blumamir sorry for the delay, I tried to address all your suggestions let me know if I missed anything |
Hi @JakubKoralewski , I apologize for the this PR is open. Would it be possible for you to jump on a quick zoom call to discuss this? I searched for your name in CNCF slack but couldn't find you there. |
…trib into fix-realpathsync-native # Conflicts: # plugins/node/instrumentation-fs/src/instrumentation.ts # plugins/node/instrumentation-fs/src/types.ts
@JakubKoralewski please fix the CI and I'll merge |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1332 +/- ##
==========================================
+ Coverage 96.08% 96.21% +0.12%
==========================================
Files 14 15 +1
Lines 895 951 +56
Branches 192 196 +4
==========================================
+ Hits 860 915 +55
- Misses 35 36 +1
|
@JakubKoralewski - I pushed a few commits to your branch to attempt to fix the build and lint issues. Please take a look and approve if you are ok with them |
open-telemetry#1332) * test(instrumentation-fs): add failing test for bug * fix(instrumentation-fs): allow .native fs funcs * refactor(instrumentation-fs): indexFs change indexFs return types and object properties of return * refactor(instr-fs): use string for two level fns previously ['realpath', 'native'] now 'realpath.native' also moved exported yet private functions to utils file fixed tests to follow these changes refactored patching code to function with added comment * refactor(instrumentation-fs): remove memberToDisplayName * refactor(instrumentation-fs): simplify splitTwoLevels signature * fix(instrumentation-fs): lint * fix(instrumentation-fs): lint (typeof fs) * fix(instrumentation-fs): test types * chore: fix compile and lint * fix(fs): exclude undefined in generic type * test(fs): skip fs functions in node14 which were added later --------- Co-authored-by: Amir Blum <amirgiraffe@gmail.com> Co-authored-by: Amir Blum <amir@aspecto.io>
* fix(instrumentation-fs): fix instrumentation of `fs/promises` * Revert "fix(instrumentation-fs): fix instrumentation of `fs/promises`" This reverts commit 90d9f0d. * fix(instrumentation-fs): fix instrumentation of `fs/promises` * chore(instrumentation-fs): fix lint error * chore(instrumentation-fs): hard-code `R_OK` value for node 14 * chore(instrumentation-fs): fix supported version for `fs/promises` * chore(instrumentation-fs): incorporate changes from #1332 * chore(instrumentation-fs): consolidate common test utilities --------- Co-authored-by: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com>
Hi! First PR here 🎅 Let me know if I did something wrong.
Which problem is this PR solving?
Fixes #1315
Short description of the changes
Maybe I overengineered it a little by adding ['realpath', 'native'], and ['realpathSync', 'native'] to
CALLBACK_FUNCTIONS
andSYNC_FUNCTIONS
respectively, instead of just adding if statements, but I guess it's future-proof. The crux of the matter is the call toObject.assign(rv, original);
that assigns properties from the original function onto the new one, thenative
property gets assigned, but the function specific stuff is read-only so the function itself doesn't get overwritten.