Skip to content

Fix Cloudflare R2 integration by adding required MinIO client configu… #488

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

YuKARLO15
Copy link
Owner

…ration (#486)

  • Initial plan

  • Fix Cloudflare R2 integration with MinIO client configuration updates


…ration (#486)

* Initial plan

* Fix Cloudflare R2 integration with MinIO client configuration updates

Co-authored-by: YuKARLO15 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: YuKARLO15 <[email protected]>
@YuKARLO15 YuKARLO15 self-assigned this Jul 9, 2025
@YuKARLO15 YuKARLO15 added the deployment Strictly used on PRs to production label Jul 9, 2025
Copy link
Contributor

@Copilot 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 fixes Cloudflare R2 integration by updating MinIO client configurations across the codebase to ensure compatibility with R2's specific requirements.

  • Added required region: 'auto' and pathStyle: true configuration options to all MinIO client instantiations
  • Updated region parameter in bucket creation calls from 'us-east-1' to 'auto'
  • Added a new getR2PresignedUrl method for improved R2 compatibility

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
bsc-js-backend/src/services/minio.service.ts Added R2-specific configuration options to MinIO client
bsc-js-backend/src/modules/document-applications/services/minio.service.ts Updated MinIO client config, changed bucket creation region, and added R2 presigned URL method
bsc-js-backend/src/modules/document-applications/services/minio.service.spec.ts Updated test to expect 'auto' region instead of 'us-east-1'
bsc-js-backend/src/main.ts Applied R2 configuration updates to test connection function
Comments suppressed due to low confidence (2)

bsc-js-backend/src/modules/document-applications/services/minio.service.ts:111

  • The method name 'getR2PresignedUrl' is inconsistent with the existing 'getPresignedUrl' method. Consider renaming to maintain consistency, or if this is meant to replace the existing method, consider deprecating the old one.
  async getR2PresignedUrl(

bsc-js-backend/src/modules/document-applications/services/minio.service.ts:111

  • The new 'getR2PresignedUrl' method lacks test coverage. Consider adding unit tests to verify the method's behavior, especially error handling and URL generation.
  async getR2PresignedUrl(

expiry: number = 3600,
): Promise<string> {
try {
// Use direct AWS SDK v3 for better R2 compatibility
Copy link
Preview

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment mentions using 'direct AWS SDK v3' but the code still uses the MinIO client. This comment is misleading and should be updated to accurately reflect what the code is doing.

Copilot uses AI. Check for mistakes.

@YuKARLO15 YuKARLO15 merged commit f874257 into production Jul 9, 2025
58 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Strictly used on PRs to production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants