Repository navigation
Conversation
Vendors the five specs from googleapis/google-cloud-go/bigtable/docs/specs
verbatim:
- SESSION_SPEC.md — per-Session lifecycle (10 invariants)
- SESSION_CLIENT_SPEC.md — SessionClient topology/config/handshake (4 invariants)
- SESSION_POOL_SPEC.md — pool topology, picking, routing, scaling (5 invariants)
- SESSION_COMPONENT_SPEC.md — 12 boundary MUSTs + ownership matrix
- CLIENT_SIDE_METRICS_SPEC.md — per-attempt metrics field provenance (3 invariants)
Adds SESSION_PORT_PLAN.md, the Rust-port design record: full scope
(direct-access checker only is excluded), proto strategy (vendor
session.proto + tonic-build), module layout mirroring Go's
internal/{transport,session} + debugview + internal/metrics, 12-PR
layered sequence (~22.6k LoC est.), and risks.
Bottom of a 12-PR stack. Subsequent PRs land the implementation
layer-by-layer per SESSION_PORT_PLAN.md.
Vendors google/bigtable/v2/session.proto + its transitive .proto dependencies (data.proto, types.proto, request_stats.proto, feature_flags.proto, peer_info.proto, response_params.proto plus google/api/* and google/rpc/*) at bigtable_rs/proto/, taken verbatim from googleapis/googleapis@main. Adds a `sessions` Cargo feature (default-off). When enabled, build.rs compiles session.proto via tonic-prost-build. Types from imported .proto files are redirected via extern_path to their existing generated equivalents in `googleapis-tonic-google-bigtable-v2` and `googleapis-tonic-google-rpc` — the resulting `session_proto` module contains only the session-family types (OpenSessionRequest, CloseSessionRequest, GetClientConfigurationRequest, GoAwayResponse, SessionRefreshConfig, and their nested messages). Includes a smoke test (`tests/session_proto_smoke.rs`, feature-gated) that asserts every session-critical type is generated and that the extern-path bindings match the third-party crate's types. Existing `BigTable`/`BigTableConnection` API unchanged; users who don't enable `sessions` pay no protoc build cost. Rationale and PR sequence in SESSION_PORT_PLAN.md. Stacked on: `sessions/design-record` (PR #0 of the stack). Followed by: session lifecycle (PR liufuyang#2).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
=======================================
- Coverage 63.8% 59.1% -4.6%
=======================================
Files 6 6
Lines 513 594 +81
=======================================
+ Hits 327 351 +24
- Misses 186 243 +57
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
5 tasks done
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.
Summary
Second in the stack. Vendors
google/bigtable/v2/session.protoand its transitive proto dependencies fromgoogleapis/googleapis, and addstonic-buildunder a newsessionsCargo feature so the session-family types (OpenSessionRequest,CloseSessionRequest,GetClientConfigurationRequest,GoAwayResponse,SessionRefreshConfig, and their inner messages) are generated at build time.Stacked on #154 (design record). The branch is layered on top of
sessions/design-record, so this PR's diff currently includes both the spec/plan commits from #154 and the proto changes from this PR. Once #154 merges, I'll rebase this branch ontomainand the diff will collapse to just the proto changes.Changes
bigtable_rs/proto/google/{bigtable/v2,api,rpc,type}/(verbatim from googleapis@main)build.rscompiles onlysession.proto— all types defined in imported .protos (data.proto, types.proto, request_stats.proto, feature_flags.proto, peer_info.proto, response_params.proto) are redirected viaextern_pathto their existing generated equivalents ingoogleapis-tonic-google-bigtable-v2andgoogleapis-tonic-google-rpc. No duplicate type generation.bigtable_rs::session_proto(hidden from public docs; will be consumed by later PRs)sessionsCargo feature (default-off) — users who don't opt in pay zero protoc build costtests/session_proto_smoke.rs) asserts every session-critical type is generated and that extern-path types resolve to the third-party crate's typesRationale
The upstream
googleapis-tonic-google-bigtable-v2crate does not yet publish the session envelope types (verified against v0.36.0), but the.protofiles are public ingoogleapis/googleapis. Vendoring + generating locally is the shortest unblocking path; when upstream regenerates, we can swap to their types with anextern_pathchange (no callers affected).Test plan
cargo build --package bigtable_rs(default features) — succeeds, unchanged behaviorcargo build --package bigtable_rs --features sessions— succeeds, generates session_protocargo test --package bigtable_rs --lib— 2/2 pass (existing tests)cargo test --package bigtable_rs --features sessions --test session_proto_smoke— 2/2 passcargo fmt --check— cleanStack
SESSION_PORT_PLAN.md🤖 Generated with Claude Code