Skip to content

Conversation

teskje
Copy link
Contributor

@teskje teskje commented Oct 14, 2025

(The first 3 commits are from #33843 and can be ignored here.)

This PR replaces the proto definitions in mz-catalog-protos with the equivalent Rust type definitions, obtained through protobuf codegen and subsequent cleanup. This removes the dependency on prost and paves the way for removing one level of StateUpdateKind definitions.

Note that the crate is still called mz-catalog-protos and there are plenty of references to "protos" left in other crates. Cleaning this up is left as a follow-up.

Motivation

  • This PR refactors existing code.

Step (2) of https://github.com/MaterializeInc/database-issues/issues/9792

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

As part of moving away from protobuf in the catalog, we need to change
the serialization `WireCompatible` uses to convert one type into the
other. The catalog state is serialized as JSON, so we can just use JSON
here as well.
Wire compatibility is a networking term and somewhat confusing in the
context of a catalog. This commit renames the `WireCompatible` trait and
`wire_compatible!` macro to `JsonCompatible`/`json_compatible!`. The new
name also surfaces the requirement that implementing types must be
JSON-serializable.
Moving the module rename into a separate commit to keep the diff clean.
This commit adds Rust source files describing the existing versioned
catalog definitions. The contained types are generated by running the
protobuf codegen and then cleaning up the result. They have the same
fields and JSON serialization behavior as the proto types, but don't
depend on `prost`.
This commit changes the existing hash checking logic meant to ensure
that the versioned proto files never change to check the new Rust source
files instead.
This commit removes the now unused proto definitions and cleans up the
crate dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant