Skip to content

fix(services/s3)!: resolve R2 and MinIO preset endpoints - #9632

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/s3-preset-builder
Dec 4, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
xuanwo/s3-preset-builder

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Dec 3, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #9545

Rationale for this change

A bucket name can match the first label of a MinIO hostname or the Cloudflare account label in an R2 endpoint. The preset then loses that label when the generic S3 builder interprets the hostname as already qualified with the bucket name.

What changes are included in this PR?

Use the preset connection builder for R2 and MinIO. It treats the endpoint as a base URL and preserves the port and proxy path when it adds the bucket. Align both configurations' Debug output with the other S3 presets by displaying the root and bucket. Model the required MinIO endpoint and lakeFS branch or reference root as strings.

On the official MinIO Community Edition RELEASE.2024-09-22T00-33-43Z, the existing MinIO preset sent requests for bucket data at http://data.test:9000 to test:9000. The candidate passed the existing object read and presigned read cases with the addressing option unset, false, and true. Each run could reach MinIO only through the expected hostname. R2 endpoint and signing checks ran offline. Earlier R2 and MinIO validation · R2 US jurisdiction checks · Earlier lakeFS gateway validation

Are there any user-facing changes?

MinIO uses path-style addressing by default. Set enable_virtual_host_style=true for a deployment configured with MINIO_DOMAIN. Rust callers can pass a runtime boolean to Minio::enable_virtual_host_style(bool). R2 uses path-style addressing and the signing region auto for derived and explicit endpoints.

Breaking changes

Affected packages: core, bindings/c, bindings/cpp, bindings/dotnet, bindings/go, bindings/java, bindings/nodejs, bindings/ocaml, bindings/python, bindings/ruby, bindings/zig

Migration:

  • Assign MinioConfig::endpoint and LakefsS3Config::root a String in place of Some(value). Begin the lakeFS root with a branch or reference, for example dev/data.
  • Set explicit MinIO and R2 endpoints to HTTP(S) base URLs. Supply the bucket and credentials through their own fields. Keep any port and proxy prefix in the base URL and omit any query string or fragment.

AI Usage Statement

  • Pi, magpie/codex/gpt-6.2-sol, max. Implemented and verified the change and drafted the PR. A separate reviewer using the same configuration reviewed the signed commit and checked the MinIO, R2, and generated configuration evidence.
  • Pi, magpie/codex/gpt-6.2-astra, high. Analyzed the preset contracts and scoped the provider evidence.
  • Antigravity, gemini-4-neon, high. Assessed the Rust addressing API and recommended the existing boolean setter convention.
  • Pi, magpie/group/claude-opus-5.5, high. Settled the MinIO setter and its acceptance cases.
  • Pi, magpie/codex/gpt-6.2-astra, xhigh. Set the implementation scope and service verification boundaries.

@Xuanwo
Xuanwo merged commit 380715a into main Dec 4, 2026
152 of 154 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/s3-preset-builder branch December 4, 2026 00:22
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.

refactor(services/s3)!: align R2 and Minio endpoint resolution with preset::Connection::build and harmonize preset configs

2 participants