From 112f70914dbb99736fdfc9fc2e7659968fb784ef Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Sun, 6 Sep 2026 02:24:04 +0800 Subject: [PATCH 1/2] fix(build): scope migration helpers to their features (#7234) * test(odm): keep listing header import test scoped * fix(build): gate GCS-only migration HTTP helpers --- rustfs/src/app/bucket_list_through.rs | 2 +- rustfs/src/on_demand_migration/native_http.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rustfs/src/app/bucket_list_through.rs b/rustfs/src/app/bucket_list_through.rs index 86497e36f..d4004c5bc 100644 --- a/rustfs/src/app/bucket_list_through.rs +++ b/rustfs/src/app/bucket_list_through.rs @@ -38,7 +38,6 @@ use crate::on_demand_migration::{ SourceListRequest, SourceObject, SourcePage, decode_continuation_token, source_list_plan, }; use futures::StreamExt; -use http::HeaderMap; use rustfs_utils::http::{SUFFIX_SOURCE_PROXY_REQUEST, get_header}; use std::sync::Arc; use std::time::Instant; @@ -476,6 +475,7 @@ mod tests { FilterConfig, MAX_LIST_NO_PROGRESS_PAGES, OnDemandMigrationConfig, PathStyle, PolicyConfig, Provider, SourceConfig, SourceCredentials, TlsConfig, }; + use http::HeaderMap; use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt}; diff --git a/rustfs/src/on_demand_migration/native_http.rs b/rustfs/src/on_demand_migration/native_http.rs index ae084d084..9e1507ce1 100644 --- a/rustfs/src/on_demand_migration/native_http.rs +++ b/rustfs/src/on_demand_migration/native_http.rs @@ -133,6 +133,7 @@ impl NativeHttp { self.send_classified(request, error_code_header, false).await } + #[cfg(feature = "gcs")] pub(super) async fn send_object( &self, request: reqwest::Request, @@ -210,6 +211,7 @@ pub(super) async fn read_text(response: reqwest::Response, max_bytes: usize) -> /// Base64 digest (`Content-MD5`, `md5Hash`, `x-goog-hash`) as lowercase hex. /// `None` when the value is not a 16-byte digest, so a CRC32C never passes as /// an MD5. +#[cfg(any(test, feature = "gcs"))] pub(super) fn base64_md5_to_hex(value: &str) -> Option { let raw = base64_simd::STANDARD.decode_to_vec(value.trim().as_bytes()).ok()?; (raw.len() == 16).then(|| faster_hex::hex_string(&raw)) From eb1b17802c6e06f8af692d0f81057baf32689659 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Sun, 6 Sep 2026 02:34:56 +0800 Subject: [PATCH 2/2] test(odm): provide the source region in access fixture (#7235) --- rustfs/src/storage/access.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustfs/src/storage/access.rs b/rustfs/src/storage/access.rs index faa98ad72..223a73383 100644 --- a/rustfs/src/storage/access.rs +++ b/rustfs/src/storage/access.rs @@ -4034,7 +4034,7 @@ mod tests { let enabled_before = sys.is_module_enabled(); sys.set_module_enabled(true); let bucket = format!("odm-capture-failure-{}", uuid::Uuid::new_v4()); - let mut config: crate::on_demand_migration::OnDemandMigrationConfig = serde_json::from_str(r#"{"source":{"provider":"minio","endpoint":"https://source.example.com","bucket":"source","credentials":{"access_key":"test","secret_key":"test"}}}"#).expect("source config"); + let mut config: crate::on_demand_migration::OnDemandMigrationConfig = serde_json::from_str(r#"{"source":{"provider":"minio","endpoint":"https://source.example.com","region":"us-east-1","bucket":"source","credentials":{"access_key":"test","secret_key":"test"}}}"#).expect("source config"); config.policy.list_through = true; sys.apply_for_incarnation(&bucket, uuid::Uuid::new_v4(), Some(&config)).await; let mut get = build_request(