fix(config): allow configuring topo dcs via map, fix pg ssl mode config#4456
Conversation
|
🚅 Deployed to the rivet-pr-4456 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
CLAUDE.mdImportant Domain InformationALWAYS use
The ALWAYS use Never modify an existing published
CommandsBuild Commands# Build all packages in the workspace
cargo build
# Build a specific package
cargo build -p package-name
# Build with release optimizations
cargo build --releaseTest Commands# Run all tests in the workspace
cargo test
# Run tests for a specific package
cargo test -p package-name
# Run a specific test
cargo test test_name
# Run tests with output displayed
cargo test -- --nocaptureDevelopment Commands# Format code (enforced by pre-commit hooks)
# cargo fmt
# DO NOT RUN CARGO FMT AUTOMATICALLY (note for humans: we need to run cargo fmt when everything is merged together and make sure lefthook is working)
# Run linter and fix issues
./scripts/cargo/fix.sh
# Check for linting issues
cargo clippy -- -W warningsDocker Development Environment# Start the development environment with all services
cd docker/dev
docker-compose up -dGit Commands# Use conventional commits with a single-line commit message, no co-author
git commit -m "chore(my-pkg): foo bar"Never push to Dependency Managementpnpm Workspace
SQLite Package
RivetKit Package ResolutionsThe root {
"resolutions": {
"rivetkit": "workspace:*",
"@rivetkit/react": "workspace:*",
"@rivetkit/workflow-engine": "workspace:*",
// ... other @rivetkit/* packages
}
}When adding RivetKit dependencies to examples in {
"dependencies": {
"rivetkit": "*",
"@rivetkit/react": "*"
}
}If you need to add a new Rust DependenciesDocumentation
Code Blocks in Docs
Content FrontmatterDocs (
|
PR ReviewSummary: Two focused fixes -- allow configuring topology datacenters via a hashmap (with backward-compatible list support) and fix the PostgreSQL SSL mode configuration. The Bug: Inverted SSL behavior (breaking change)File: The SSL logic has been inverted in a breaking way. Before: SSL only when Any existing deployment without let pool = if ssl_disabled {
pool_config.create_pool(Some(Runtime::Tokio1), tokio_postgres::NoTls)...
} else if let Some(config) = &config.ssl_config {
// build TLS config from explicit cert paths
...
} else {
pool_config.create_pool(Some(Runtime::Tokio1), tokio_postgres::NoTls)...
};Bug: DSN-format connection strings not handled for SSL checkFile:
Bug: Test helper sets
|
f301f2d to
f07072d
Compare
f07072d to
ea5642d
Compare
8ee527a to
5c55237
Compare
|
This PR makes two main changes:
Bug: Programmatic Datacenter creation in tests sets name on map entries In engine/packages/test-deps/src/lib.rs, Datacenter is inserted into a HashMap with the name field explicitly set. But the validation in engine/packages/config/src/config/mod.rs rejects map entries where name is non-empty. Both the test-deps setup and Default::default() for Topology create Datacenter values in the map with name already populated, which would fail this check if validate() is called on them. Programmatic map construction should use name: String::new() to let validation populate it, or validation should only run on deserialized user configs, not programmatically constructed configs. Behavioral Change: SSL Logic Inversion The SSL logic has been inverted in engine/packages/universaldb/src/driver/postgres/database.rs:
This is a silent breaking change for existing deployments that do not have ssl_config configured and also do not have sslmode=disable in their connection strings. They would now unexpectedly attempt TLS. This should be explicitly called out with migration notes. Non-deterministic HashMap Ordering DatacentersRepr::Map uses HashMap which has non-deterministic iteration order. Fine for the concurrent health fanout, but callers that need stable ordering should consider IndexMap or BTreeMap. Missing Runtime Deprecation Warning The list format is marked Deprecated in doc comments and JSON schema, but no runtime warning is emitted when a config using the list format is loaded. A tracing::warn! in the validation branch for List would help operators discover the deprecation. Minor: Error Message The validation error shows dc.name (the value) but not the map key. Including the key would make the error more actionable. Positive Observations
Generated by Claude Code |
PR Review: fix(config): allow configuring topo dcs via map, fix pg ssl mode configSummaryThis PR introduces a map-based representation for datacenter topology configuration (while keeping the deprecated list format for backward compatibility), and fixes the Postgres SSL mode configuration to respect Bugs1. Test deps set
|
ea5642d to
f6c3742
Compare
5c55237 to
876713f
Compare
876713f to
3bf4304
Compare
f6c3742 to
10c9ce3
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: