Add v1 gRPC protocol crate#937
Open
bas3line wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new helix-protocol crate that defines HelixDB’s versioned Protobuf/gRPC contract and generates Rust bindings via tonic, then wires it into the workspace.
Changes:
- Introduces
helix.v1Protobuf service/messages and Tonic-generated Rust types. - Adds a build script to compile protos with a vendored
protoc. - Adds crate documentation and a few Rust unit tests for generated types.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| helix-protocol/src/lib.rs | Exposes helix.v1 generated module + basic unit tests and a default port constant |
| helix-protocol/proto/helix/v1/helix.proto | Defines the helix.v1.Helix gRPC service and request/response message schema |
| helix-protocol/build.rs | Compiles the proto using vendored protoc and tonic-build |
| helix-protocol/README.md | Documents API surface and shows Rust client usage |
| helix-protocol/Cargo.toml | Adds crate metadata, dependencies, and build-dependencies for Tonic/Prost codegen |
| Cargo.toml | Adds helix-protocol to the workspace members |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
@greptile-apps review the pr again lil bro |
Member
|
@matthewsanetra it would be good to go over this |
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.
Description
Adds a dedicated
helix-protocolworkspace crate that defines the first versioned HelixDB gRPC contract and generates Rust bindings with Tonic/Prost.This establishes the native gRPC surface requested in #780 without coupling the protocol contract to CLI or SDK internals. The server implementation can now implement
helix.v1.Helix, and SDKs can generate clients from the same checked-in protobuf source.Included API surface:
Queryfor unary dynamic/stored query execution.QueryStreamfor large result sets and long-running traversals.Insertfor mutation-oriented document/record ingestion.Searchfor streamed vector search results.Healthfor cheap readiness checks.The proto uses
bytesfor JSON payloads to preserve parity with the existing/v1/queryHTTP contract while giving gRPC users a stable typed transport.Related Issues
Addresses #780
Checklist when merging to main
rustfmthelix-cli/Cargo.tomlandhelixdb/Cargo.tomlAdditional Notes
Rust verification was run locally with
cargo fmt --all,cargo test --workspace, andcargo clippy --workspace -- -D warnings.The repo does not contain a literal
helixdb/Cargo.toml; the version bump was applied to thehelix-dbcrate insdks/rust/Cargo.toml.The crate uses
protoc-bin-vendoredinbuild.rs, so contributors and CI do not need a systemprotocinstallation.Greptile Summary
This PR introduces
helix-protocol, a new workspace crate that defines the versionedhelix.v1gRPC contract using Tonic/Prost, and extends the Rust SDK's#[register]macro with additional parameter types and comprehensive documentation.helix-protocolcrate: Addshelix/v1/helix.protowith five RPCs (Query,QueryStream,Insert,Search,Health), abuild.rsthat vendorsprotocviaprotoc-bin-vendored, and atransportfeature flag that gatestonic/transportfor client/server flexibility.helix-dsl-macrosgainsParamObject,ParamValue,BTreeMap/HashMapmap types, and improved recursive dynamic-value coercion with cleaner error paths.sdks/rust/src/lib.rsandsdks/rust/src/dsl.rsreceive extensive doc-comment coverage including runnable examples and a newclient_testsintegration module.Important Files Changed
Sequence Diagram
sequenceDiagram participant SDK as SDK / Client participant Tonic as helix-protocol<br/>(helix.v1.Helix) participant DB as HelixDB Server SDK->>Tonic: HelixClient::connect("http://localhost:6970") note over Tonic: gRPC over HTTP/2 SDK->>DB: Query(QueryRequest) DB-->>SDK: "QueryResponse { json: bytes }" SDK->>DB: QueryStream(QueryRequest) loop stream DB-->>SDK: "QueryChunk { sequence, json }" end DB-->>SDK: END_STREAM SDK->>DB: Insert(InsertRequest) DB-->>SDK: "MutationResponse { id?, affected, json? }" SDK->>DB: Search(SearchRequest) loop stream (ranked) DB-->>SDK: "SearchResult { id, score, json, sequence }" end DB-->>SDK: END_STREAM SDK->>DB: "Health(HealthRequest {})" DB-->>SDK: "HealthResponse { status, version, message }"Reviews (2): Last reviewed commit: "Address gRPC review feedback" | Re-trigger Greptile