Skip to content

fix(datamesh): pin protobuf gencode to the 5.29 runtime line - #26

Merged
patterncatalyst merged 1 commit into
mainfrom
fix/protobuf-gencode-5x-alignment
Nov 4, 2026
Merged

patterncatalyst merged 1 commit into
mainfrom
fix/protobuf-gencode-5x-alignment

Conversation

@patterncatalyst

Copy link
Copy Markdown
Owner

Problem

The committed inventory gRPC stubs (services/{inventory-service,order-service,graphql-gateway}/gen/...) were regenerated by buf's unpinned remote plugins, which stamp a protobuf-6 gencode (Protobuf Python Version: 7.36.2). Every service pins protobuf >=5.26,<6 (resolves to 5.29.6), and each _pb2.py carries a runtime-version guard: the runtime must not be older than the gencode that stamped it.

gencode 7.36.2 against runtime 5.29.6 raises VersionError at import, crash-looping inventory-service, order-service, and graphql-gateway on OpenShift/CRC (the other four services + infra were unaffected).

Fix

Pin buf.gen.yaml to the protobuf-5.29 line and regenerate the committed stubs:

  • buf.build/protocolbuffers/python:v29.3 → python protobuf 5.29.3
  • buf.build/grpc/python:v1.70.0 → last gRPC plugin on that line

gencode is now 5.29.3, which the 5.29.6 runtime accepts. The architecture choice to commit stubs (CAP-013: no buf/protoc in the image) is unchanged; this only keeps the generator on the same protobuf line as the pinned runtime.

Verified live on CRC

  • All three services Running 1/1, no VersionError.
  • POST /orders drives the order→inventory gRPC check_stock: 201 for in-stock WIDGET-001, 409 "insufficient stock (0 on hand)" for WIDGET-OOS.
  • The GraphQL gateway resolves Order.stock over gRPC: { sku: WIDGET-001, quantityOnHand: 50, available: true }.

The committed inventory stubs were regenerated by buf's unpinned remote
plugins, which stamp a protobuf-6 gencode (Protobuf Python Version 7.36.2).
Each service pins protobuf >=5.26,<6 (resolves to 5.29.6), and _pb2.py
carries a runtime-version guard: the runtime must not be older than the
gencode that stamped it. gencode 7.36.2 against runtime 5.29.6 raised
VersionError at import, crash-looping inventory-service, order-service and
graphql-gateway on OpenShift.

Pin buf.gen.yaml to protocolbuffers/python:v29.3 (python protobuf 5.29.3)
and grpc/python:v1.70.0 (last gRPC plugin on that line), and regenerate the
committed stubs. gencode is now 5.29.3, which the 5.29.6 runtime accepts.

Verified live on CRC: all three services Running 1/1; POST /orders drives
the order->inventory gRPC check_stock (201 in-stock, 409 out-of-stock); the
GraphQL gateway resolves Order.stock over gRPC.
@patterncatalyst
patterncatalyst merged commit 47bf3f8 into main Nov 4, 2026
1 check passed
@patterncatalyst
patterncatalyst deleted the fix/protobuf-gencode-5x-alignment branch November 4, 2026 04:39
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