Skip to content

fs: fix cpSync handle existing symlinks #58476

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jakecastelli
Copy link
Member

Fixes: #58468

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels May 27, 2025
@jakecastelli jakecastelli marked this pull request as draft May 27, 2025 03:12
Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.22%. Comparing base (44a5375) to head (cde63b2).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58476      +/-   ##
==========================================
+ Coverage   90.19%   90.22%   +0.03%     
==========================================
  Files         635      635              
  Lines      187394   187608     +214     
  Branches    36800    36857      +57     
==========================================
+ Hits       169014   169265     +251     
+ Misses      11134    11133       -1     
+ Partials     7246     7210      -36     
Files with missing lines Coverage Δ
lib/internal/fs/cp/cp-sync.js 92.20% <100.00%> (+0.06%) ⬆️
lib/internal/fs/cp/cp.js 91.19% <100.00%> (+0.87%) ⬆️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jakecastelli jakecastelli marked this pull request as ready for review May 27, 2025 15:54
Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

This looks great! thanks for the fix @jakecastelli 🫶

By the way, could you please rebase this to the latest main and basically revert the changes I made here? 🙂 #58472

@dario-piotrowicz
Copy link
Member

dario-piotrowicz commented May 27, 2025

I don't think that this PR fully addresses #58468 since the issue mentions the bug both in cp and cpSync, @jakecastelli could you solve the bug in both functions? 🙂 (or alternatively I can split the issue into two if you prefer?)

@jakecastelli
Copy link
Member Author

Thanks for the pointer, I was a bit running late last night and didn't pay close attention to the cp repo code, I have fixed both places with newly added tests, and reverted 52430b9 🙏 PTAL

@jakecastelli jakecastelli added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label May 28, 2025
Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks great! thanks a lot again @jakecastelli 🙏

I just left a couple of comments about the tests comments, I hope those can be addressed before landing this 🙂🙏

@dario-piotrowicz dario-piotrowicz added the request-ci Add this label to start a Jenkins CI on a PR. label May 28, 2025
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels May 28, 2025

This comment was marked as outdated.

@jakecastelli jakecastelli removed the request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. label May 28, 2025
@dario-piotrowicz dario-piotrowicz added the request-ci Add this label to start a Jenkins CI on a PR. label May 28, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 28, 2025
@nodejs-github-bot
Copy link
Collaborator

@jakecastelli jakecastelli added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels May 29, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 29, 2025
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cp and cpSync incorrectly handle existing dest symlinks
4 participants