GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: fix opts.filter issue in cpSync by thoqbk · Pull Request #45143 · nodejs/node

Conversation

@thoqbk

@thoqbk thoqbk commented Oct 24, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss and thoqbk reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Oct 24, 2022
thoqbk
thoqbk commented Oct 24, 2022
View reviewed changes
Comment thread test/parallel/test-fs-cp.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/parallel/test-fs-cp.mjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@thoqbk thoqbk mentioned this pull request Oct 24, 2022
fs: fix operation not permitted #44786
Closed
thoqbk
thoqbk commented Oct 24, 2022
View reviewed changes
Comment thread lib/internal/fs/cp/cp-sync.js Outdated

@thoqbk thoqbk Oct 24, 2022

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

change the name to make it consistent with cp-async

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thoqbk
fs: fix opts.filter issue in cpSync
bf2dde5
@thoqbk
thoqbk force-pushed the cp-sync-fix-opts-filter branch from 9033729 to bf2dde5 Compare October 25, 2022 01:51
@thoqbk
thoqbk requested a review from aduh95 October 25, 2022 10:56
aduh95
aduh95 approved these changes Oct 25, 2022
View reviewed changes

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thoqbk reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 31, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 31, 2022
@nodejs-github-bot

nodejs-github-bot commented Oct 31, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/47598/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95 aduh95 added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Oct 31, 2022
@nodejs-github-bot

nodejs-github-bot commented Oct 31, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/47606/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Nov 1, 2022
CI Reliability 2022-11-01 nodejs/reliability#417
Open
17 tasks
@aduh95 aduh95 added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 1, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 1, 2022
@nodejs-github-bot
nodejs-github-bot merged commit a14fc49 into nodejs:main Nov 1, 2022
@nodejs-github-bot

nodejs-github-bot commented Nov 1, 2022

Copy link
Copy Markdown
Collaborator

Landed in a14fc49

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thoqbk thoqbk mentioned this pull request Nov 1, 2022
Run copy*() filter before running fs.stat() on items jprichardson/node-fs-extra#971
Merged
RafaelGSS pushed a commit that referenced this pull request Nov 1, 2022
@thoqbk @RafaelGSS
fs: fix opts.filter issue in cpSync
d9d1dda
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Nov 1, 2022
v19.1.0 proposal #45269
Merged
This was referenced Nov 2, 2022
CI Reliability 2022-11-02 nodejs/reliability#418
Open
CI Reliability 2022-11-05 nodejs/reliability#419
Open
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
@thoqbk @RafaelGSS
fs: fix opts.filter issue in cpSync
670def3
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <[email protected]>
@danielleadams danielleadams mentioned this pull request Dec 30, 2022
v18.13.0 release proposal #46025
Merged
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
@thoqbk @danielleadams
fs: fix opts.filter issue in cpSync
69091f0
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
@thoqbk @danielleadams
fs: fix opts.filter issue in cpSync
1db20c8
PR-URL: #45143
Fixes: #44720
Reviewed-By: Antoine du Hamel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aduh95 aduh95 aduh95 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[fs.cp] fails with EPERM despite filter

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@thoqbk @nodejs-github-bot @aduh95 @theanarkh
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.