Make cargo ci regen exhaustive across all committed codegen#4300
Open
cloutiertyler wants to merge 34 commits intomasterfrom
Open
Make cargo ci regen exhaustive across all committed codegen#4300cloutiertyler wants to merge 34 commits intomasterfrom
cloutiertyler wants to merge 34 commits intomasterfrom
Conversation
…ings-macro, and codegen - Add `event` attribute to #[table] macro for declaring event tables - Add CanBeLookupTable trait (non-event tables implement it) - Generate CanBeLookupTable impls in Rust codegen - Update physical plan and query-builder for event table support - Update module-test with example event table - Update codegen snapshots
- Add EventTable trait for transient event table rows (no client cache persistence) - Add from_event_inserts() and into_event_diff() for event table update handling - Parse EventTable rows from v2 TableUpdateRows - Exclude event tables from automatic subscription plans (get_all) - Reject v1 client subscriptions to event tables with upgrade message - Prevent event tables from being used as join lookup tables - Export EventTable in SDK public API
- Add sdk-test-event-table module with event table and reducers - Add event-table-client test binary with generated bindings - Register event-table-client and sdk-test-event-table in workspace - Update test configuration
- Add event-tables-status.md tracking implementation progress - Add 1.0 to 2.0 migration guide
The MyEvent table and emit_event reducer belong in sdk-test-event-table, not in module-test which must stay in sync with C# and TypeScript modules.
- Rust codegen: branch on is_event to emit EventTable trait, skip delete/update callbacks - TS module bindings: add event option to table(), pass isEvent through schema - TS codegen: emit event: true for event tables - TS client SDK: event tables fire on_insert but skip cache storage - C# SDK: IsEventTable flag, parse EventTableRows, skip cache/indices, fire OnInsert only - C# codegen: pass isEventTable: true in constructor for event tables - Datastore: 5 new tests for constraints/indexes/auto_inc on event tables - Docs: update event-tables-status.md with completed items
Event tables only expose onInsert/removeOnInsert at the type level, matching the Rust SDK's EventTable trait. Split ClientTableMethods into ClientTableInsertMethods and ClientTableDeleteMethods, and use an IsEventTable conditional type in ClientTableCore to exclude delete and update methods for event tables.
…s in C# SDK Event tables only expose OnInsert at the type level, matching Rust's EventTable trait and the TypeScript conditional types. RemoteEventTableHandle inherits from RemoteTableHandle and uses private new to shadow the OnDelete, OnBeforeDelete, and OnUpdate events. Codegen generates event table classes inheriting from RemoteEventTableHandle instead.
At some point, a rebase on this branch appears to have accidentally overwritten the Rust codegen changes in #4257 . This commit fixes that, to integrate the event tables codegen changes with the prior WS V2 codegen changes. I've also taken the minor liberty of re-ordering the emitted top-level forms in a table definition file, in order to allow merging the definitions of `register_table` and `parse_table_update`, which this branch previously had duplicated into the `if` and `else` cases of the conditional on whether the table was an event table or not. Plus I added a few comments.
…eforeDelete/OnUpdate from RemoteEventTableHandle
The server was always sending event table rows as PersistentTable inserts, causing clients to store them in the cache. Fix the server to send the EventTable variant, fix Rust codegen to use into_event_diff() (bypassing the cache), revert C# Table.cs tolerance checks that are no longer needed, and fix event table test race conditions where tests passed without actually running assertions.
…cifically reducer errors)
The V9→V10 change in extract_schema marks lifecycle reducers as private, so they are no longer included in public codegen output. This removes stale on_connect/on_disconnect reducer files from the chat template and updates smoketest expected namespace counts from 7 to 5.
Regenerate stale Rust SDK test bindings (CanBeLookupTable impls, blank line formatting, player_location_table in view-client) to fix the Test Suite CI check-diff failure. Add `cargo ci regen` subcommand that regenerates all codegen outputs checked by CI in one step: Rust SDK test bindings, Blackholio C#, C# moduledef, C# quickstart/regression tests, TypeScript template bindings, and TS/C++ moduledef bindings.
Add a `consume_entity_event` event table to the Blackholio server module. When an entity is consumed, insert an event before destroying it so the Unity client can play a shrink-toward-consumer animation instead of immediately destroying the GameObject. Client-side changes: - Register ConsumeEntityEvent.OnInsert handler - Track pending animations with HashSet to coordinate with Entity.OnDelete - Clean up old TODO comments in EntityController
Run `cargo ci regen --check` to regenerate all bindings and then verify nothing changed via tools/check-diff.sh. Fails with a clear error message if any bindings are stale.
Regenerated bindings for C++ moduledef, C# procedure-client, C# ClientApi, TS test-react-router-app, chat templates (C#, Rust, deno-ts). Lifecycle reducers (ClientConnected/ClientDisconnected) removed from chat templates as they are no longer generated.
f844795 to
87a0d5d
Compare
- Restructure regen into 5 categories: SDK test, demo, template, SDK internal, moduledef - Add Unreal codegen support (SDK tests, Blackholio, QuickstartChat, SDK moduledef) - Add deno-ts, Rust chat-console-rs, TS test-react-router-app template regen - Add C# ClientApi and TS client-api SDK internal regen - Add autogen coverage check to catch uncovered committed codegen - Add template generate script coverage check - Skip .templates dir in global.json symlink scanning (build artifact) - Fix Windows path normalization in global.json symlink restore - Add prettier retry for Windows file locking issues - Switch Blackholio server-rust to local path dependency for event table support - Add `generate` scripts to TS templates: browser-ts, bun-ts, nodejs-ts, tanstack-ts, keynote-2 - Add missing template entries to pnpm-workspace.yaml
87a0d5d to
426fa4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo ci regeninto 5 logical categories covering all committed codegen in the repo:generatescripts to 5 TS templates that were missing them (browser-ts, bun-ts, nodejs-ts, tanstack-ts, keynote-2)pnpm-workspace.yaml(bun-ts, nodejs-ts, nextjs-ts, remix-ts, keynote-2)--checkmode) that scans the repo for autogen markers and errors if any directory isn't in theREGEN_DIRSallowlistgeneratescriptcargo ci regendoesn't produce noisy diffs when the only change is the commit hash in codegen version commentscore.symlinks=false) during regen and restores them afterTest plan
cargo build --manifest-path tools/ci/Cargo.tomlcompilescargo ci regenruns to completion and generates all bindingscargo ci regen --checkpasses on a clean state (no stale bindings)generatescripts