Skip to content

Conversation

@ycdzj
Copy link
Contributor

@ycdzj 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

Copilot AI review requested due to automatic review settings November 10, 2025 12:36
Copy link
Contributor

Copilot AI left a 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.

});
const response = await this.s3Client.send(uploadPartCommand);
if (!response.CopyPartResult?.ETag) {
throw new Error(`Failed to upload part`);
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
throw new Error(`Failed to upload part`);
throw new Error(`Failed to upload part ${i + 1} of ${chunksName.length}`);

Copilot uses AI. Check for mistakes.
@ycdzj ycdzj force-pushed the refactor/resources branch 2 times, most recently from 36b8242 to d3c27ba Compare November 13, 2025 03:27
@ycdzj ycdzj force-pushed the refactor/resources branch from e36b0e5 to ace1e5b Compare November 13, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants