FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: fix opts.filter issue in cpSync by thoqbk · Pull Request #45143 · nodejs/node · GitHub

/ node Public

fs: fix opts.filter issue in cpSync - #45143

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
thoqbk:cp-sync-fix-opts-filter
Nov 1, 2022
Merged

fs: fix opts.filter issue in cpSync#45143
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
thoqbk:cp-sync-fix-opts-filter

Conversation

thoqbk commented Oct 24, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes: #44720

replicate #44922 for cpSync

issues:

  • copy sync API doesn't handle opts.filter properly.
    As a result, the path validation logic still gets triggered
    even though the file or folder is filtered out
  • no central place to handle opts.filter
    e.g. need to call opts.filter(src, dest) in several places

changes:

  • use checkPathsSync as a central place to validate the paths
    (with consideration of opts.filter) before copying
  • cleanup: remove startCopy, change function name handleFilterAndCopy
    to checkParentDir to make it consistent with copy async
  • update tests to test for both copy sync and async

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 Oct 24, 2022
Comment thread test/parallel/test-fs-cp.mjs Outdated
Comment thread test/parallel/test-fs-cp.mjs Outdated
Comment thread lib/internal/fs/cp/cp-sync.js Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

change the name to make it consistent with cp-async

thoqbk force-pushed the cp-sync-fix-opts-filter branch from 9033729 to bf2dde5 Compare October 25, 2022 01:51
thoqbk requested a review from aduh95 October 25, 2022 10:56

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Changes LGTM, if you want to open a separate PR to investigate why the options object gets mutated that'd be great!

theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2022

Copy link
Copy Markdown
Collaborator

aduh95 added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Oct 31, 2022

Copy link
Copy Markdown
Collaborator

aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 1, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 1, 2022
nodejs-github-bot merged commit a14fc49 into nodejs:main Nov 1, 2022

Copy link
Copy Markdown
Collaborator

Landed in a14fc49

RafaelGSS pushed a commit that referenced this pull request Nov 1, 2022
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
RafaelGSS mentioned this pull request Nov 1, 2022
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 outstanding review comments, and a CI started. 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.

[fs.cp] fails with EPERM despite filter

4 participants


Back | FazBrowse Home | New Git URL