-
Notifications
You must be signed in to change notification settings - Fork 109
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
Migrate C# client-side reducer enum to the new syntax #2033
Conversation
8e69576
to
3970543
Compare
As per clockworklabs/SpacetimeDBPrivate#1198. This makes reducers use the same codegen structure as tables and other tuple types, but nests them inside a `Reducer` class as subclasses for pattern-matching, like we allow on tagged enums. The reason we don't use a tagged enum here anymore is because we don't need BSATN sum type support for the Reducer enum, and it imposes unnecessary restrictions like max 256 elements.
3f5a30c
to
cbe8de0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no way to test this, but it appears reasonable. I'd like clarity on the CI changes before you merge, but otherwise this looks good to go.
crates/bindings-csharp/Runtime/Internal/Autogen/RawRowLevelSecurityDefV9.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving CLI changes as a codeowner. I didn't really review; the changes are in C#-specific code that probably should be in an un-owned file anyway.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected.
## Description of Changes Counterpart to clockworklabs/SpacetimeDB#2033. Also updated test settings to make sure that sum type variants implemented via subclassing are shown as expected. ## API - [ ] This is an API breaking change to the SDK *If the API is breaking, please state below what will break* ## Requires SpacetimeDB PRs *List any PRs here that are required for this SDK change to work* ## Testsuite *If you would like to run against a specific SpacetimeDB branch in the testsuite, specify that here. This can be a branch name or a link to a PR.* SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [ ] Describe a test for this PR that you have completed
Description of Changes
As per https://github.com/clockworklabs/SpacetimeDBPrivate/pull/1198.
This makes reducers use the same codegen structure as tables and other tuple types, but nests them inside a
Reducer
class as subclasses for pattern-matching, like we allow on tagged enums.The reason we don't use a tagged enum here anymore is because we don't need BSATN sum type support for the Reducer enum, and it imposes unnecessary restrictions like max 256 elements.
While testing the changes, simplified the C# CI a bit by reusing the
tools~/write-nuget-config.sh
script from the C# SDK repo instead of duplicating its logic.API and ABI breaking changes
API breaking change for the client.
Expected complexity level and risk
2 - a breaking change, but shouldn't affect too much client code.
Testing
Waiting for CI to test it against client SDK, it's a bit quicker than manual.