-
Notifications
You must be signed in to change notification settings - Fork 664
Add UUID built-in convenience type to SpacetimeDB #3538
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
Conversation
17d38a5 to
21c25de
Compare
|
I've rebased my changes and added them to the branch; this reworks the Unreal C++ side of things for UUID to introduce a new type, adds tests to the TestClient that confirms values and matches all the changes up with the Unreal codegen. If you have any questions don't hesitate to reach out! |
15d7a9d to
7328782
Compare
|
@rekhoff - I'll need your eyes on the Unreal changes as they were significant enough to add the new UUID object and integration tests. |
JasonAtClockwork
left a comment
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've gone through the Rust, TypeScript, and C# updates as well as retested my Unreal changes and it's looking solid but there seems to be missing integration tests for both TypeScript and C#. Rust looks solid but we'll want someone with more experience to review that.
For TypeScript I'm not sure how our testing framework is set up so I could be wrong. Maybe Noa can help guide here.
For C# sadly we're not hooked directly into the sdk-test or sdk-test-cs but we should add integration test for Uuid into /sdks/csharp/~examples/regression-tests to make sure there is coverage. Myself or Ryan can help here if it isn't clear how to plug in and run those.
# Description of Changes As the title says, required for #3538. # Expected complexity level and risk 1 # Testing Will be done on the `uuid` pr. --------- Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
ef735c9 to
a68fd5f
Compare
a68fd5f to
687fba2
Compare
JasonAtClockwork
left a comment
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.
C# + Unreal looks good to me though I highly advise another pair of eyes before merging.
|
From Wikipedia:
It looks like we should be putting the counter in the low bits, not the timestamp. |
|
Plan is to move the counter part of the generated UUIDv7 into the space reserved for the counter, and not increment the timestamp part. We'll store the source for the counter in the |
6fe9cef to
ba86593
Compare
gefjon
left a comment
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.
This is looking very good, I think we're very close to merging. Thanks for all your hard work.
I reviewed both the C# and the Unreal code. I think you caught the concerns. The Unreal tests could provide better coverage, they are fairly light at the moment. I did load up the Unreal |
rekhoff
left a comment
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.
Signing off approval for the C# and as secondary on the Unreal changes.
00d3c8c to
b5ba0bb
Compare
Fix uuid parsing and to_string in ts and c# Apply suggestions from code review Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Added new Builtin for UUID
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
b5ba0bb to
c86e720
Compare
jdetter
left a comment
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'm just reviewing as a CLI crate owner - the updates here are only within the tests and the updates look correct.
One request: could we update the PR description with the latest info for this PR in its current state before it merges? Thanks 👍
# Description of Changes #3538 added a `uuid_counter` field to ReducerCtx, which has no need to be public. Implementing ReducerCtx as a class allows us to encapsulate better, and lets us enumerate exactly the data that it needs to hold so that the runtime could possibly optimize it. # Expected complexity level and risk 1: straightforward switch # Testing - [x] Automated testing is sufficient.
Description of Changes
Closes #3290.
Adds a new "special" type to SATS,
UUID, which is represented as the product{ __uuid__: u128 }. Adds versions of this type to all of our various languages' module bindings libraries and client SDKs, and updates codegen to recognize it and output references to those named library types. Adds methods for creating new UUIDs according to the V4 (all random) and V7 (timestamp, monotonic counter and random) specifications.API and ABI breaking changes
We add a new type
Expected complexity level and risk
2
it impacts all over the code
Testing
module-testmodules in Rust, C# and TypeScript, with uses of UUIDs.