feat: unittest flow - #1
Merged
Merged
Conversation
antoinetoussaint-byte
added a commit
that referenced
this pull request
Aug 25, 2026
…-safe (#14) Addresses review findings on the optional gRPC server. #1 (main.py): the grpc server was imported at module top level, so importing src.main required the generated stubs. Runtime.Init runs GenerateOpenAPI, which imports src.main *before* Sync generates those stubs (and they are git-ignored, so a fresh clone has none) — Init failed with ModuleNotFoundError. The import now lives inside the startup handler; OpenAPI generation never fires startup, so the module imports cleanly without stubs. #2 (proto location): the proto was scaffolded at code/proto/api.proto, but core's LoadEndpoints re-derives the gRPC contract from standards.ProtoPath (proto/api.proto at the service root) and the manifest stores no proto bytes. The endpoint therefore reloaded with zero RPCs and dependent services could not generate clients. The proto now lives at the service-root standard path (Buf and grpcEndpoint read it there), and defaultProtoPath is bound to standards.ProtoPath so it can never drift again. #3 (server.py): add_insecure_port returns 0 instead of raising when a port can't be bound, so the server would "start" listening on nothing while FastAPI stayed healthy. It now raises, which also fails the pod's HTTP readiness probe via the shared lifespan (covers the gRPC-readiness gap). Tests: added a reload regression test asserting the gRPC endpoint keeps its RPCs after LoadEndpoints (would have caught #2), and a check that src.rpc is never imported at module top level (would have caught #1). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.