Skip to content

Conversation

@rescrv
Copy link
Contributor

@rescrv rescrv commented Dec 26, 2025

Description of changes

This PR introduces the types for multi-region, multi-cloud support.

Test plan

CI

Migration plan

Not applicable yet.

Observability plan

N/A

Documentation Changes

N/A

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Dec 26, 2025

It introduces a dedicated topology module in rust/types that defines strongly typed region and topology constructs, wraps multi-cloud configuration data with validation and serde integration, and backs these behaviors with tests to enforce the configuration invariants.

Key Changes

• Add rust/types/src/topology.rs with RegionName, TopologyName, ProviderRegion<T>, Topology, and MultiCloudMultiRegionConfiguration<T> plus validation utilities and serde conversions
• Implement ValidationError reporting with deduplicated duplicate-name and unknown-region tracking and human-readable formatting helpers
• Provide comprehensive unit tests covering constructors, serde round-trips, validation failure scenarios, and error-display formatting
• Expose the new topology module through rust/types/src/lib.rs so consumers can import the types

Affected Areas

rust/types/src/topology.rs
rust/types/src/lib.rs

This summary was automatically generated by @propel-code-bot

@rescrv rescrv requested a review from sanketkedia December 29, 2025 17:41
@rescrv rescrv force-pushed the rescrv/topology-config branch from 9bdda62 to 5ba5807 Compare December 29, 2025 18:03
@rescrv rescrv changed the base branch from main to rescrv/logdb-migrations December 29, 2025 18:03
@rescrv rescrv force-pushed the rescrv/topology-config branch from 26bc4bf to adfd6a8 Compare December 30, 2025 21:46
Comment on lines +1302 to +1305
println!(
"region_name_empty error: {:?}",
result.as_ref().unwrap_err()
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommended

[Maintainability] Consider removing the println! statements from the tests that check for validation errors. They were likely added for debugging and can clutter the CI logs.

This applies to this test and several others that follow the same pattern (e.g., region_name_too_long, region_name_non_ascii, topology_name_empty, etc.).

Context for Agents
Consider removing the `println!` statements from the tests that check for validation errors. They were likely added for debugging and can clutter the CI logs.

This applies to this test and several others that follow the same pattern (e.g., `region_name_too_long`, `region_name_non_ascii`, `topology_name_empty`, etc.).

File: rust/types/src/topology.rs
Line: 1305

@rescrv rescrv force-pushed the rescrv/topology-config branch 2 times, most recently from 038ac2e to ded3a45 Compare December 31, 2025 00:10
@rescrv rescrv force-pushed the rescrv/logdb-migrations branch from d244e1d to f6b3b95 Compare December 31, 2025 01:04
@rescrv rescrv force-pushed the rescrv/topology-config branch from ded3a45 to 82b5763 Compare December 31, 2025 01:05
/// The name of the preferred region for operations with region affinity.
preferred: RegionName,
/// The set of provider regions available in this configuration.
regions: Vec<ProviderRegion<T>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't topologies below already contain the regions? what is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Topologies contains the listing of regions. This is per-region state. So, e.g. we can bind T to a Spanner+Storage config and specify it once per region.

@rescrv rescrv force-pushed the rescrv/logdb-migrations branch from f6b3b95 to a1380cf Compare January 2, 2026 22:21
Base automatically changed from rescrv/logdb-migrations to main January 2, 2026 22:58
@rescrv rescrv force-pushed the rescrv/topology-config branch from 82b5763 to b90737d Compare January 2, 2026 22:59
use thiserror::Error;

/// Maximum length for region and topology names.
const MAX_NAME_LENGTH: usize = 32;
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommended

[Requirements] The MAX_NAME_LENGTH of 32 seems potentially restrictive. While it covers standard cloud provider region names, it might be too short for custom or on-premise deployments where more descriptive names are common. For example, a name like "corporate-datacenter-building-a-rack-5" would exceed this limit.

To provide more flexibility, consider increasing this limit. A value like 64 would align better with common identifier length limits in various systems (e.g., DNS labels are up to 63 characters) and would be less likely to cause issues for users with custom naming schemes.

Context for Agents
The `MAX_NAME_LENGTH` of 32 seems potentially restrictive. While it covers standard cloud provider region names, it might be too short for custom or on-premise deployments where more descriptive names are common. For example, a name like "corporate-datacenter-building-a-rack-5" would exceed this limit.

To provide more flexibility, consider increasing this limit. A value like 64 would align better with common identifier length limits in various systems (e.g., DNS labels are up to 63 characters) and would be less likely to cause issues for users with custom naming schemes.

File: rust/types/src/topology.rs
Line: 87

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm keeping 32 for now as we can always up it.

@rescrv rescrv force-pushed the rescrv/topology-config branch from b90737d to 4052be6 Compare January 6, 2026 17:13
@rescrv rescrv merged commit e138ce6 into main Jan 6, 2026
64 checks passed
@rescrv rescrv deleted the rescrv/topology-config branch January 6, 2026 17:51
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.

3 participants