Skip to content

fix: walk and copy directories without a stat per file - #3

Open
anurag6569201 wants to merge 1 commit into
qa/agent-sveltejs-kit/pr-03-16995/basefrom
qa/agent-sveltejs-kit/pr-03-16995/head
Open

anurag6569201 wants to merge 1 commit into
qa/agent-sveltejs-kit/pr-03-16995/basefrom
qa/agent-sveltejs-kit/pr-03-16995/head

Conversation

@anurag6569201

Copy link
Copy Markdown

walk and copy in packages/kit/src/utils/filesystem.js stat every entry to find out whether it is a directory, and copy also calls mkdirSync for every file and rebuilds each returned path from the absolute target. readdirSync already knows the entry type, so both now read it from there, and copy creates each directory once and carries the relative path down the recursion.

5000 files in 200 directories: walk 24 ms to 4 ms, copy 114 ms to 86 ms.

Summary by CodeRabbit

  • Bug Fixes
    • Improved directory walking and copying for faster, more reliable file operations.
    • Directory symlinks are now handled correctly during traversal and copying.
    • Reduced unnecessary file metadata checks when processing directories.

Source merge-base: 03f1687fe612ce3d2d9131139b5b188d9cf90c64
Source head: 7b73f95c60c191209839826d6f6d6556738a21d5

@shipwright-agent

Copy link
Copy Markdown

⛔ Shipwright · Blocked

Recommendation: do not merge PR #3 · Tier T1
Checks: 0 total · 0 needing attention

Next step: resolve the blocking findings before merge.

Findings (3)

  • CRITICAL The 'created' cache assumes all files in a directory are written before moving to another directory, but 'go' is recursive and depth-first. · packages/kit/src/utils/filesystem.js:34
    • Fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
  • CRITICAL The 'copy' function now follows symlinks to directories and copies their contents. · packages/kit/src/utils/filesystem.js:34
    • Fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
  • HIGH The 'created' variable is a single cache for the last created directory. · packages/kit/src/utils/filesystem.js:22
    • Fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.

Fireworks usage: 7,016 input · 619 output · 7,635 total tokens · $0.0011 · 133s · 0 fix iteration(s)

Open the Shipwright check for full evidence and the audit bundle. Use /shipwright rerun to verify again.

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.

1 participant