Repository navigation
Add protobuf publishing test support - #1441
Merged
Merged
Conversation
jwils
force-pushed
the
joshuaw/proto-indexing-parity
branch
from
October 29, 2026 15:35
40f7957 to
d471d9f
Compare
jwils
force-pushed
the
joshuaw/proto-indexing-parity
branch
from
November 2, 2026 00:07
ad917c8 to
fad65f3
Compare
myronmarston
approved these changes
Nov 2, 2026
jwils
marked this pull request as ready for review
November 4, 2026 21:16
jwils
requested review from
BrianSigafoos-SQ,
bsorbo,
ellisandrews-toast,
jwondrusch,
marcdaniels-toast and
rossroberts-toast
as code owners
November 4, 2026 21:16
Compile generated schemas and publish real protobuf event batches so future indexing specs can exercise the wire format. Keep the publisher independent of the production adapter and support historical schema snapshots with separate descriptor pools. Cache compiled descriptors by schema source so each unique schema runs `protoc` only once. Declare `elasticgraph-indexer` and `google-protobuf` as runtime dependencies of `elasticgraph-proto_ingestion`, since the ingestion adapter needs both in production.
jwils
force-pushed
the
joshuaw/proto-indexing-parity
branch
from
November 5, 2026 20:08
82f96ee to
b0e3f84
Compare
jwils
added a commit
that referenced
this pull request
Nov 29, 2026
## Why The indexer needs datastore hashes, but protobuf publishers produce native messages. Converting them into public record hashes first adds a full traversal and extra allocations. ## What Prepare native protobuf messages directly into datastore records in one pass using the generated protobuf runtime metadata and `google-protobuf` descriptors. ## How `ProtoIngestion::RecordPreparer` caches field plans built from protobuf descriptors. Sparse runtime metadata supplies field-name overrides, enum names, and scalar types. Renamed built-in scalars retain their indexing preparers, and enum symbols and numbers map consistently across Ruby runtimes. The preparer applies shared scalar rules, unwraps abstract `oneof` records, prepares message scalars such as `google.protobuf.Timestamp` from their canonical protobuf JSON form through the scalar's indexing preparer, and parses and canonicalizes `Untyped` leaves. The shared indexing pipeline adds `__counts` afterward. Preserves field presence, explicit defaults, exact 64-bit integers, nested lists, and concrete types in a single pass. ## Risk Adds `ProtoIngestion::RecordPreparer` and `RuntimeMetadata::Schema.from_schema_artifacts`, which become active when #1450 registers the protobuf ingestion adapter. Runtime dependencies are `elasticgraph-indexer` and `google-protobuf`. ## Testing No manual testing. Covered by integration specs in `record_preparer_spec.rb` and unit specs in `runtime_metadata/schema_spec.rb`. ## Bigger picture Builds on #1441's protobuf publishing test support. Native record validation, adapter registration, and activation of the shared indexing parity suite follow in #1450. --------- Signed-off-by: Josh Wilson <joshuaw@squareup.com> Co-authored-by: Neon <f833053fa3445a7878359a1bd17c4f6b4ed1ceb3e7414f306f4929b1f9032d02@buzz>
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.
Why
The shared indexer specs need real protobuf publishers before they can exercise protobuf ingestion. Their protobuf round trip is still a placeholder.
What
Add a test publisher that compiles
schema.proto, encodes event batches, and decodes native protobuf records. Extract the sharedprotoclocator from the existing schema test helper.How
The publisher walks protobuf descriptors and uses the generated runtime metadata for scalar and enum overrides. Each instance owns its descriptor pool, so tests can encode with an older publisher and decode with the current schema.
Focused specs cover proto2 and proto3, field presence, nested lists and abstract types, exact 64-bit integers, timestamps, and disk-backed artifacts. The publisher stays independent of the production record preparer.
Risk
Adds test support and declares runtime dependencies on
elasticgraph-indexerandgoogle-protobuf. Protobuf ingestion remains inactive; existing indexing examples stay pending.Testing
No manual testing.
Bigger picture
This prepares the shared indexer parity suite for real protobuf publishing. Record preparation (#1442) and adapter integration plus parity-test activation (#1450) follow in this stack.