From 60f729836103d1f8cba40007ea616c697882bda4 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Fri, 31 Oct 2025 11:46:31 -0700 Subject: [PATCH 1/5] [bfops/fix-nuget-smoketests]: Rebase PR --- smoketests/tests/quickstart.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/smoketests/tests/quickstart.py b/smoketests/tests/quickstart.py index fdcf3b7a4e5..0d729f2f2d2 100644 --- a/smoketests/tests/quickstart.py +++ b/smoketests/tests/quickstart.py @@ -301,6 +301,19 @@ def sdk_setup(self, path: Path): source_dir=(STDB_DIR / "crates/bindings-csharp/BSATN.Runtime").absolute(), build_subdir="bin/Release" ) + # This one is only needed because the regression-tests subdir uses it + override_nuget_package( + project_dir=STDB_DIR/"sdks/csharp", + package="SpacetimeDB.Runtime", + source_dir=(STDB_DIR / "crates/bindings-csharp/Runtime").absolute(), + build_subdir="bin/Release" + ) + override_nuget_package( + project_dir=path, + package="SpacetimeDB.BSATN.Runtime", + source_dir=(STDB_DIR / "crates/bindings-csharp/BSATN.Runtime").absolute(), + build_subdir="bin/Release" + ) override_nuget_package( project_dir=path, package="SpacetimeDB.ClientSDK", @@ -316,6 +329,12 @@ def server_postprocess(self, server_path: Path): source_dir=(STDB_DIR / "crates/bindings-csharp/Runtime").absolute(), build_subdir="bin/Release" ) + override_nuget_package( + project_dir=server_path, + package="SpacetimeDB.BSATN.Runtime", + source_dir=(STDB_DIR / "crates/bindings-csharp/BSATN.Runtime").absolute(), + build_subdir="bin/Release" + ) def test_quickstart(self): """Run the C# quickstart guides for server and client.""" From 747b2404cf3304b5ae29bae1698af4900ff54cf1 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Fri, 31 Oct 2025 11:48:00 -0700 Subject: [PATCH 2/5] [bfops/bump-versions]: Bump versions to 1.7.0 --- Cargo.lock | 306 +++++++++--------- Cargo.toml | 66 ++-- LICENSE.txt | 4 +- .../BSATN.Codegen/BSATN.Codegen.csproj | 2 +- .../BSATN.Runtime/BSATN.Runtime.csproj | 2 +- crates/bindings-csharp/Codegen/Codegen.csproj | 2 +- crates/bindings-csharp/Runtime/Runtime.csproj | 2 +- .../src/module_bindings/index.ts | 2 +- crates/bindings-typescript/package.json | 2 +- .../project/typescript/package._json | 2 +- .../basic-c-sharp/server/StdbModule.csproj | 2 +- .../templates/basic-rust/client/Cargo.toml | 2 +- .../templates/basic-rust/server/Cargo.toml | 2 +- .../server-csharp/StdbModule.csproj | 2 +- licenses/BSL.txt | 4 +- sdks/csharp/SpacetimeDB.ClientSDK.csproj | 6 +- .../quickstart-chat/server/StdbModule.csproj | 2 +- .../regression-tests/server/StdbModule.csproj | 2 +- sdks/csharp/package.json | 2 +- 19 files changed, 207 insertions(+), 207 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed929d1e017..c2d03fb6b56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -443,7 +443,7 @@ name = "benchmarks-module" version = "0.1.0" dependencies = [ "anyhow", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] @@ -1072,7 +1072,7 @@ dependencies = [ [[package]] name = "connect_disconnect_client" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "spacetimedb-sdk", @@ -3420,7 +3420,7 @@ name = "keynote-benchmarks" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] @@ -3800,7 +3800,7 @@ version = "0.0.0" dependencies = [ "anyhow", "log", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] @@ -4893,7 +4893,7 @@ name = "perf-test-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] @@ -5445,7 +5445,7 @@ name = "quickstart-chat-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] @@ -6535,12 +6535,12 @@ dependencies = [ "anyhow", "log", "paste", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] name = "sdk-unreal-test-harness" -version = "1.6.0" +version = "1.7.0" dependencies = [ "serial_test", "spacetimedb-testing", @@ -6974,61 +6974,61 @@ name = "spacetime-module" version = "0.1.0" dependencies = [ "log", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] name = "spacetimedb" version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8679cf54a7a653e6bc612bef28c219f98b9274308d8aae1e86046ed685db48b1" dependencies = [ "bytemuck", "derive_more 0.99.20", "getrandom 0.2.16", - "insta", "log", "rand 0.8.5", "scoped-tls", - "serde_json", "spacetimedb-bindings-macro 1.6.0", "spacetimedb-bindings-sys 1.6.0", "spacetimedb-lib 1.6.0", "spacetimedb-primitives 1.6.0", - "trybuild", ] [[package]] name = "spacetimedb" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8679cf54a7a653e6bc612bef28c219f98b9274308d8aae1e86046ed685db48b1" +version = "1.7.0" dependencies = [ "bytemuck", "derive_more 0.99.20", "getrandom 0.2.16", + "insta", "log", "rand 0.8.5", "scoped-tls", - "spacetimedb-bindings-macro 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spacetimedb-bindings-sys 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spacetimedb-lib 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spacetimedb-primitives 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json", + "spacetimedb-bindings-macro 1.7.0", + "spacetimedb-bindings-sys 1.7.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", + "trybuild", ] [[package]] name = "spacetimedb-auth" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "serde", "serde_json", "serde_with", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", ] [[package]] name = "spacetimedb-bench" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "anymap", @@ -7056,11 +7056,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-execution", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-paths", - "spacetimedb-primitives 1.6.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-query", - "spacetimedb-sats 1.6.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "spacetimedb-standalone", "spacetimedb-table", @@ -7076,6 +7076,8 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a930242493f5c875ab96903eb40fb6a90c4d3ae99597fd51da569ff22769a03" dependencies = [ "heck 0.4.1", "humantime", @@ -7087,37 +7089,35 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a930242493f5c875ab96903eb40fb6a90c4d3ae99597fd51da569ff22769a03" +version = "1.7.0" dependencies = [ "heck 0.4.1", "humantime", "proc-macro2", "quote", - "spacetimedb-primitives 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spacetimedb-primitives 1.7.0", "syn 2.0.107", ] [[package]] name = "spacetimedb-bindings-sys" version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e565dfcdd2dc3f58e0178052ec1c8ce710b013482d4fa50b511ba786a2c3bc68" dependencies = [ "spacetimedb-primitives 1.6.0", ] [[package]] name = "spacetimedb-bindings-sys" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e565dfcdd2dc3f58e0178052ec1c8ce710b013482d4fa50b511ba786a2c3bc68" +version = "1.7.0" dependencies = [ - "spacetimedb-primitives 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spacetimedb-primitives 1.7.0", ] [[package]] name = "spacetimedb-cli" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "base64 0.21.7", @@ -7160,9 +7160,9 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-paths", - "spacetimedb-primitives 1.6.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-schema", "syntect", "tabled", @@ -7186,7 +7186,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "async-stream", @@ -7223,7 +7223,7 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-datastore", "spacetimedb-jsonwebtoken", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-paths", "spacetimedb-schema", "tempfile", @@ -7240,7 +7240,7 @@ dependencies = [ [[package]] name = "spacetimedb-client-api-messages" -version = "1.6.0" +version = "1.7.0" dependencies = [ "bytes", "bytestring", @@ -7254,16 +7254,16 @@ dependencies = [ "serde_json", "serde_with", "smallvec", - "spacetimedb-lib 1.6.0", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "strum", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-codegen" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7272,15 +7272,15 @@ dependencies = [ "itertools 0.12.1", "regex", "spacetimedb-data-structures", - "spacetimedb-lib 1.6.0", - "spacetimedb-primitives 1.6.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-schema", "spacetimedb-testing", ] [[package]] name = "spacetimedb-commitlog" -version = "1.6.0" +version = "1.7.0" dependencies = [ "async-stream", "bitflags 2.10.0", @@ -7300,8 +7300,8 @@ dependencies = [ "spacetimedb-commitlog", "spacetimedb-fs-utils", "spacetimedb-paths", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "tempfile", "thiserror 1.0.69", "tokio", @@ -7312,7 +7312,7 @@ dependencies = [ [[package]] name = "spacetimedb-core" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "arrayvec", @@ -7392,14 +7392,14 @@ dependencies = [ "spacetimedb-fs-utils", "spacetimedb-jsonwebtoken", "spacetimedb-jwks", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-memory-usage", "spacetimedb-metrics", "spacetimedb-paths", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.6.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-query", - "spacetimedb-sats 1.6.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-subscription", @@ -7434,7 +7434,7 @@ dependencies = [ [[package]] name = "spacetimedb-data-structures" -version = "1.6.0" +version = "1.7.0" dependencies = [ "ahash 0.8.12", "crossbeam-queue", @@ -7448,7 +7448,7 @@ dependencies = [ [[package]] name = "spacetimedb-datastore" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "bytes", @@ -7468,11 +7468,11 @@ dependencies = [ "spacetimedb-data-structures", "spacetimedb-durability", "spacetimedb-execution", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-metrics", "spacetimedb-paths", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "spacetimedb-snapshot", "spacetimedb-table", @@ -7483,14 +7483,14 @@ dependencies = [ [[package]] name = "spacetimedb-durability" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "itertools 0.12.1", "log", "spacetimedb-commitlog", "spacetimedb-paths", - "spacetimedb-sats 1.6.0", + "spacetimedb-sats 1.7.0", "thiserror 1.0.69", "tokio", "tracing", @@ -7498,32 +7498,32 @@ dependencies = [ [[package]] name = "spacetimedb-execution" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "itertools 0.12.1", "spacetimedb-expr", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-sql-parser", "spacetimedb-table", ] [[package]] name = "spacetimedb-expr" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "bigdecimal", "derive_more 0.99.20", "ethnum", "pretty_assertions", - "spacetimedb 1.6.0", - "spacetimedb-lib 1.6.0", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb 1.7.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "spacetimedb-sql-parser", "thiserror 1.0.69", @@ -7531,7 +7531,7 @@ dependencies = [ [[package]] name = "spacetimedb-fs-utils" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "hex", @@ -7574,26 +7574,18 @@ dependencies = [ [[package]] name = "spacetimedb-lib" version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba57c8f1983bb144ee7e1ff28aa5882ca437f67c14a14daad4bf61d31f7040d" dependencies = [ "anyhow", "bitflags 2.10.0", "blake3", - "bytes", "chrono", "derive_more 0.99.20", "enum-as-inner", - "enum-map", "hex", - "insta", "itertools 0.12.1", - "proptest", - "proptest-derive", - "ron", - "serde", - "serde_json", "spacetimedb-bindings-macro 1.6.0", - "spacetimedb-memory-usage", - "spacetimedb-metrics", "spacetimedb-primitives 1.6.0", "spacetimedb-sats 1.6.0", "thiserror 1.0.69", @@ -7601,27 +7593,35 @@ dependencies = [ [[package]] name = "spacetimedb-lib" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba57c8f1983bb144ee7e1ff28aa5882ca437f67c14a14daad4bf61d31f7040d" +version = "1.7.0" dependencies = [ "anyhow", "bitflags 2.10.0", "blake3", + "bytes", "chrono", "derive_more 0.99.20", "enum-as-inner", + "enum-map", "hex", + "insta", "itertools 0.12.1", - "spacetimedb-bindings-macro 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spacetimedb-primitives 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spacetimedb-sats 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proptest", + "proptest-derive", + "ron", + "serde", + "serde_json", + "spacetimedb-bindings-macro 1.7.0", + "spacetimedb-memory-usage", + "spacetimedb-metrics", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-memory-usage" -version = "1.6.0" +version = "1.7.0" dependencies = [ "decorum", "ethnum", @@ -7631,7 +7631,7 @@ dependencies = [ [[package]] name = "spacetimedb-metrics" -version = "1.6.0" +version = "1.7.0" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -7641,7 +7641,7 @@ dependencies = [ [[package]] name = "spacetimedb-paths" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "chrono", @@ -7657,7 +7657,7 @@ dependencies = [ [[package]] name = "spacetimedb-pg" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "async-trait", @@ -7668,22 +7668,22 @@ dependencies = [ "pgwire", "spacetimedb-client-api", "spacetimedb-client-api-messages", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "thiserror 1.0.69", "tokio", ] [[package]] name = "spacetimedb-physical-plan" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "derive_more 0.99.20", "either", "pretty_assertions", "spacetimedb-expr", - "spacetimedb-lib 1.6.0", - "spacetimedb-primitives 1.6.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-schema", "spacetimedb-sql-parser", "spacetimedb-table", @@ -7692,31 +7692,31 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dcd64c6970ca59e7b71e51952cf1a71bae2652b1eb736c19a7e528f3874894a" dependencies = [ "bitflags 2.10.0", "either", - "enum-as-inner", "itertools 0.12.1", "nohash-hasher", - "proptest", - "spacetimedb-memory-usage", ] [[package]] name = "spacetimedb-primitives" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dcd64c6970ca59e7b71e51952cf1a71bae2652b1eb736c19a7e528f3874894a" +version = "1.7.0" dependencies = [ "bitflags 2.10.0", "either", + "enum-as-inner", "itertools 0.12.1", "nohash-hasher", + "proptest", + "spacetimedb-memory-usage", ] [[package]] name = "spacetimedb-query" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "itertools 0.12.1", @@ -7724,9 +7724,9 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.6.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-sql-parser", "spacetimedb-table", ] @@ -7734,15 +7734,14 @@ dependencies = [ [[package]] name = "spacetimedb-sats" version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae61d8f88bda21f56c143bc9b4ddc20100ff08ae4fed0b9444509f7c3ca4339" dependencies = [ - "ahash 0.8.12", "anyhow", "arrayvec", "bitflags 2.10.0", - "blake3", "bytemuck", "bytes", - "bytestring", "chrono", "decorum", "derive_more 0.99.20", @@ -7750,32 +7749,26 @@ dependencies = [ "ethnum", "hex", "itertools 0.12.1", - "proptest", - "proptest-derive", - "rand 0.9.2", "second-stack", - "serde", - "serde_json", "sha3", "smallvec", "spacetimedb-bindings-macro 1.6.0", - "spacetimedb-memory-usage", - "spacetimedb-metrics", "spacetimedb-primitives 1.6.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-sats" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae61d8f88bda21f56c143bc9b4ddc20100ff08ae4fed0b9444509f7c3ca4339" +version = "1.7.0" dependencies = [ + "ahash 0.8.12", "anyhow", "arrayvec", "bitflags 2.10.0", + "blake3", "bytemuck", "bytes", + "bytestring", "chrono", "decorum", "derive_more 0.99.20", @@ -7783,17 +7776,24 @@ dependencies = [ "ethnum", "hex", "itertools 0.12.1", + "proptest", + "proptest-derive", + "rand 0.9.2", "second-stack", + "serde", + "serde_json", "sha3", "smallvec", - "spacetimedb-bindings-macro 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spacetimedb-primitives 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spacetimedb-bindings-macro 1.7.0", + "spacetimedb-memory-usage", + "spacetimedb-metrics", + "spacetimedb-primitives 1.7.0", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-schema" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "derive_more 0.99.20", @@ -7810,9 +7810,9 @@ dependencies = [ "serial_test", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib 1.6.0", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-sql-parser", "spacetimedb-testing", "termcolor", @@ -7823,7 +7823,7 @@ dependencies = [ [[package]] name = "spacetimedb-sdk" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anymap", "base64 0.21.7", @@ -7842,9 +7842,9 @@ dependencies = [ "rand 0.9.2", "spacetimedb-client-api-messages", "spacetimedb-data-structures", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-metrics", - "spacetimedb-sats 1.6.0", + "spacetimedb-sats 1.7.0", "spacetimedb-testing", "thiserror 1.0.69", "tokio", @@ -7853,7 +7853,7 @@ dependencies = [ [[package]] name = "spacetimedb-snapshot" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "blake3", @@ -7870,10 +7870,10 @@ dependencies = [ "spacetimedb-datastore", "spacetimedb-durability", "spacetimedb-fs-utils", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-paths", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -7886,17 +7886,17 @@ dependencies = [ [[package]] name = "spacetimedb-sql-parser" -version = "1.6.0" +version = "1.7.0" dependencies = [ "derive_more 0.99.20", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "sqlparser", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-standalone" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "async-trait", @@ -7920,7 +7920,7 @@ dependencies = [ "spacetimedb-client-api-messages", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-paths", "spacetimedb-pg", "spacetimedb-schema", @@ -7937,20 +7937,20 @@ dependencies = [ [[package]] name = "spacetimedb-subscription" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "spacetimedb-execution", "spacetimedb-expr", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-physical-plan", - "spacetimedb-primitives 1.6.0", + "spacetimedb-primitives 1.7.0", "spacetimedb-query", ] [[package]] name = "spacetimedb-table" -version = "1.6.0" +version = "1.7.0" dependencies = [ "ahash 0.8.12", "blake3", @@ -7966,17 +7966,17 @@ dependencies = [ "rand 0.9.2", "smallvec", "spacetimedb-data-structures", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-memory-usage", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "thiserror 1.0.69", ] [[package]] name = "spacetimedb-testing" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "clap 4.5.50", @@ -7992,7 +7992,7 @@ dependencies = [ "spacetimedb-client-api", "spacetimedb-core", "spacetimedb-data-structures", - "spacetimedb-lib 1.6.0", + "spacetimedb-lib 1.7.0", "spacetimedb-paths", "spacetimedb-schema", "spacetimedb-standalone", @@ -8003,7 +8003,7 @@ dependencies = [ [[package]] name = "spacetimedb-update" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "bytes", @@ -8028,7 +8028,7 @@ dependencies = [ [[package]] name = "spacetimedb-vm" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "arrayvec", @@ -8038,9 +8038,9 @@ dependencies = [ "smallvec", "spacetimedb-data-structures", "spacetimedb-execution", - "spacetimedb-lib 1.6.0", - "spacetimedb-primitives 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-primitives 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-schema", "spacetimedb-table", "tempfile", @@ -8119,7 +8119,7 @@ dependencies = [ [[package]] name = "sqltest" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "async-trait", @@ -8138,8 +8138,8 @@ dependencies = [ "rust_decimal", "spacetimedb-core", "spacetimedb-datastore", - "spacetimedb-lib 1.6.0", - "spacetimedb-sats 1.6.0", + "spacetimedb-lib 1.7.0", + "spacetimedb-sats 1.7.0", "spacetimedb-vm", "sqllogictest", "sqllogictest-engines", @@ -8513,7 +8513,7 @@ dependencies = [ [[package]] name = "test-client" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "env_logger 0.10.2", @@ -8525,7 +8525,7 @@ dependencies = [ [[package]] name = "test-counter" -version = "1.6.0" +version = "1.7.0" dependencies = [ "anyhow", "spacetimedb-data-structures", @@ -9244,7 +9244,7 @@ version = "0.1.0" dependencies = [ "anyhow", "log", - "spacetimedb 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spacetimedb 1.6.0", ] [[package]] @@ -9253,7 +9253,7 @@ version = "0.1.0" dependencies = [ "anyhow", "log", - "spacetimedb 1.6.0", + "spacetimedb 1.7.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 5bb1d180aed..d1dc2344c4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,44 +89,44 @@ inherits = "release" debug = true [workspace.package] -version = "1.6.0" +version = "1.7.0" edition = "2021" # update rust-toolchain.toml too! rust-version = "1.90.0" [workspace.dependencies] -spacetimedb = { path = "crates/bindings", version = "=1.6.0" } -spacetimedb-auth = { path = "crates/auth", version = "=1.6.0" } -spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "=1.6.0" } -spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "=1.6.0" } -spacetimedb-cli = { path = "crates/cli", version = "=1.6.0" } -spacetimedb-client-api = { path = "crates/client-api", version = "=1.6.0" } -spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "=1.6.0" } -spacetimedb-codegen = { path = "crates/codegen", version = "=1.6.0" } -spacetimedb-commitlog = { path = "crates/commitlog", version = "=1.6.0" } -spacetimedb-core = { path = "crates/core", version = "=1.6.0" } -spacetimedb-data-structures = { path = "crates/data-structures", version = "=1.6.0" } -spacetimedb-datastore = { path = "crates/datastore", version = "=1.6.0" } -spacetimedb-durability = { path = "crates/durability", version = "=1.6.0" } -spacetimedb-execution = { path = "crates/execution", version = "=1.6.0" } -spacetimedb-expr = { path = "crates/expr", version = "=1.6.0" } -spacetimedb-lib = { path = "crates/lib", default-features = false, version = "=1.6.0" } -spacetimedb-memory-usage = { path = "crates/memory-usage", version = "=1.6.0", default-features = false } -spacetimedb-metrics = { path = "crates/metrics", version = "=1.6.0" } -spacetimedb-paths = { path = "crates/paths", version = "=1.6.0" } -spacetimedb-pg = { path = "crates/pg", version = "=1.6.0" } -spacetimedb-physical-plan = { path = "crates/physical-plan", version = "=1.6.0" } -spacetimedb-primitives = { path = "crates/primitives", version = "=1.6.0" } -spacetimedb-query = { path = "crates/query", version = "=1.6.0" } -spacetimedb-sats = { path = "crates/sats", version = "=1.6.0" } -spacetimedb-schema = { path = "crates/schema", version = "=1.6.0" } -spacetimedb-standalone = { path = "crates/standalone", version = "=1.6.0" } -spacetimedb-sql-parser = { path = "crates/sql-parser", version = "=1.6.0" } -spacetimedb-table = { path = "crates/table", version = "=1.6.0" } -spacetimedb-vm = { path = "crates/vm", version = "=1.6.0" } -spacetimedb-fs-utils = { path = "crates/fs-utils", version = "=1.6.0" } -spacetimedb-snapshot = { path = "crates/snapshot", version = "=1.6.0" } -spacetimedb-subscription = { path = "crates/subscription", version = "=1.6.0" } +spacetimedb = { path = "crates/bindings", version = "=1.7.0" } +spacetimedb-auth = { path = "crates/auth", version = "=1.7.0" } +spacetimedb-bindings-macro = { path = "crates/bindings-macro", version = "=1.7.0" } +spacetimedb-bindings-sys = { path = "crates/bindings-sys", version = "=1.7.0" } +spacetimedb-cli = { path = "crates/cli", version = "=1.7.0" } +spacetimedb-client-api = { path = "crates/client-api", version = "=1.7.0" } +spacetimedb-client-api-messages = { path = "crates/client-api-messages", version = "=1.7.0" } +spacetimedb-codegen = { path = "crates/codegen", version = "=1.7.0" } +spacetimedb-commitlog = { path = "crates/commitlog", version = "=1.7.0" } +spacetimedb-core = { path = "crates/core", version = "=1.7.0" } +spacetimedb-data-structures = { path = "crates/data-structures", version = "=1.7.0" } +spacetimedb-datastore = { path = "crates/datastore", version = "=1.7.0" } +spacetimedb-durability = { path = "crates/durability", version = "=1.7.0" } +spacetimedb-execution = { path = "crates/execution", version = "=1.7.0" } +spacetimedb-expr = { path = "crates/expr", version = "=1.7.0" } +spacetimedb-lib = { path = "crates/lib", default-features = false, version = "=1.7.0" } +spacetimedb-memory-usage = { path = "crates/memory-usage", version = "=1.7.0", default-features = false } +spacetimedb-metrics = { path = "crates/metrics", version = "=1.7.0" } +spacetimedb-paths = { path = "crates/paths", version = "=1.7.0" } +spacetimedb-pg = { path = "crates/pg", version = "=1.7.0" } +spacetimedb-physical-plan = { path = "crates/physical-plan", version = "=1.7.0" } +spacetimedb-primitives = { path = "crates/primitives", version = "=1.7.0" } +spacetimedb-query = { path = "crates/query", version = "=1.7.0" } +spacetimedb-sats = { path = "crates/sats", version = "=1.7.0" } +spacetimedb-schema = { path = "crates/schema", version = "=1.7.0" } +spacetimedb-standalone = { path = "crates/standalone", version = "=1.7.0" } +spacetimedb-sql-parser = { path = "crates/sql-parser", version = "=1.7.0" } +spacetimedb-table = { path = "crates/table", version = "=1.7.0" } +spacetimedb-vm = { path = "crates/vm", version = "=1.7.0" } +spacetimedb-fs-utils = { path = "crates/fs-utils", version = "=1.7.0" } +spacetimedb-snapshot = { path = "crates/snapshot", version = "=1.7.0" } +spacetimedb-subscription = { path = "crates/subscription", version = "=1.7.0" } # Prevent `ahash` from pulling in `getrandom` by disabling default features. # Modules use `getrandom02` and we need to prevent an incompatible version diff --git a/LICENSE.txt b/LICENSE.txt index 8471788dae9..40f9d2c9477 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -5,7 +5,7 @@ Business Source License 1.1 Parameters Licensor: Clockwork Laboratories, Inc. -Licensed Work: SpacetimeDB 1.6.0 +Licensed Work: SpacetimeDB 1.7.0 The Licensed Work is (c) 2023 Clockwork Laboratories, Inc. @@ -21,7 +21,7 @@ Additional Use Grant: You may make use of the Licensed Work provided your Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2030-10-15 +Change Date: 2030-10-31 Change License: GNU Affero General Public License v3.0 with a linking exception diff --git a/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj b/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj index d7c8b7aeeec..5784a4da6be 100644 --- a/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj +++ b/crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj @@ -2,7 +2,7 @@ SpacetimeDB.BSATN.Codegen - 1.6.0 + 1.7.0 SpacetimeDB BSATN Codegen The SpacetimeDB BSATN Codegen implements the Roslyn incremental generators for BSATN serialization/deserialization in C#. diff --git a/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj b/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj index c4c991b73c3..97f12a6bfef 100644 --- a/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj +++ b/crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj @@ -2,7 +2,7 @@ SpacetimeDB.BSATN.Runtime - 1.6.0 + 1.7.0 SpacetimeDB BSATN Runtime The SpacetimeDB BSATN Runtime implements APIs for BSATN serialization/deserialization in C#. true diff --git a/crates/bindings-csharp/Codegen/Codegen.csproj b/crates/bindings-csharp/Codegen/Codegen.csproj index 33a6772f134..aedc4de1c9b 100644 --- a/crates/bindings-csharp/Codegen/Codegen.csproj +++ b/crates/bindings-csharp/Codegen/Codegen.csproj @@ -2,7 +2,7 @@ SpacetimeDB.Codegen - 1.6.0 + 1.7.0 SpacetimeDB Module Codegen The SpacetimeDB Codegen implements the Roslyn incremental generators for writing SpacetimeDB modules in C#. diff --git a/crates/bindings-csharp/Runtime/Runtime.csproj b/crates/bindings-csharp/Runtime/Runtime.csproj index 00a5bc43391..5e68bff2729 100644 --- a/crates/bindings-csharp/Runtime/Runtime.csproj +++ b/crates/bindings-csharp/Runtime/Runtime.csproj @@ -2,7 +2,7 @@ SpacetimeDB.Runtime - 1.6.0 + 1.7.0 SpacetimeDB Module Runtime The SpacetimeDB Runtime implements the database runtime bindings for writing SpacetimeDB modules in C#. diff --git a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts index f30b1c1253b..89a6af89230 100644 --- a/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts +++ b/crates/bindings-typescript/examples/quickstart-chat/src/module_bindings/index.ts @@ -89,7 +89,7 @@ const REMOTE_MODULE = { }, }, versionInfo: { - cliVersion: '1.6.0', + cliVersion: '1.7.0', }, // Constructors which are used by the DbConnectionImpl to // extract type information from the generated RemoteModule. diff --git a/crates/bindings-typescript/package.json b/crates/bindings-typescript/package.json index b1dd6daf6a9..74217fac8e8 100644 --- a/crates/bindings-typescript/package.json +++ b/crates/bindings-typescript/package.json @@ -1,6 +1,6 @@ { "name": "spacetimedb", - "version": "1.6.2", + "version": "1.7.0", "description": "API and ABI bindings for the SpacetimeDB TypeScript module library", "homepage": "https://github.com/clockworklabs/SpacetimeDB#readme", "bugs": { diff --git a/crates/cli/src/subcommands/project/typescript/package._json b/crates/cli/src/subcommands/project/typescript/package._json index 47be347a920..9af76d05094 100644 --- a/crates/cli/src/subcommands/project/typescript/package._json +++ b/crates/cli/src/subcommands/project/typescript/package._json @@ -10,6 +10,6 @@ "author": "", "license": "ISC", "dependencies": { - "spacetimedb": "1.6.*" + "spacetimedb": "1.7.*" } } \ No newline at end of file diff --git a/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj b/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj index 4a504b099c8..6121a5ae7f9 100644 --- a/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj +++ b/crates/cli/templates/basic-c-sharp/server/StdbModule.csproj @@ -8,7 +8,7 @@ - + diff --git a/crates/cli/templates/basic-rust/client/Cargo.toml b/crates/cli/templates/basic-rust/client/Cargo.toml index 35168a60fd8..56befed5f8a 100644 --- a/crates/cli/templates/basic-rust/client/Cargo.toml +++ b/crates/cli/templates/basic-rust/client/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -spacetimedb-sdk = "1.6.*" +spacetimedb-sdk = "1.7.*" diff --git a/crates/cli/templates/basic-rust/server/Cargo.toml b/crates/cli/templates/basic-rust/server/Cargo.toml index dfbc3a9823e..417cc88be6c 100644 --- a/crates/cli/templates/basic-rust/server/Cargo.toml +++ b/crates/cli/templates/basic-rust/server/Cargo.toml @@ -9,5 +9,5 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -spacetimedb = "1.6.*" +spacetimedb = "1.7.*" log = "0.4" diff --git a/demo/Blackholio/server-csharp/StdbModule.csproj b/demo/Blackholio/server-csharp/StdbModule.csproj index 60c71d74247..eea7fcc05cb 100644 --- a/demo/Blackholio/server-csharp/StdbModule.csproj +++ b/demo/Blackholio/server-csharp/StdbModule.csproj @@ -13,7 +13,7 @@ - + diff --git a/licenses/BSL.txt b/licenses/BSL.txt index 8058a776b49..758ef4e8948 100644 --- a/licenses/BSL.txt +++ b/licenses/BSL.txt @@ -5,7 +5,7 @@ Business Source License 1.1 Parameters Licensor: Clockwork Laboratories, Inc. -Licensed Work: SpacetimeDB 1.6.0 +Licensed Work: SpacetimeDB 1.7.0 The Licensed Work is (c) 2023 Clockwork Laboratories, Inc. @@ -21,7 +21,7 @@ Additional Use Grant: You may make use of the Licensed Work provided your Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2030-10-15 +Change Date: 2030-10-31 Change License: GNU Affero General Public License v3.0 with a linking exception diff --git a/sdks/csharp/SpacetimeDB.ClientSDK.csproj b/sdks/csharp/SpacetimeDB.ClientSDK.csproj index b7f81755e20..f1f24620b2f 100644 --- a/sdks/csharp/SpacetimeDB.ClientSDK.csproj +++ b/sdks/csharp/SpacetimeDB.ClientSDK.csproj @@ -16,8 +16,8 @@ logo.png README.md https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk - 1.6.0 - 1.6.0 + 1.7.0 + 1.7.0 $(DefaultItemExcludes);*~/** packages @@ -25,7 +25,7 @@ - + diff --git a/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj b/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj index 12710df0560..beac8e96f64 100644 --- a/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj +++ b/sdks/csharp/examples~/quickstart-chat/server/StdbModule.csproj @@ -14,7 +14,7 @@ - + diff --git a/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj b/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj index 4a504b099c8..6121a5ae7f9 100644 --- a/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj +++ b/sdks/csharp/examples~/regression-tests/server/StdbModule.csproj @@ -8,7 +8,7 @@ - + diff --git a/sdks/csharp/package.json b/sdks/csharp/package.json index 3219e255131..68dfccff873 100644 --- a/sdks/csharp/package.json +++ b/sdks/csharp/package.json @@ -1,7 +1,7 @@ { "name": "com.clockworklabs.spacetimedbsdk", "displayName": "SpacetimeDB SDK", - "version": "1.6.0", + "version": "1.7.0", "description": "The SpacetimeDB Client SDK is a software development kit (SDK) designed to interact with and manipulate SpacetimeDB modules..", "keywords": [], "author": { From 51c64fbab318c35ce6850985e80ed51130059aab Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Mon, 3 Nov 2025 11:28:37 -0500 Subject: [PATCH 3/5] Set default server to `local` in replication smoketests --- smoketests/tests/replication.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smoketests/tests/replication.py b/smoketests/tests/replication.py index 5fd1e24a03b..fac348936c2 100644 --- a/smoketests/tests/replication.py +++ b/smoketests/tests/replication.py @@ -234,12 +234,16 @@ def tearDown(self): # TODO: This function seems to run even when `--docker` is not passed, leading to errors unless `-x replication` is passed, due to the docker-related code below. def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.set_default_server() self.docker = DockerManager(COMPOSE_FILE) self.root_token = self.docker.generate_root_token() self.cluster = Cluster(self.docker, self) + def set_default_server(self): + spacetime("--config-path", self.root_config, "server", "set-default", "local") + def add_me_as_admin(self): """Add the current user as an admin account""" db_owner_id = str(self.spacetime("login", "show")).split()[-1] From c00e913ded835f3af12feacf488edbc4cce6b24a Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 3 Nov 2025 11:53:05 -0800 Subject: [PATCH 4/5] [phoebe/replication-smoketests-default-server]: try fix? --- smoketests/tests/quickstart.py.orig | 324 ++++++++++++++++++++++++++++ smoketests/tests/replication.py | 5 +- 2 files changed, 325 insertions(+), 4 deletions(-) create mode 100644 smoketests/tests/quickstart.py.orig diff --git a/smoketests/tests/quickstart.py.orig b/smoketests/tests/quickstart.py.orig new file mode 100644 index 00000000000..fdcf3b7a4e5 --- /dev/null +++ b/smoketests/tests/quickstart.py.orig @@ -0,0 +1,324 @@ +import logging +import re +import shutil +from pathlib import Path +import tempfile +import xmltodict + +import smoketests +from .. import Smoketest, STDB_DIR, run_cmd, TEMPLATE_CARGO_TOML + + +def _write_file(path: Path, content: str): + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(content) + + +def _append_to_file(path: Path, content: str): + with open(path, "a", encoding="utf-8") as f: + f.write(content) + + +def _parse_quickstart(doc_path: Path, language: str) -> str: + """Extract code blocks from `quickstart.md` docs. + This will replicate the steps in the quickstart guide, so if it fails the quickstart guide is broken. + """ + content = Path(doc_path).read_text() + blocks = re.findall(rf"```{language}\n(.*?)\n```", content, re.DOTALL) + + end = "" + if language == "csharp": + found = False + filtered_blocks = [] + for block in blocks: + # The doc first create an empy class Module, so we need to fixup the closing + if "partial class Module" in block: + block = block.replace("}", "") + end = "\n}" + # Remove the first `OnConnected` block, which body is later updated + if "OnConnected(DbConnection conn" in block and not found: + found = True + continue + filtered_blocks.append(block) + blocks = filtered_blocks + # So we could have a different db for each language + return "\n".join(blocks).replace("quickstart-chat", f"quickstart-chat-{language}") + end + +def load_nuget_config(p: Path): + if p.exists(): + with p.open("rb") as f: + return xmltodict.parse(f.read(), force_list=["add", "packageSource", "package"]) + return {} + +def save_nuget_config(p: Path, doc: dict): + # Write back (pretty, UTF-8, no BOM) + xml = xmltodict.unparse(doc, pretty=True) + p.write_text(xml, encoding="utf-8") + +def add_source(doc: dict, *, key: str, path: str) -> None: + cfg = doc.setdefault("configuration", {}) + sources = cfg.setdefault("packageSources", {}) + source_entries = sources.setdefault("add", []) + source = {"@key": key, "@value": path} + source_entries.append(source) + +def add_mapping(doc: dict, *, key: str, pattern: str) -> None: + cfg = doc.setdefault("configuration", {}) + + psm = cfg.setdefault("packageSourceMapping", {}) + mapping_sources = psm.setdefault("packageSource", []) + + # Find or create the target + target = next((s for s in mapping_sources if s.get("@key") == key), None) + if target is None: + target = {"@key": key, "package": []} + mapping_sources.append(target) + + pkgs = target.setdefault("package", []) + + existing = {pkg.get("@pattern") for pkg in pkgs if "@pattern" in pkg} + if pattern not in existing: + pkgs.append({"@pattern": pattern}) + +def override_nuget_package(*, project_dir: Path, package: str, source_dir: Path, build_subdir: str): + """Override nuget config to use a local NuGet package on a .NET project""" + # Make sure the local package is built + run_cmd("dotnet", "pack", cwd=source_dir) + + p = Path(project_dir) / "nuget.config" + doc = load_nuget_config(p) + add_source(doc, key=package, path=source_dir/build_subdir) + add_mapping(doc, key=package, pattern=package) + # Fallback for other packages + add_mapping(doc, key="nuget.org", pattern="*") + save_nuget_config(p, doc) + + # Clear any caches for nuget packages + run_cmd("dotnet", "nuget", "locals", "--clear", "all", capture_stderr=True) + +class BaseQuickstart(Smoketest): + AUTOPUBLISH = False + MODULE_CODE = "" + + lang = None + server_doc = None + client_doc = None + server_file = None + client_file = None + module_bindings = None + extra_code = None + replacements = {} + connected_str = None + run_cmd = [] + build_cmd = [] + + def project_init(self, path: Path): + raise NotImplementedError + + def sdk_setup(self, path: Path): + raise NotImplementedError + + def _publish(self) -> Path: + base_path = Path(self.enterClassContext(tempfile.TemporaryDirectory())) + server_path = base_path / "server" + + self.generate_server(server_path) + self.publish_module(f"quickstart-chat-{self.lang}", capture_stderr=True, clear=True) + return base_path / "client" + + def generate_server(self, server_path: Path): + """Generate the server code from the quickstart documentation.""" + logging.info(f"Generating server code {self.lang}: {server_path}...") + self.spacetime( + "init", + "--non-interactive", + "--lang", + self.lang, + "--project-path", + server_path, + "spacetimedb-project", + capture_stderr=True, + ) + self.project_path = server_path / "spacetimedb" + shutil.copy2(STDB_DIR / "rust-toolchain.toml", self.project_path) + _write_file(self.project_path / self.server_file, _parse_quickstart(self.server_doc, self.lang)) + self.server_postprocess(self.project_path) + self.spacetime("build", "-d", "-p", self.project_path, capture_stderr=True) + + def server_postprocess(self, server_path: Path): + """Optional per-language hook.""" + pass + + def check(self, input_cmd: str, client_path: Path, contains: str): + """Run the client command and check if the output contains the expected string.""" + output = run_cmd(*self.run_cmd, input=input_cmd, cwd=client_path, capture_stderr=True, text=True) + print(f"Output for {self.lang} client:\n{output}") + self.assertIn(contains, output) + + def _test_quickstart(self): + """Run the quickstart client.""" + client_path = self._publish() + self.project_init(client_path) + self.sdk_setup(client_path) + + run_cmd(*self.build_cmd, cwd=client_path, capture_stderr=True) + + self.spacetime( + "generate", "--lang", self.lang, + "--out-dir", client_path / self.module_bindings, + "--project-path", self.project_path, capture_stderr=True + ) + # Replay the quickstart guide steps + main = _parse_quickstart(self.client_doc, self.lang) + for src, dst in self.replacements.items(): + main = main.replace(src, dst) + main += "\n" + self.extra_code + server = self.get_server_address() + host = server["address"] + protocol = server["protocol"] + main = main.replace("http://localhost:3000", f"{protocol}://{host}") + _write_file(client_path / self.client_file, main) + + self.check("", client_path, self.connected_str) + self.check("/name Alice", client_path, "Alice") + self.check("Hello World", client_path, "Hello World") + + +class Rust(BaseQuickstart): + lang = "rust" + server_doc = STDB_DIR / "docs/docs/06-Server Module Languages/02-rust-quickstart.md" + client_doc = STDB_DIR / "docs/docs/07-Client SDK Languages/04-rust-quickstart.md" + server_file = "src/lib.rs" + client_file = "src/main.rs" + module_bindings = "src/module_bindings" + run_cmd = ["cargo", "run"] + build_cmd = ["cargo", "build"] + + replacements = { + # Replace the interactive user input to allow direct testing + "user_input_loop(&ctx)": "user_input_direct(&ctx)", + # Don't cache the token, because it will cause the test to fail if we run against a non-default server (because we don't cache the corresponding signing keypair) + ".with_token(creds_store()": "//.with_token(creds_store()" + } + extra_code = """ +fn user_input_direct(ctx: &DbConnection) { + let mut line = String::new(); + std::io::stdin().read_line(&mut line).expect("Failed to read from stdin."); + if let Some(name) = line.strip_prefix("/name ") { + ctx.reducers.set_name(name.to_string()).unwrap(); + } else { + ctx.reducers.send_message(line).unwrap(); + } + std::thread::sleep(std::time::Duration::from_secs(1)); + std::process::exit(0); +} +""" + connected_str = "connected" + + def project_init(self, path: Path): + run_cmd("cargo", "new", "--bin", "--name", "quickstart_chat_client", "client", cwd=path.parent, + capture_stderr=True) + + def sdk_setup(self, path: Path): + sdk_rust_path = (STDB_DIR / "sdks/rust").absolute() + sdk_rust_toml_escaped = str(sdk_rust_path).replace('\\', '\\\\\\\\') # double escape for re.sub + toml + sdk_rust_toml = f'spacetimedb-sdk = {{ path = "{sdk_rust_toml_escaped}" }}\nlog = "0.4"\nhex = "0.4"\n' + _append_to_file(path / "Cargo.toml", sdk_rust_toml) + + def server_postprocess(self, server_path: Path): + _write_file(server_path / "Cargo.toml", self.cargo_manifest(TEMPLATE_CARGO_TOML)) + + def test_quickstart(self): + """Run the Rust quickstart guides for server and client.""" + self._test_quickstart() + + +class CSharp(BaseQuickstart): + lang = "csharp" + server_doc = STDB_DIR / "docs/docs/06-Server Module Languages/04-csharp-quickstart.md" + client_doc = STDB_DIR / "docs/docs/07-Client SDK Languages/02-csharp-quickstart.md" + server_file = "Lib.cs" + client_file = "Program.cs" + module_bindings = "module_bindings" + run_cmd = ["dotnet", "run"] + build_cmd = ["dotnet", "build"] + + # Replace the interactive user input to allow direct testing + replacements = { + "InputLoop();": "UserInputDirect();", + ".OnConnect(OnConnected)": ".OnConnect(OnConnectedSignal)", + ".OnConnectError(OnConnectError)": ".OnConnectError(OnConnectErrorSignal)", + # Don't cache the token, because it will cause the test to fail if we run against a non-default server (because we don't cache the corresponding signing keypair) + ".WithToken(AuthToken.Token)": "//.WithToken(AuthToken.Token)", + "Main();": "" # To put the main function at the end so it can see the new functions + } + # So we can wait for the connection to be established... + extra_code = """ +var connectedEvent = new ManualResetEventSlim(false); +var connectionFailed = new ManualResetEventSlim(false); +void OnConnectErrorSignal(Exception e) +{ + OnConnectError(e); + connectionFailed.Set(); +} +void OnConnectedSignal(DbConnection conn, Identity identity, string authToken) +{ + OnConnected(conn, identity, authToken); + connectedEvent.Set(); +} + +void UserInputDirect() { + string? line = Console.In.ReadToEnd()?.Trim(); + if (line == null) Environment.Exit(0); + + if (!WaitHandle.WaitAny( + new[] { connectedEvent.WaitHandle, connectionFailed.WaitHandle }, + TimeSpan.FromSeconds(5) + ).Equals(0)) + { + Console.WriteLine("Failed to connect to server within timeout."); + Environment.Exit(1); + } + + if (line.StartsWith("/name ")) { + input_queue.Enqueue(("name", line[6..])); + } else { + input_queue.Enqueue(("message", line)); + } + Thread.Sleep(1000); +} +Main(); +""" + connected_str = "Connected" + + def project_init(self, path: Path): + run_cmd("dotnet", "new", "console", "--name", "QuickstartChatClient", "--output", path, capture_stderr=True) + + def sdk_setup(self, path: Path): + override_nuget_package( + project_dir=STDB_DIR/"sdks/csharp", + package="SpacetimeDB.BSATN.Runtime", + source_dir=(STDB_DIR / "crates/bindings-csharp/BSATN.Runtime").absolute(), + build_subdir="bin/Release" + ) + override_nuget_package( + project_dir=path, + package="SpacetimeDB.ClientSDK", + source_dir=(STDB_DIR / "sdks/csharp").absolute(), + build_subdir="bin~/Release" + ) + run_cmd("dotnet", "add", "package", "SpacetimeDB.ClientSDK", cwd=path, capture_stderr=True) + + def server_postprocess(self, server_path: Path): + override_nuget_package( + project_dir=server_path, + package="SpacetimeDB.Runtime", + source_dir=(STDB_DIR / "crates/bindings-csharp/Runtime").absolute(), + build_subdir="bin/Release" + ) + + def test_quickstart(self): + """Run the C# quickstart guides for server and client.""" + if not smoketests.HAVE_DOTNET: + self.skipTest("C# SDK requires .NET to be installed.") + self._test_quickstart() diff --git a/smoketests/tests/replication.py b/smoketests/tests/replication.py index fac348936c2..7ff7b1924c6 100644 --- a/smoketests/tests/replication.py +++ b/smoketests/tests/replication.py @@ -225,6 +225,7 @@ class ReplicationTest(Smoketest): def setUpClass(cls): super().setUpClass() cls.root_config = cls.project_path / "root_config" + spacetime("--config-path", cls.root_config, "server", "set-default", "local") def tearDown(self): # Ensure containers that were brought down during a test are back up. @@ -234,16 +235,12 @@ def tearDown(self): # TODO: This function seems to run even when `--docker` is not passed, leading to errors unless `-x replication` is passed, due to the docker-related code below. def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.set_default_server() self.docker = DockerManager(COMPOSE_FILE) self.root_token = self.docker.generate_root_token() self.cluster = Cluster(self.docker, self) - def set_default_server(self): - spacetime("--config-path", self.root_config, "server", "set-default", "local") - def add_me_as_admin(self): """Add the current user as an admin account""" db_owner_id = str(self.spacetime("login", "show")).split()[-1] From fb03c7698720b87f754a7aafab85df7cfb9ea49d Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Mon, 3 Nov 2025 12:40:16 -0800 Subject: [PATCH 5/5] [phoebe/replication-smoketests-default-server]: rm accidental file --- smoketests/tests/quickstart.py.orig | 324 ---------------------------- 1 file changed, 324 deletions(-) delete mode 100644 smoketests/tests/quickstart.py.orig diff --git a/smoketests/tests/quickstart.py.orig b/smoketests/tests/quickstart.py.orig deleted file mode 100644 index fdcf3b7a4e5..00000000000 --- a/smoketests/tests/quickstart.py.orig +++ /dev/null @@ -1,324 +0,0 @@ -import logging -import re -import shutil -from pathlib import Path -import tempfile -import xmltodict - -import smoketests -from .. import Smoketest, STDB_DIR, run_cmd, TEMPLATE_CARGO_TOML - - -def _write_file(path: Path, content: str): - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text(content) - - -def _append_to_file(path: Path, content: str): - with open(path, "a", encoding="utf-8") as f: - f.write(content) - - -def _parse_quickstart(doc_path: Path, language: str) -> str: - """Extract code blocks from `quickstart.md` docs. - This will replicate the steps in the quickstart guide, so if it fails the quickstart guide is broken. - """ - content = Path(doc_path).read_text() - blocks = re.findall(rf"```{language}\n(.*?)\n```", content, re.DOTALL) - - end = "" - if language == "csharp": - found = False - filtered_blocks = [] - for block in blocks: - # The doc first create an empy class Module, so we need to fixup the closing - if "partial class Module" in block: - block = block.replace("}", "") - end = "\n}" - # Remove the first `OnConnected` block, which body is later updated - if "OnConnected(DbConnection conn" in block and not found: - found = True - continue - filtered_blocks.append(block) - blocks = filtered_blocks - # So we could have a different db for each language - return "\n".join(blocks).replace("quickstart-chat", f"quickstart-chat-{language}") + end - -def load_nuget_config(p: Path): - if p.exists(): - with p.open("rb") as f: - return xmltodict.parse(f.read(), force_list=["add", "packageSource", "package"]) - return {} - -def save_nuget_config(p: Path, doc: dict): - # Write back (pretty, UTF-8, no BOM) - xml = xmltodict.unparse(doc, pretty=True) - p.write_text(xml, encoding="utf-8") - -def add_source(doc: dict, *, key: str, path: str) -> None: - cfg = doc.setdefault("configuration", {}) - sources = cfg.setdefault("packageSources", {}) - source_entries = sources.setdefault("add", []) - source = {"@key": key, "@value": path} - source_entries.append(source) - -def add_mapping(doc: dict, *, key: str, pattern: str) -> None: - cfg = doc.setdefault("configuration", {}) - - psm = cfg.setdefault("packageSourceMapping", {}) - mapping_sources = psm.setdefault("packageSource", []) - - # Find or create the target - target = next((s for s in mapping_sources if s.get("@key") == key), None) - if target is None: - target = {"@key": key, "package": []} - mapping_sources.append(target) - - pkgs = target.setdefault("package", []) - - existing = {pkg.get("@pattern") for pkg in pkgs if "@pattern" in pkg} - if pattern not in existing: - pkgs.append({"@pattern": pattern}) - -def override_nuget_package(*, project_dir: Path, package: str, source_dir: Path, build_subdir: str): - """Override nuget config to use a local NuGet package on a .NET project""" - # Make sure the local package is built - run_cmd("dotnet", "pack", cwd=source_dir) - - p = Path(project_dir) / "nuget.config" - doc = load_nuget_config(p) - add_source(doc, key=package, path=source_dir/build_subdir) - add_mapping(doc, key=package, pattern=package) - # Fallback for other packages - add_mapping(doc, key="nuget.org", pattern="*") - save_nuget_config(p, doc) - - # Clear any caches for nuget packages - run_cmd("dotnet", "nuget", "locals", "--clear", "all", capture_stderr=True) - -class BaseQuickstart(Smoketest): - AUTOPUBLISH = False - MODULE_CODE = "" - - lang = None - server_doc = None - client_doc = None - server_file = None - client_file = None - module_bindings = None - extra_code = None - replacements = {} - connected_str = None - run_cmd = [] - build_cmd = [] - - def project_init(self, path: Path): - raise NotImplementedError - - def sdk_setup(self, path: Path): - raise NotImplementedError - - def _publish(self) -> Path: - base_path = Path(self.enterClassContext(tempfile.TemporaryDirectory())) - server_path = base_path / "server" - - self.generate_server(server_path) - self.publish_module(f"quickstart-chat-{self.lang}", capture_stderr=True, clear=True) - return base_path / "client" - - def generate_server(self, server_path: Path): - """Generate the server code from the quickstart documentation.""" - logging.info(f"Generating server code {self.lang}: {server_path}...") - self.spacetime( - "init", - "--non-interactive", - "--lang", - self.lang, - "--project-path", - server_path, - "spacetimedb-project", - capture_stderr=True, - ) - self.project_path = server_path / "spacetimedb" - shutil.copy2(STDB_DIR / "rust-toolchain.toml", self.project_path) - _write_file(self.project_path / self.server_file, _parse_quickstart(self.server_doc, self.lang)) - self.server_postprocess(self.project_path) - self.spacetime("build", "-d", "-p", self.project_path, capture_stderr=True) - - def server_postprocess(self, server_path: Path): - """Optional per-language hook.""" - pass - - def check(self, input_cmd: str, client_path: Path, contains: str): - """Run the client command and check if the output contains the expected string.""" - output = run_cmd(*self.run_cmd, input=input_cmd, cwd=client_path, capture_stderr=True, text=True) - print(f"Output for {self.lang} client:\n{output}") - self.assertIn(contains, output) - - def _test_quickstart(self): - """Run the quickstart client.""" - client_path = self._publish() - self.project_init(client_path) - self.sdk_setup(client_path) - - run_cmd(*self.build_cmd, cwd=client_path, capture_stderr=True) - - self.spacetime( - "generate", "--lang", self.lang, - "--out-dir", client_path / self.module_bindings, - "--project-path", self.project_path, capture_stderr=True - ) - # Replay the quickstart guide steps - main = _parse_quickstart(self.client_doc, self.lang) - for src, dst in self.replacements.items(): - main = main.replace(src, dst) - main += "\n" + self.extra_code - server = self.get_server_address() - host = server["address"] - protocol = server["protocol"] - main = main.replace("http://localhost:3000", f"{protocol}://{host}") - _write_file(client_path / self.client_file, main) - - self.check("", client_path, self.connected_str) - self.check("/name Alice", client_path, "Alice") - self.check("Hello World", client_path, "Hello World") - - -class Rust(BaseQuickstart): - lang = "rust" - server_doc = STDB_DIR / "docs/docs/06-Server Module Languages/02-rust-quickstart.md" - client_doc = STDB_DIR / "docs/docs/07-Client SDK Languages/04-rust-quickstart.md" - server_file = "src/lib.rs" - client_file = "src/main.rs" - module_bindings = "src/module_bindings" - run_cmd = ["cargo", "run"] - build_cmd = ["cargo", "build"] - - replacements = { - # Replace the interactive user input to allow direct testing - "user_input_loop(&ctx)": "user_input_direct(&ctx)", - # Don't cache the token, because it will cause the test to fail if we run against a non-default server (because we don't cache the corresponding signing keypair) - ".with_token(creds_store()": "//.with_token(creds_store()" - } - extra_code = """ -fn user_input_direct(ctx: &DbConnection) { - let mut line = String::new(); - std::io::stdin().read_line(&mut line).expect("Failed to read from stdin."); - if let Some(name) = line.strip_prefix("/name ") { - ctx.reducers.set_name(name.to_string()).unwrap(); - } else { - ctx.reducers.send_message(line).unwrap(); - } - std::thread::sleep(std::time::Duration::from_secs(1)); - std::process::exit(0); -} -""" - connected_str = "connected" - - def project_init(self, path: Path): - run_cmd("cargo", "new", "--bin", "--name", "quickstart_chat_client", "client", cwd=path.parent, - capture_stderr=True) - - def sdk_setup(self, path: Path): - sdk_rust_path = (STDB_DIR / "sdks/rust").absolute() - sdk_rust_toml_escaped = str(sdk_rust_path).replace('\\', '\\\\\\\\') # double escape for re.sub + toml - sdk_rust_toml = f'spacetimedb-sdk = {{ path = "{sdk_rust_toml_escaped}" }}\nlog = "0.4"\nhex = "0.4"\n' - _append_to_file(path / "Cargo.toml", sdk_rust_toml) - - def server_postprocess(self, server_path: Path): - _write_file(server_path / "Cargo.toml", self.cargo_manifest(TEMPLATE_CARGO_TOML)) - - def test_quickstart(self): - """Run the Rust quickstart guides for server and client.""" - self._test_quickstart() - - -class CSharp(BaseQuickstart): - lang = "csharp" - server_doc = STDB_DIR / "docs/docs/06-Server Module Languages/04-csharp-quickstart.md" - client_doc = STDB_DIR / "docs/docs/07-Client SDK Languages/02-csharp-quickstart.md" - server_file = "Lib.cs" - client_file = "Program.cs" - module_bindings = "module_bindings" - run_cmd = ["dotnet", "run"] - build_cmd = ["dotnet", "build"] - - # Replace the interactive user input to allow direct testing - replacements = { - "InputLoop();": "UserInputDirect();", - ".OnConnect(OnConnected)": ".OnConnect(OnConnectedSignal)", - ".OnConnectError(OnConnectError)": ".OnConnectError(OnConnectErrorSignal)", - # Don't cache the token, because it will cause the test to fail if we run against a non-default server (because we don't cache the corresponding signing keypair) - ".WithToken(AuthToken.Token)": "//.WithToken(AuthToken.Token)", - "Main();": "" # To put the main function at the end so it can see the new functions - } - # So we can wait for the connection to be established... - extra_code = """ -var connectedEvent = new ManualResetEventSlim(false); -var connectionFailed = new ManualResetEventSlim(false); -void OnConnectErrorSignal(Exception e) -{ - OnConnectError(e); - connectionFailed.Set(); -} -void OnConnectedSignal(DbConnection conn, Identity identity, string authToken) -{ - OnConnected(conn, identity, authToken); - connectedEvent.Set(); -} - -void UserInputDirect() { - string? line = Console.In.ReadToEnd()?.Trim(); - if (line == null) Environment.Exit(0); - - if (!WaitHandle.WaitAny( - new[] { connectedEvent.WaitHandle, connectionFailed.WaitHandle }, - TimeSpan.FromSeconds(5) - ).Equals(0)) - { - Console.WriteLine("Failed to connect to server within timeout."); - Environment.Exit(1); - } - - if (line.StartsWith("/name ")) { - input_queue.Enqueue(("name", line[6..])); - } else { - input_queue.Enqueue(("message", line)); - } - Thread.Sleep(1000); -} -Main(); -""" - connected_str = "Connected" - - def project_init(self, path: Path): - run_cmd("dotnet", "new", "console", "--name", "QuickstartChatClient", "--output", path, capture_stderr=True) - - def sdk_setup(self, path: Path): - override_nuget_package( - project_dir=STDB_DIR/"sdks/csharp", - package="SpacetimeDB.BSATN.Runtime", - source_dir=(STDB_DIR / "crates/bindings-csharp/BSATN.Runtime").absolute(), - build_subdir="bin/Release" - ) - override_nuget_package( - project_dir=path, - package="SpacetimeDB.ClientSDK", - source_dir=(STDB_DIR / "sdks/csharp").absolute(), - build_subdir="bin~/Release" - ) - run_cmd("dotnet", "add", "package", "SpacetimeDB.ClientSDK", cwd=path, capture_stderr=True) - - def server_postprocess(self, server_path: Path): - override_nuget_package( - project_dir=server_path, - package="SpacetimeDB.Runtime", - source_dir=(STDB_DIR / "crates/bindings-csharp/Runtime").absolute(), - build_subdir="bin/Release" - ) - - def test_quickstart(self): - """Run the C# quickstart guides for server and client.""" - if not smoketests.HAVE_DOTNET: - self.skipTest("C# SDK requires .NET to be installed.") - self._test_quickstart()