-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(resources): remove minio #236
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
base: main
Are you sure you want to change the base?
Conversation
ycdzj
commented
Nov 10, 2025
- refactor(resources): return 404 when getting root
- refactor(resources): remove unused api
- refactor(resources): use s3 instead of minio
- refactor(resources): update minio service
- refactor(resources): fix putObject
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.
Pull Request Overview
This PR migrates the storage layer from the Minio SDK to the AWS SDK for S3 (@aws-sdk/client-s3), providing better compatibility with AWS S3 and S3-compatible services. The migration includes refactoring the MinioService to use AWS SDK v3 commands and removing legacy chunked file upload endpoints that have been superseded by the wizard's chunk management system.
- Replaced Minio SDK with AWS SDK v3 for S3 operations
- Simplified MinioService API by removing bucket parameters and changing return types
- Removed deprecated chunked file upload endpoints from the file resources controller
- Updated configuration to use separate S3 environment variables instead of a single URL
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/minio/minio.service.ts | Complete rewrite to use AWS SDK v3 S3Client instead of Minio client, implementing all storage operations using S3 commands |
| src/minio/utils.ts | Added defensive null checks for optional stat fields (size and lastModified) |
| src/wizard/wizard.service.ts | Updated to use new string return type from minioService.put() |
| src/wizard/chunk-manager.service.ts | Removed size parameter from putChunkObject call |
| src/namespace-resources/namespace-resources.service.ts | Simplified parent resource validation logic and removed deprecated chunk upload methods |
| src/namespace-resources/file-resources.controller.ts | Removed deprecated chunk upload, merge, and patch endpoints along with their unused imports |
| src/feedback/feedback.controller.ts | Updated to use new string return type from minioService.put() |
| src/attachments/attachments.service.ts | Updated to use new string return type from minioService.put() |
| package.json | Removed minio dependency and added @aws-sdk/client-s3 |
| pnpm-lock.yaml | Updated lockfile to reflect new AWS SDK dependencies and removed minio-related packages |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/minio/minio.service.ts
Outdated
| }); | ||
| const response = await this.s3Client.send(uploadPartCommand); | ||
| if (!response.CopyPartResult?.ETag) { | ||
| throw new Error(`Failed to upload part`); |
Copilot
AI
Nov 10, 2025
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.
The error message "Failed to upload part" is missing context about which part failed. Consider including the part number or index in the error message, e.g., Failed to upload part ${i + 1} of ${chunksName.length} to aid debugging.
| throw new Error(`Failed to upload part`); | |
| throw new Error(`Failed to upload part ${i + 1} of ${chunksName.length}`); |
36b8242 to
d3c27ba
Compare
e36b0e5 to
ace1e5b
Compare