Skip to content

Conversation

JunchengXue
Copy link
Contributor

No description provided.

@JunchengXue JunchengXue force-pushed the feature/oss-provider branch from e1fa08c to ceb2fff Compare June 18, 2025 09:57
@JunchengXue JunchengXue changed the base branch from develop to main August 12, 2025 02:21
@JunchengXue JunchengXue requested a review from Copilot August 12, 2025 02:21
Copy link

@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 adds support for customizing boto3 core configuration specifically for OSS (Object Storage Service) storage providers. The changes enable proper integration with OSS by handling OSS-specific requirements and endpoint configurations.

  • Add optional endpoint and storage provider fields to user credentials
  • Implement OSS-specific boto3 configuration with checksum validation settings
  • Add endpoint URL configuration support for alternative storage providers


if Env.current.s3_endpoint_url is not None:
kwargs["endpoint_url"] = Env.current.s3_endpoint_url

Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The endpoint URL assignment logic has a potential issue. If both self.user_credential.endpoint and Env.current.s3_endpoint_url are set, the environment variable will overwrite the user credential endpoint without any indication. Consider either documenting this precedence or adding a warning when both are present.

Suggested change
if self.user_credential.endpoint is not None:
log.warning(
"Both user credential endpoint (%s) and environment S3 endpoint (%s) are set. "
"Environment S3 endpoint will take precedence.",
self.user_credential.endpoint,
Env.current.s3_endpoint_url,
)
kwargs["endpoint_url"] = Env.current.s3_endpoint_url

Copilot uses AI. Check for mistakes.

customize_boto3_config = None
if (
self.user_credential.storage_provider is not None
and self.user_credential.storage_provider == "OSS"
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

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

The hardcoded string "OSS" should be defined as a constant to improve maintainability and prevent typos. Consider defining OSS_STORAGE_PROVIDER = "OSS" at the module level.

Suggested change
and self.user_credential.storage_provider == "OSS"
and self.user_credential.storage_provider == OSS_STORAGE_PROVIDER

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants