Skip to content

feat(config): refine defaults and improve region handling#1990

Merged
houseme merged 6 commits intomainfrom
feature/set-default-region
Feb 27, 2026
Merged

feat(config): refine defaults and improve region handling#1990
houseme merged 6 commits intomainfrom
feature/set-default-region

Conversation

@houseme
Copy link
Contributor

@houseme houseme commented Feb 27, 2026

  • set default region to us-east-1
  • tighten and clean up related initialization paths

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Summary of Changes

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Additional Notes


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

- set default region to `us-east-1`
- tighten and clean up related initialization paths
Copilot AI review requested due to automatic review settings February 27, 2026 05:48
Copy link
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

Refines RustFS configuration defaults by switching the default region to us-east-1, and cleans up several initialization paths (notifications ARN parsing, KMS setup, and FTP/FTPS address normalization).

Changes:

  • Set the default RUSTFS_REGION constant to us-east-1 and align config parsing to use it as the fallback region.
  • Refactor notification ARN parsing into a shared helper (arn_to_target_id) and adjust notification init region fallback.
  • Refactor KMS initialization into smaller helpers and introduce a shared FTP/FTPS address normalization helper.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
rustfs/src/init.rs Adds helpers for ARN parsing, KMS config/build/start, and FTP/FTPS address normalization; adjusts region fallback behavior.
rustfs/src/config/mod.rs Updates region defaulting comment and ensures region falls back to RUSTFS_REGION.
crates/config/src/constants/app.rs Changes RUSTFS_REGION default from rustfs-global-0 to us-east-1.
Comments suppressed due to low confidence (1)

rustfs/src/init.rs:273

  • configure_and_start_kms() already logs a success message, but the Ok(()) arm logs the same message again, resulting in duplicate info logs. Also, the Err arm says "Failed to configure" even though the helper may fail while starting as well; consider removing the extra info! and adjusting the warning to reflect both configure/start (or just log the error as-is).
            match configure_and_start_kms(&service_manager, persisted_config, "persisted configuration").await {
                Ok(()) => {
                    info!("KMS service configured and started successfully from persisted configuration");
                }
                Err(e) => {
                    warn!("Failed to configure KMS with persisted configuration: {}", e);
                }

Comment on lines 349 to 352
fn spawn_server<S>(server: S, protocol_name: &'static str) -> tokio::sync::broadcast::Sender<()>
where
S: Future<Output = Result<(), Box<dyn std::error::Error>>> + Send + 'static,
{
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

spawn_server uses the Future trait in its bound (S: Future<...>) but Future is not imported or fully qualified in this module, which will fail to compile. Either import std::future::Future (or qualify it) or remove this unused helper and keep the inlined spawn logic in the FTP/FTPS initializers.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improved

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

houseme and others added 3 commits February 27, 2026 14:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: houseme <housemecn@gmail.com>
@houseme houseme merged commit 3433dfa into main Feb 27, 2026
15 checks passed
@houseme houseme deleted the feature/set-default-region branch February 27, 2026 07:02
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.

2 participants