fix(fs): preserve promises namespace identity - #9887
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe codegen now maps promise native-module names through a shared submodule-key helper. Native module values install the matching node submodule and resolve its canonical namespace singleton. Tests verify call ordering, and the changelog records the fix. ChangesPromise namespace identity
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Promise namespace values for fs and stream now reuse their canonical submodule namespace singletons, preserving identity with the corresponding promises properties. No concrete current-head merge risk remains. Sequence Diagram(s)sequenceDiagram
participant NativeModuleRef
participant native_namespace_submodule_key
participant fs_promises_submodule
participant js_node_submodule_namespace
NativeModuleRef->>native_namespace_submodule_key: resolve fs/promises
native_namespace_submodule_key-->>NativeModuleRef: return fs_promises
NativeModuleRef->>fs_promises_submodule: install fs/promises submodule
NativeModuleRef->>js_node_submodule_namespace: resolve canonical namespace
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on |
The
node-suite/fs/imports/namespace-exportsrow in #9202 fails two identity checks becauseimport { promises } from "node:fs"becomes a genericfs/promisesnative-module object, whilefs.promisescorrectly returns the canonicalfs_promisessubmodule singleton.Use the node-submodule namespace whenever an
fs/promisesorstream/promisesnative-module reference becomes a runtime value. The value and call paths now share one spelling map and install the matching submodule before reading its singleton.Validation:
node-suite/fs/imports/namespace-exports: 1/1 parity pass against Node 26.5.1node-suite/fs-promises/importsfixtures: exact Node outputnode-suite/stream/imports/promises-*fixtures: exact Node outputcargo test -p perry-codegen: 1,431 unit tests plus integration and doc tests passscripts/run_lint_gates.sh: all 64 gates passed; 2 CI-expression gates skipped locallyNo version bump.
Addresses
node-suite/fs/imports/namespace-exportsin #9202.Summary by CodeRabbit
Bug Fixes
fs/promisesandstream/promisesnamespace handling when native-module references are converted to values.Tests
fs/promisesnamespace singleton.