-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve file storage list method #22
base: main
Are you sure you want to change the base?
Conversation
|
||
describe('getGlobBase', () => { | ||
test.each([ | ||
{ pattrn: 'foo/bar/*.js', expected: 'foo/bar/' }, |
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.
typo していました。
{ pattrn: 'foo/bar/*.js', expected: 'foo/bar/' }, | |
{ pattern: 'foo/bar/*.js', expected: 'foo/bar/' }, |
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.
2f253cd で修正しました 🙏
|
@coderabbitai review |
WalkthroughThe updates to the Connectable IO's file storage plugin improve file listing capabilities by requiring a Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (5)
- packages/@connectable-io/storage-plugin-file/src/adapters/FileSystemStorageAdapter.test.ts (4 hunks)
- packages/@connectable-io/storage-plugin-file/src/adapters/FileSystemStorageAdapter.ts (2 hunks)
- packages/@connectable-io/storage-plugin-file/src/utils/get-glob-base.spec.ts (1 hunks)
- packages/@connectable-io/storage-plugin-file/src/utils/get-glob-base.ts (1 hunks)
- packages/@connectable-io/storage/src/models.ts (1 hunks)
Additional comments: 9
packages/@connectable-io/storage-plugin-file/src/utils/get-glob-base.ts (1)
- 14-22: The implementation of
getGlobBase
function looks correct and aligns with the PR objectives to improve path resolution.packages/@connectable-io/storage-plugin-file/src/utils/get-glob-base.spec.ts (1)
- 4-15: The test suite for
getGlobBase
function is comprehensive and covers a variety of glob patterns, ensuring the function's correctness.packages/@connectable-io/storage/src/models.ts (1)
- 88-88: The added documentation and exception cases for the
listFiles
method in theStorage
interface are clear and enhance the error handling process.packages/@connectable-io/storage-plugin-file/src/adapters/FileSystemStorageAdapter.ts (2)
16-16: The import of
getGlobBase
is correctly added to be used within thelist
method.212-235: The changes to the
list
method, including the requirement of aprefix
parameter and the implementation of permission checks, align with the PR objectives to enhance the file storage list functionality.packages/@connectable-io/storage-plugin-file/src/adapters/FileSystemStorageAdapter.test.ts (4)
3-3: The addition of
constants
fromnode:fs/promises
is appropriate for the new tests that check for read permissions.125-131: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [128-140]
The test cases added for the
list
method correctly simulate the listing of files and the handling of non-existent directories.
145-149: The test case that asserts an empty array is returned when the base directory does not exist is correct and aligns with the PR objectives.
171-184: The test cases added for checking the glob base directory and storage readability are appropriate and ensure the new functionality works as expected.
This pull request makes several improvements to the file storage list method.
Key Modifications
FileSystemStorageAdapter.js Changes:
list
method.PermissionDeniedError
when access is denied.New Utility Function - getGlobBase:
getGlobBase
, which determines the base directory of a glob pattern.FileSystemStorageAdapter.js
to improve the handling of file paths and patterns.Test Suite Enhancements:
FileSystemStorageAdapter
to cover new scenarios and exceptions.getGlobBase
function to ensure its correct functionality across different glob patterns.Impact on Project
These changes improve the robustness and flexibility of the file storage list method in Connectable IO. It enhances error handling and path resolution, leading to more reliable file system interactions.
Summary by CodeRabbit
New Features
Bug Fixes
prefix
parameter in the file listing method to improve search accuracy.Tests
getGlobBase
function.Documentation
getGlobBase
function usage.