Skip to content

Re-vendor api.proto (201 -> 236 RPCs) and update testkit stubs - #1

Merged
nicolaslara merged 2 commits into
mainfrom
chore/resync-api-proto
Aug 8, 2026
Merged

Re-vendor api.proto (201 -> 236 RPCs) and update testkit stubs#1
nicolaslara merged 2 commits into
mainfrom
chore/resync-api-proto

Conversation

@nicolaslara

Copy link
Copy Markdown
Owner

What

Re-syncs the vendored api.proto in modal-rust-sdk and modal-rust-testkit with upstream (modal-labs/modal-client @ 1d53eec296, 2026-08-07). The previous copy dated to 2026-06-03 — 88 upstream commits stale (+543/−12 lines).

Changes

  • Both proto/api.proto copies: byte-exact re-vendor; testkit copy keeps its one-line "keep in sync" header.
  • 35 new RPCs (201 → 236): Webhook token family, Image tags/publish, Sandbox V2 (name/tags/list/restore/exit-snapshot/connect-token), Environment roles/budget, billing summaries, … Each gets a mock_unimplemented! arm in servicer.rs.
  • AppRollback now returns AppRollbackResponse (was Empty) — stub signature corrected.
  • environment_get_or_create stub: EnvironmentMetadata gained environment_type; fill via ..Default::default() so additive fields don't break it again.
  • proto/SOURCE.toml (new): upstream repo/path/commit provenance + re-vendoring steps.
  • README/doc-comment RPC counts refreshed.

Breaking upstream field changes with no call sites here (verified): FunctionGetInputsRequest.max_values/average_call_timereserved, SandboxGetCommandRouterAccessRequest.sandbox_idoneof target, Sandbox.experimental_options[deprecated].

modal-rust-testkit is publish = false, so the published surface change is only modal-rust-sdk's regenerated tonic client.

Verification (local, pinned 1.96.0)

  • cargo fmt --check / git diff --check
  • cargo clippy --all-targets -- -D warnings + light-facade clippy
  • cargo test (default-members) and cargo test -p modal-rust-testkit -p modal-rust-sdk — 188 passed, 0 failed
  • Coverage reconciles exactly: 192 unary + 11 stream stubs + 33 hand-written = 236 RPCs

🤖 Generated with Claude Code

nicolaslara and others added 2 commits August 7, 2026 16:41
The vendored `api.proto` in both crates was a byte-exact copy of the upstream
client proto from 2026-06-03 (modal @ cc549d52c5) — 88 upstream commits stale,
+543/-12 lines.

Additive: 35 new RPCs on `service ModalClient` (Webhook token family, Image
tags/publish, Sandbox V2 name/tags/list/restore/exit-snapshot, Environment
roles/budget, billing summaries, …), 201 -> 236.

Breaking, and why each is handled:
- `AppRollback` returns `AppRollbackResponse`, no longer `google.protobuf.Empty`
  — stub signature corrected.
- 35 new RPCs leave `MockServicer`'s `impl ModalClient` incomplete — one
  `mock_unimplemented!` arm added per RPC, merged into the sorted block.
- `FunctionGetInputsRequest.max_values`/`average_call_time` are now `reserved`,
  `SandboxGetCommandRouterAccessRequest.sandbox_id` moved into a `oneof target`,
  and `Sandbox.experimental_options` is `[deprecated]` (superseded by
  `experimental_options_v2`). No call site touches any of them; the SDK's
  `max_values` is `FunctionGetOutputsRequest`'s, which is unchanged.

Coverage reconciles exactly: 192 unary + 11 stream stubs + 33 hand-written
= 236 = the RPC count in the proto, with no colliding method names.

`proto/SOURCE.toml` records the upstream revision and the re-vendoring steps.
The source is `modal-labs/modal-client` (the public Python-client mirror), whose
`modal_proto/api.proto` is byte-identical to the private monorepo's copy — so
re-vendoring needs no credentials. The PyPI `modal` wheel is not usable for
this: 1.5.3 ships `api_pb2.py` but no `.proto`.

`modal-rust-testkit` is `publish = false`, so the published surface change is
only `modal-rust-sdk`'s regenerated tonic client.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ined environment_type

The re-vendored proto added `environment_type` to `EnvironmentMetadata`; the
hand-written stub built it with an exhaustive struct literal (E0063). Fill the
new field via `..Default::default()` so future additive fields don't break
this stub again.

Verified locally on the pinned 1.96.0 toolchain: cargo fmt --check, clippy
--all-targets -D warnings, clippy -p modal-rust -p modal-rust-macros, cargo
test (default-members), and cargo test -p modal-rust-testkit -p modal-rust-sdk
(188 tests) — all green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nicolaslara
nicolaslara merged commit 9b2525a into main Aug 8, 2026
1 check 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