Skip to content

fix(node): missing statfs export from node:fs/promises - #31528

Merged
marvinhagemeister merged 1 commit into
mainfrom
node-fsp-statfs
Dec 8, 2025
Merged

marvinhagemeister merged 1 commit into
mainfrom
node-fsp-statfs

Conversation

@marvinhagemeister

Copy link
Copy Markdown
Contributor

We already had the functionality, we just didn't export it.

Fixes #31526

@coderabbitai

coderabbitai Bot commented Dec 8, 2025 •

Copy link
Copy Markdown

Walkthrough

This PR adds the missing statfs export to the Node.js fs/promises polyfill module and includes a corresponding test. The change re-exports fsPromises.statfs as a public binding in ext/node/polyfills/fs/promises.ts, and verifies its functionality with a new test case in the test suite. No modifications to existing exports or behavior.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a missing statfs export from node:fs/promises, which matches the actual code changes.
Description check ✅ Passed The description accurately relates to the changeset, explaining that the functionality already existed but wasn't exported, and references the fixed issue.
Linked Issues check ✅ Passed The PR successfully addresses issue #31526 by adding the missing statfs export to node:fs/promises, enabling the reproduction code to work as intended.
Out of Scope Changes check ✅ Passed All changes are directly related to the stated objective: adding the statfs export and its corresponding test, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch node-fsp-statfs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/unit_node/fs_test.ts (1)

187-192: Consider verifying the return value.

The test confirms statfs is callable, which satisfies the PR objective. Optionally, you could assert the return value has expected properties like bsize, blocks, etc. to ensure it's working correctly.

Example enhancement:

 Deno.test(
   "[node/fs/promises statfs] export statfs function",
   async () => {
-    await statfs(import.meta.filename!);
+    const result = await statfs(import.meta.filename!);
+    assert(typeof result.bsize === "number");
+    assert(typeof result.blocks === "number");
   },
 );
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99c4d22 and 7a71693.

📒 Files selected for processing (2)
  • ext/node/polyfills/fs/promises.ts (1 hunks)
  • tests/unit_node/fs_test.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js}: For JavaScript runtime debugging, enable V8 inspector with --inspect-brk flag and connect Chrome DevTools to chrome://inspect
Use console.log() for debug prints in JavaScript runtime code

Files:

  • ext/node/polyfills/fs/promises.ts
  • tests/unit_node/fs_test.ts
🧬 Code graph analysis (2)
ext/node/polyfills/fs/promises.ts (2)
ext/node/ops/fs.rs (1)
  • statfs (209-330)
ext/node/polyfills/fs.ts (1)
  • statfs (419-419)
tests/unit_node/fs_test.ts (2)
ext/node/polyfills/fs/promises.ts (1)
  • statfs (19-19)
ext/node/polyfills/fs.ts (1)
  • statfs (419-419)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: test debug windows-x86_64
  • GitHub Check: bench release linux-x86_64
  • GitHub Check: test debug linux-aarch64
  • GitHub Check: test debug linux-x86_64
  • GitHub Check: test release linux-x86_64
  • GitHub Check: test debug macos-x86_64
  • GitHub Check: test debug macos-aarch64
  • GitHub Check: lint debug linux-x86_64
  • GitHub Check: lint debug windows-x86_64
  • GitHub Check: lint debug macos-x86_64
  • GitHub Check: build libs
🔇 Additional comments (2)
ext/node/polyfills/fs/promises.ts (1)

19-19: LGTM - Export added correctly.

The statfs export is properly placed alphabetically and follows the same pattern as all other exports in this file.

tests/unit_node/fs_test.ts (1)

45-45: LGTM - Import added correctly.

@marvinhagemeister
marvinhagemeister enabled auto-merge (squash) December 8, 2025 08:36
@marvinhagemeister
marvinhagemeister merged commit b8b549d into main Dec 8, 2025
@marvinhagemeister
marvinhagemeister deleted the node-fsp-statfs branch December 8, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing statfs export of node:fs/promises

2 participants