Skip to content

Conversation

@ahelmihudhud
Copy link

…on, including endpoint normalization and adding tests.

Which issue does this PR close?

Closes #2802

Rationale for this change

To proper consistency in creating s3 connection string

What changes are included in this PR?

fix for the path style config handling

How are these changes tested?

manual and test cases

…on, including endpoint normalization and adding tests.
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.31%. Comparing base (f09f8af) to head (016eb55).
⚠️ Report is 715 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2803      +/-   ##
============================================
+ Coverage     56.12%   58.31%   +2.18%     
- Complexity      976     1422     +446     
============================================
  Files           119      162      +43     
  Lines         11743    14145    +2402     
  Branches       2251     2363     +112     
============================================
+ Hits           6591     8248    +1657     
- Misses         4012     4704     +692     
- Partials       1140     1193      +53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…stom endpoints by inserting the bucket as a subdomain and update related tests.

#[test]
fn test_extract_s3_config_custom_endpoint() {
// When path.style.access is not set, it defaults to false (virtual-hosted-style)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// When path.style.access is not set, it defaults to false (virtual-hosted-style)
// When path.style.access is not set, it defaults to false (i.e. virtual-hosted-style=true)

Is this what you mean ?

Copy link
Member

Choose a reason for hiding this comment

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

s3_configs.insert(AmazonS3ConfigKey::Region, region.to_string());
}

// Extract and handle path style access (virtual hosted style)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Extract and handle path style access (virtual hosted style)
// Set 'virtual hosted style' config depending on the value of 'path style access'

I am not sure that it is more clear

fn test_extract_s3_config_path_style_access() {
// Case 1: path.style.access is true -> VirtualHostedStyleRequest should be false
let mut configs = HashMap::new();
configs.insert("fs.s3a.path.style.access".to_string(), "true".to_string());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
configs.insert("fs.s3a.path.style.access".to_string(), "true".to_string());
configs.insert("fs.s3a.path.style.access".to_string(), "tRue".to_string());

to test path_style_access = path_style.to_lowercase() == "true"; (line 174)
Or maybe add a separate test for this.

let rest = &endpoint[protocol_end + 3..]; // "s3.oss-me-central-1.aliyuncs.com" or "s3.oss-me-central-1.aliyuncs.com/path"

// Insert bucket as first subdomain
Some(format!("{protocol}{bucket}.{rest}"))
Copy link
Member

Choose a reason for hiding this comment

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

According to https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html#general-purpose-bucket-names

Bucket names can consist only of lowercase letters, numbers, periods (.), and hyphens (-).

usage of periods (.) in the bucket name would create several subdomains. Is that supported ? Or a check should be added and reported somehow ?!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

virtual_hosted_style_request bad calculation

3 participants