Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.0.0 rc1 hotfix4 #2040

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2aed1a5
websocket: tx_update_light knob + TransactionUpdateLight messages
Centril Oct 7, 2024
0b16f83
add `ClientMessage::CallReducer.flags` with `NoSuccessNotify` as variant
Centril Oct 8, 2024
949b3f3
revamp CallReducerFlags/host to always send full tx updates to caller…
Centril Oct 10, 2024
80f19f5
cargo insta accept
Centril Oct 14, 2024
5bb3a94
fix standalone_integration_test
Centril Oct 14, 2024
c288ae3
support SetReducerFlags in C# codegen
Centril Oct 15, 2024
31461b1
support SetReducerFlags in TS codegen
Centril Oct 16, 2024
e40ff32
C# sdk codegen: always use T[]
Centril Oct 22, 2024
b50a7f3
fix rebase fallout & ts sdk codegen fix
Centril Oct 22, 2024
b8daa0a
don't promise that we'll keep call-reducer flags (although removing i…
Centril Oct 22, 2024
5da192c
regen module_bindings
Centril Oct 22, 2024
32a0490
C# codegen: fix typo in default_init
Centril Oct 22, 2024
e576ba7
c# codegen: revert to always using List<T> for arrays
Centril Oct 22, 2024
251cb8f
c# codegen: fix RemoteReducers ctor
Centril Oct 23, 2024
01d3cd9
typescript codegen: add missing comma
Centril Oct 23, 2024
212e049
Be more careful about endianness with Identity and Address
kazimuth Oct 31, 2024
5dfacfc
Docs typo
kazimuth Oct 31, 2024
9198382
Test typo
kazimuth Oct 31, 2024
639df72
One more comment fix
kazimuth Oct 31, 2024
50417cc
Merge branch 'master' into jgilles/endianness
PuruVJ Nov 1, 2024
30866da
Address review comments
kazimuth Nov 1, 2024
105f854
More detailed comments on Address
kazimuth Nov 1, 2024
be63a47
[release/v1.0.0-rc1]: Merge remote-tracking branch 'origin/centril/we…
bfops Nov 1, 2024
663c5b1
Keep little-endian standalone ControlDb keys
kazimuth Nov 4, 2024
4614074
Merge branch 'master' into jgilles/endianness
kazimuth Nov 4, 2024
3b80687
Ah, fix some incorrect controldb paths
kazimuth Nov 4, 2024
b9881d1
Bump commit
kazimuth Nov 5, 2024
e00ac50
[release/v1.0.0-rc1]: Merge commit 'b9881d1' into release/v1.0.0-rc1
bfops Nov 5, 2024
3a10733
[release/v1.0.0-rc1]: Manually apply open PR #1952: Decode identity c…
bfops Nov 6, 2024
5db26e2
[release/v1.0.0-rc1-hotfix2]: Manually apply open PR #1964 @ bc96dd2:…
bfops Nov 11, 2024
1babcfc
[release/v1.0.0-rc1-hotfix2]: Manually apply open PR #1984 @ 06f3875:…
bfops Nov 12, 2024
39ebaea
[release/v1.0.0-rc1-hotfix4]: Migrate C# client-side reducer enum to …
RReverser Dec 4, 2024
f9ef8ed
Don't autogen schedule fields (#1894)
coolreader18 Nov 22, 2024
a067974
Rust SDK: Actual client-side indices for unique constraints (#1909)
gefjon Nov 29, 2024
a7b3c87
Rust SDK: no more reducer args structs (#2036)
gefjon Dec 4, 2024
e40701e
Fix declaration order of ScheduleAt in C# (#2007)
kazimuth Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 9 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,49 +120,26 @@ jobs:
run: |
sudo mkdir /stdb
sudo chmod 777 /stdb

- name: Checkout C# SDK
uses: actions/checkout@v4
with:
repository: clockworklabs/spacetimedb-csharp-sdk
ref: staging
path: spacetimedb-csharp-sdk

- name: C# SDK tests
- name: Setup NuGet override for C# SDK
working-directory: spacetimedb-csharp-sdk
run: |
( cd crates/bindings-csharp/BSATN.Runtime && dotnet pack )
cd spacetimedb-csharp-sdk

# Write out the nuget config file to `nuget.config`. This causes the spacetimedb-csharp-sdk repository
# to be aware of the local versions of the `bindings-csharp` packages in SpacetimeDB, and use them if
# available. Otherwise, `spacetimedb-csharp-sdk` will use the NuGet versions of the packages.
# This means that (if version numbers match) we will test the local versions of the C# packages, even
# if they're not pushed to NuGet.
# See https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file for more info on the config file,
# and https://tldp.org/LDP/abs/html/here-docs.html for more info on this bash feature.
cat >nuget.config <<EOF
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Local NuGet repositories -->
<add key="Local SpacetimeDB.BSATN.Runtime" value="../crates/bindings-csharp/BSATN.Runtime/bin/Release" />
</packageSources>
<packageSourceMapping>
<!-- Ensure that SpacetimeDB.BSATN.Runtime is used from the local folder. -->
<!-- Otherwise we risk an outdated version being quietly pulled from NuGet for testing. -->
<packageSource key="Local SpacetimeDB.BSATN.Runtime">
<package pattern="SpacetimeDB.BSATN.Runtime" />
</packageSource>
<!-- Fallback to NuGet for other packages. -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
EOF
dotnet pack ../crates/bindings-csharp/BSATN.Runtime
./tools~/write-nuget-config.sh ..

# clear package caches, so we get fresh ones even if version numbers haven't changed
dotnet nuget locals all --clear
dotnet test

- name: Run C# SDK tests
working-directory: spacetimedb-csharp-sdk
run: dotnet test

lints:
name: Lints
Expand Down
43 changes: 0 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ http = "1.0"
humantime = "2.1.0"
hyper = "1.0"
hyper-util = { version = "0.1", features = ["tokio"] }
im = "15.1"
imara-diff = "0.1.3"
indexmap = "2.0.0"
indicatif = "0.16"
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-csharp/BSATN.Codegen/BSATN.Codegen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<AssemblyName>SpacetimeDB.BSATN.Codegen</AssemblyName>
<Version>1.0.0-rc1</Version>
<Version>1.0.0-rc1-hotfix1</Version>
<Title>SpacetimeDB BSATN Codegen</Title>
<Description>The SpacetimeDB BSATN Codegen implements the Roslyn incremental generators for BSATN serialization/deserialization in C#.</Description>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<RootNamespace>SpacetimeDB</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CSharpier.Core" Version="0.28.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../BSATN.Runtime/BSATN.Runtime.csproj" />
</ItemGroup>

</Project>
162 changes: 162 additions & 0 deletions crates/bindings-csharp/BSATN.Runtime.Tests/Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
namespace SpacetimeDB;

using Xunit;

public static class BSATNRuntimeTests
{
[Fact]
public static void AddressRoundtrips()
{
var str = "00112233445566778899AABBCCDDEEFF";
var addr = Address.FromHexString(str);

Assert.NotNull(addr);
Assert.Equal(addr.ToString(), str);

byte[] bytes =
[
0x00,
0x11,
0x22,
0x33,
0x44,
0x55,
0x66,
0x77,
0x88,
0x99,
0xaa,
0xbb,
0xcc,
0xdd,
0xee,
0xff,
];
var addr2 = Address.FromBigEndian(bytes);
Assert.Equal(addr2, addr);

Array.Reverse(bytes);
var addr3 = Address.From(bytes);
Assert.Equal(addr3, addr);

var memoryStream = new MemoryStream();
var writer = new BinaryWriter(memoryStream);
var bsatn = new Address.BSATN();
if (addr is { } addrNotNull)
{
bsatn.Write(writer, addrNotNull);
}
else
{
Assert.Fail("Impossible");
}
writer.Flush();

var littleEndianBytes = memoryStream.ToArray();
var reader = new BinaryReader(new MemoryStream(littleEndianBytes));
var addr4 = bsatn.Read(reader);
Assert.Equal(addr4, addr);

// Note: From = FromLittleEndian
var addr5 = Address.From(littleEndianBytes);
Assert.Equal(addr5, addr);
}

[Fact]
public static void AddressLengthCheck()
{
for (var i = 0; i < 64; i++)
{
if (i == 16)
{
continue;
}

var bytes = new byte[i];

Assert.ThrowsAny<Exception>(() => Address.From(bytes));
}
}

[Fact]
public static void IdentityRoundtrips()
{
var str = "00112233445566778899AABBCCDDEEFF00112233445566778899AABBCCDDEEFF";
var ident = Identity.FromHexString(str);

Assert.Equal(ident.ToString(), str);

byte[] bytes =
[
0x00,
0x11,
0x22,
0x33,
0x44,
0x55,
0x66,
0x77,
0x88,
0x99,
0xaa,
0xbb,
0xcc,
0xdd,
0xee,
0xff,
0x00,
0x11,
0x22,
0x33,
0x44,
0x55,
0x66,
0x77,
0x88,
0x99,
0xaa,
0xbb,
0xcc,
0xdd,
0xee,
0xff,
];
var ident2 = Identity.FromBigEndian(bytes);
Assert.Equal(ident2, ident);

Array.Reverse(bytes);
var ident3 = Identity.From(bytes);
Assert.Equal(ident3, ident);

var memoryStream = new MemoryStream();
var writer = new BinaryWriter(memoryStream);
var bsatn = new Identity.BSATN();
bsatn.Write(writer, ident);
writer.Flush();

var littleEndianBytes = memoryStream.ToArray();
var reader = new BinaryReader(new MemoryStream(littleEndianBytes));
var ident4 = bsatn.Read(reader);
Assert.Equal(ident4, ident);

// Note: From = FromLittleEndian
var ident5 = Identity.From(littleEndianBytes);
Assert.Equal(ident5, ident);
}

[Fact]
public static void IdentityLengthCheck()
{
for (var i = 0; i < 64; i++)
{
if (i == 32)
{
continue;
}

var bytes = new byte[i];

Assert.ThrowsAny<Exception>(() => Identity.From(bytes));
}
}
}
2 changes: 1 addition & 1 deletion crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<AssemblyName>SpacetimeDB.BSATN.Runtime</AssemblyName>
<Version>1.0.0-rc1</Version>
<Version>1.0.0-rc1-hotfix1</Version>
<Title>SpacetimeDB BSATN Runtime</Title>
<Description>The SpacetimeDB BSATN Runtime implements APIs for BSATN serialization/deserialization in C#.</Description>
</PropertyGroup>
Expand Down
Loading
Loading