Skip to content

Full rewrite: zero-handwritten-protobuf gRPC pipeline - #2

Merged
barakplasma merged 8 commits into
mainfrom
dev/next
Feb 21, 2026
Merged

Full rewrite: zero-handwritten-protobuf gRPC pipeline#2
barakplasma merged 8 commits into
mainfrom
dev/next

Conversation

@barakplasma

Copy link
Copy Markdown
Owner

Summary

  • Rewrites all of fastgrpc/ from scratch — fixes the 5 root-cause bugs from the old implementation (wrong MethodType usage, stale temp-dir cache, broken route matching, bad reflection service names, missing body_field attribute)
  • New pipeline: app.openapi()proto_gen.pycompiler.pygrpc.aio server
  • Route dispatch uses normalized operationId as the canonical key, bridging proto messages directly to FastAPI endpoint functions
  • Dynamic servicer built with a handler factory (_make_rpc_handler) to avoid closure bugs
  • SHA256-based stub cache survives restarts (stored in .fastgrpc_cache/)
  • 23 tests, 0 skips, all green

New structure

fastgrpc/
├── proto_gen.py   # OpenAPI → proto3 string
├── compiler.py    # grpcio-tools protoc wrapper
├── bridge.py      # operation_id → FastAPI endpoint dispatch
├── service.py     # grpc.aio server + dynamic servicer factory
└── core.py        # FastGRPC class: lifespan hooks + stub caching

CI/CD

  • CI runs tests on Python 3.10/3.11/3.12 on every push and PR
  • PyPI publish triggers on v* tags via OIDC trusted publishing (no stored secrets needed)

Test Plan

  • uv run pytest tests/ -v — 23 passed, 0 failed
  • Verify CI passes on GitHub Actions
  • Configure PyPI trusted publishing before first release tag

@barakplasma
barakplasma merged commit 765c863 into main Feb 21, 2026
6 checks passed
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