-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
New Components - egnyte #15301
New Components - egnyte #15301
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis pull request introduces comprehensive functionality for the Egnyte integration, including new actions and sources for managing files and folders. The changes include creating a new module for creating folders, uploading files, implementing rate-limited API requests, and developing polling sources to detect new files and folders in Egnyte. The implementation adds methods to interact with the Egnyte API, manages dependencies, and provides structured error handling for various operations. Changes
Sequence DiagramsequenceDiagram
participant User
participant EgnyteApp
participant EgnyteAPI
User->>EgnyteApp: Create Folder/Upload File
EgnyteApp->>EgnyteAPI: Make Rate-Limited Request
EgnyteAPI-->>EgnyteApp: Return Response
EgnyteApp-->>User: Confirm Action
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 7
🧹 Nitpick comments (5)
components/egnyte/egnyte.app.mjs (1)
49-56
: Add content type validation for file uploads.The
uploadFile
method should validate or specify content types to ensure proper file handling.uploadFile({ folderPath, filename, ...opts }) { return this._makeRequest({ method: "POST", path: `/fs-content/${folderPath}/${filename}`, + headers: { + 'Content-Type': opts.contentType || 'application/octet-stream', + }, ...opts, }); }components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs (1)
16-22
: Consider adding more metadata fields for better event tracking.The current metadata includes basic file information. Consider adding:
- File size
- File type/extension
- Last modified timestamp
generateMeta(file) { return { id: file.entry_id, - summary: `New file: ${file.name}`, + summary: `New file: ${file.name} (${file.size} bytes)`, ts: file.uploaded, + additional_info: { + size: file.size, + extension: file.name.split('.').pop(), + last_modified: file.last_modified, + }, }; }components/egnyte/sources/new-folder-added/new-folder-added.mjs (2)
16-22
: Align metadata structure with file source.For consistency, consider adding similar additional metadata fields as suggested for the file source.
generateMeta(folder) { return { id: folder.folder_id, - summary: `New folder: ${folder.name}`, + summary: `New folder: ${folder.name} (${folder.path})`, ts: folder.uploaded, + additional_info: { + path: folder.path, + parent_id: folder.parent_id, + last_modified: folder.last_modified, + }, }; }
7-8
: Consider incrementing the version number.The current version is set to "0.0.1". Since this is part of a new feature set, consider starting with "1.0.0".
- version: "0.0.1", + version: "1.0.0",components/egnyte/actions/upload-file/upload-file.mjs (1)
13-25
: Add file size and type restrictions.Consider adding props to restrict file size and allowed file types for better security and reliability.
props: { egnyte, filePath: { type: "string", label: "File Path", description: "The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)", + validate: (filePath) => { + const stats = fs.statSync(filePath); + if (stats.size > 100 * 1024 * 1024) // 100MB + throw new Error('File size exceeds 100MB limit'); + }, }, folderPath: { type: "string", label: "Folder Path", description: "The full path to the folder where the file should be uploaded. Example: `/Shared/Documents", }, + allowedMimeTypes: { + type: "string[]", + label: "Allowed File Types", + description: "List of allowed MIME types", + optional: true, + }, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
components/egnyte/actions/create-folder/create-folder.mjs
(1 hunks)components/egnyte/actions/upload-file/upload-file.mjs
(1 hunks)components/egnyte/egnyte.app.mjs
(1 hunks)components/egnyte/package.json
(2 hunks)components/egnyte/sources/common/base.mjs
(1 hunks)components/egnyte/sources/new-file-in-folder/new-file-in-folder.mjs
(1 hunks)components/egnyte/sources/new-folder-added/new-folder-added.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
🔇 Additional comments (2)
components/egnyte/egnyte.app.mjs (1)
3-7
: Consider adjusting rate limits based on Egnyte's API documentation.The current implementation limits to 2 requests per second (500ms minimum time). Verify this against Egnyte's API rate limits to ensure optimal throughput while maintaining compliance.
components/egnyte/package.json (1)
3-3
: Consider using SemVer for version bump.The version bump to 0.1.0 suggests new features. Ensure this follows semantic versioning principles based on the nature of changes.
✅ Verification successful
Version 0.1.0 is appropriate for this new component
This is an initial release of a new Egnyte integration package with multiple features (file/folder operations and webhooks). The 0.1.0 version correctly follows SemVer principles for a pre-1.0 component with substantial functionality.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check commit history to verify the nature of changes git log --oneline | grep -i "breaking\|feat\|fix" | head -n 5Length of output: 0
Script:
#!/bin/bash # Check the previous version and changes git diff HEAD~1 components/egnyte/package.json # Look for new files or significant changes in the component git diff --name-status HEAD~1 components/egnyte/ # Check the contents of the component directory fd . components/egnyte/ -t fLength of output: 480
Script:
#!/bin/bash # Check if this is a new component git log --oneline components/egnyte/ # View package.json content cat components/egnyte/package.jsonLength of output: 555
Resolves #15293.
Note to QA: I wasn't able to get the webhooks endpoints to work without error, so I created the sources to use polling.
Summary by CodeRabbit
New Features
Improvements
Version Update