Skip to content

[Improvement-18267][Remote Logging] Allow custom S3 region with endpoint#18268

Merged
SbloodyS merged 5 commits into
apache:devfrom
wcmolin:improvement/18267-s3-custom-region
May 26, 2026
Merged

[Improvement-18267][Remote Logging] Allow custom S3 region with endpoint#18268
SbloodyS merged 5 commits into
apache:devfrom
wcmolin:improvement/18267-s3-custom-region

Conversation

@wcmolin
Copy link
Copy Markdown
Contributor

@wcmolin wcmolin commented May 15, 2026

Was this PR generated or assisted by AI?

Yes

Purpose of the pull request

Close #18267

Allow S3-compatible storage, such as self-hosted MinIO, to use a custom region when aws.s3.endpoint is configured.

Previously, AmazonS3ClientFactory always called Regions.fromName(region), which rejected non-AWS region values before building the S3 client. For custom S3 endpoints, the configured region should be used as the signing region directly.

Brief change log

  • Use the raw configured S3 region when aws.s3.endpoint is configured.
  • Keep the existing AWS region validation when no custom S3 endpoint is configured.
  • Add unit tests for custom endpoint region handling.

Verify this pull request

This change added tests and can be verified as follows:

  • Added AmazonS3ClientFactoryTest to verify custom regions are allowed when an S3 endpoint is configured.
  • Added test coverage to verify invalid custom regions are still rejected when no endpoint is configured.
  • Added test coverage to verify empty regions are rejected when an endpoint is configured.
  • Verified locally with:
    ./mvnw -pl dolphinscheduler-authentication/dolphinscheduler-aws-authentication test -Dtest=AmazonS3ClientFactoryTest -DskipITs

Copy link
Copy Markdown
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

My concern #18267 (comment)

@SbloodyS SbloodyS added this to the 3.4.2 milestone May 25, 2026
@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label May 25, 2026
SbloodyS
SbloodyS previously approved these changes May 25, 2026
Copy link
Copy Markdown
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
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 improves the AWS authentication S3 client factory used by DolphinScheduler’s remote logging / S3 storage integrations by allowing non-AWS (custom) region strings when a custom aws.s3.endpoint is configured (e.g., MinIO), while keeping strict AWS region validation when no endpoint override is provided.

Changes:

  • Use the raw configured region string as the signing region when aws.s3.endpoint is set, instead of validating via Regions.fromName(...).
  • Add an explicit validation that aws.s3.region is non-empty when a custom endpoint is configured.
  • Add unit tests covering custom endpoint + custom region, invalid custom region without endpoint, and empty region with endpoint.

Reviewed changes

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

File Description
dolphinscheduler-authentication/dolphinscheduler-aws-authentication/src/main/java/org/apache/dolphinscheduler/authentication/aws/AmazonS3ClientFactory.java Adjusts S3 client creation to bypass AWS region enum validation when using a custom endpoint, and adds empty-region validation for that mode.
dolphinscheduler-authentication/dolphinscheduler-aws-authentication/src/test/java/org/apache/dolphinscheduler/authentication/aws/AmazonS3ClientFactoryTest.java Adds unit tests verifying the new endpoint/region behavior and expected validation outcomes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ruanwenjun
ruanwenjun previously approved these changes May 26, 2026
Copy link
Copy Markdown
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 60%)

See analysis details on SonarQube Cloud

@SbloodyS SbloodyS merged commit 8cd7aec into apache:dev May 26, 2026
121 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend improvement make more easy to user or prompt friendly ready-to-merge test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] [Remote Logging] S3-compatible storage with custom endpoint should allow custom region

4 participants