-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix(project-access): check for files in srv folder treats directories as files and throws exception #2923
fix(project-access): check for files in srv folder treats directories as files and throws exception #2923
Conversation
🦋 Changeset detectedLatest commit: 53012fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…access/check-files-in-srv-folder-of-CAP-project # Conflicts: # packages/project-access/src/project/cap.ts
@Klaus-Keller I refactored to the approach I would prefer because for me this would be more reusing what we already have instead of doing the same thing over again at a different place. Can you please check? @kjose90 Any comment from your side? |
Hi @heimwege, while reviewing this pull request I found some issues with Here is what happened, I wanted to test the two scenarios for determining CAP project type using memFs.
While the first test was fine, the second test failed. Reason is, that However, the callback function passed to While debugging this, I found another issue with the code to filter changes: const filteredChanges = Object.keys(changes).filter(
(f) =>
fileNames.includes(basename(f)) ||
extensionNames.includes(extname(f)) ||
(fileNames.length === 0 && extensionNames.length === 0 && f.includes(root)) While your addition (fileNames.length === 0 && extensionNames.length === 0 && f.includes(root)) works, the other two cases As I've ended up spending quite some time on it, I took the freedom to commit the changes to this branch, if you disagree we can revert them:
|
@Klaus-Keller did the tests run for you? I get a lot or errors with the current version of the branch Seems like there was the well known windows vs. mac path separator issue. I enforced the path.posix.sep for the memFs check and at least the tests are now green. |
Sorry, missed that. For me the tests run was green. Thanks for fix. |
…n-srv-folder-of-CAP-project' into fix/project-access/check-files-in-srv-folder-of-CAP-project
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.
Thanks @heimwege for looking into this.
- changes to check files in virtual folder look good
- changeset exists
- test coverage is good
- visual check and manual tests done
Approved from my side.
@kjose90, please review this pull request. |
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.
Thanks @heimwege. Changes looks great & tests to cover. ✅
Just a small example would be nice getMemFsChanges
if its not too much work.
|
#2922
project-access checkFilesInSrvFolder currently throws an exception in case the CAP srv folder contains subfolders because those are currently being treated like files and
readFiles
dumps on folders.@kjose90 would the proposed fix work for you?