Repository navigation
[UI] ui-new: implement typed RPC services in the Rust bridge - #2189
Merged
Merged
Conversation
3 of 4 tasks
Signed-off-by: Scott Haines <[email protected]>
protoc-gen-protovalidate-buffa 0.8.0 expands CEL `matches()` (used by the securable_name and storage_path predefined rules) into code that names `::regex::Regex` directly, while the standard `pattern` rule uses the `protovalidate_buffa::regex` re-export. Without a direct dependency the generated validators fail to compile. Codegen 0.10.1+ uses the re-export for both, so this can be dropped when the generator is upgraded. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
ListTables and ListViews kept requesting upstream pages until one held a matching table type. A schema dominated by the other type cost one UC call per page with no bound, and only an immediately repeated token was caught, so a token cycle could loop until the client deadline. Return each UC page filtered to the service's table type with its next_page_token. A page can now be empty while more results remain; the proto comments say callers follow page tokens. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
The bridge mapped a timeout while sending to deadline_exceeded, but a timeout or connection error while reading the response body became internal "Invalid response from Unity Catalog server". Both paths now share one mapping: timeouts are deadline_exceeded, other transport failures are unavailable. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
- Map each UC error_code / code key and HTTP status fallback to its Connect code, including a non-JSON error body and an unreachable UC. - Make the delete type-guard test fail if the guard is removed: no DELETE may reach UC, and the error names the object. - Drive the Call allowlist from allowed and denied rows (method mismatch, smuggled query, extra or dot segments, encoded slashes, unknown securable type) and check denied calls never reach UC. - Assert Cookie forwarding on typed services and the Call form body and content type. - Test that ListTables omits metric views. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
Most catalog, schema, volume, function, and model RPCs had no test of the request they translate to. Drive one table of RPC requests through the router and require the exact UC method, percent-encoded path, query parameters, and JSON body, including model version paths, the finalize body, force flags, and an empty volume comment. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
The table, view, volume, function, and model services each defined the same catalog.schema.name formatter. Keep one object_full_name in services/mod.rs. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
README.md and AGENTS.md still described the bridge as a single generic passthrough with contract-only typed services, and told contributors to add no per-endpoint handlers. Describe the implemented services, the narrowed Call allowlist, and Cookie/Authorization forwarding. The Rust build now runs Buf, so list it as a prerequisite and install the web dependencies before the first cargo run. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
CreateView discarded the YAML parser error, so a user only saw "Invalid metric view YAML definition". Append the parser's message, which names the line and column without echoing the definition. Co-authored-by: Isaac <[email protected]> Signed-off-by: Scott Haines <[email protected]>
newfront
force-pushed
the
feat/add-rpc-server
branch
from
November 12, 2026 16:55
6ab60fd to
c5bb41f
Compare
roeap
approved these changes
Nov 12, 2026
roeap
left a comment
Collaborator
There was a problem hiding this comment.
left some minor comments that can be follow ups as well... since most of this is also codegen ... LGTM.
| "input_params": { "parameters": parameters }, | ||
| "data_type": return_type.name, | ||
| "full_data_type": return_type.text, | ||
| "routine_body": "SQL", |
Collaborator
There was a problem hiding this comment.
i this correct to always do SQL, or could thos be a python body as well?
| Ok(Response::new(ListFunctionsResponse { | ||
| functions, | ||
| page: mapping::page(&value).into(), | ||
| ..Default::default() |
Collaborator
There was a problem hiding this comment.
is this just for the __buffa system fields? It might not be too critical, but somehow i was worried that this can swallow fields we need? But its perobably fine?
| let large_request_limits = Limits::default() | ||
| .with_max_request_body_size(128 * 1024 * 1024) | ||
| .with_max_message_size(80 * 1024 * 1024) | ||
| .with_element_memory_limit(96 * 1024 * 1024); |
| #[derive(Clone)] | ||
| pub(crate) struct Upstream { | ||
| state: AppState, | ||
| } |
Collaborator
There was a problem hiding this comment.
once uc-rs is live, we should use the published client.
This was
linked to
issues
Nov 17, 2026
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.
PR Checklist
Description of changes
This PR implements the typed
uc.v1Connect services from #2040 in the ui-new Rust bridge (ui-new/server). The bridge checks every request against the proto's protovalidate rules before calling the Unity Catalog REST API, then converts UC's responses and errors back into Connect responses.server/src/services/, served at/uc.v1.<Service>/<Method>.build.rsgenerates the Rust types and validators fromui-new/protoat build time (buffa, connectrpc, protoc-gen-protovalidate-buffa). The build runs Buf, fromweb/node_modulesorPATH, so the README now lists it as a prerequisite.services/builds the UC request bodies, including column type metadata and positions for table and view creation, and the fixed fields UC requires for SQL functions.mapping.rsconverts UC's JSON responses into proto messages.upstream.rs: a shared UC client that forwards the caller'sCookieandAuthorizationheaders and caps UC responses at 32 MiB. It times out after 30 s, or at the caller's Connect deadline when one is set. It maps UC error codes and HTTP statuses to Connect codes; for example,*_ALREADY_EXISTSbecomesalready_existsand a timeout becomesdeadline_exceeded.TableServiceandViewServiceeach return one UC page filtered to their own table type, so a page can be empty whilenext_page_tokenis set. Get and delete returnnot_foundfor the other type. Creating a metric view checks its YAML definition and requires the columns to match its fields.CreateFunctionandCreateViewaccept request bodies up to 128 MiB, because their definitions may be up to 16,777,215 characters.Callpassthrough: now limited to the endpoints that have no typed service yet: SCIMMe, auth tokens and logout, and permission reads. It rejects a client-suppliedserver_url, which is now deprecated. It now forwardsAuthorizationas well asCookie, and caps responses at 4 MiB.CreateTableRequestrejects column names that differ only by case, andUpdateVolumeRequest.commentcan now be set to empty.regexdependency: code generated by protoc-gen-protovalidate-buffa 0.8.0 for CELmatches()needs a directregexdependency. It can be removed after upgrading the generator to 0.10.1+.ui-new/README.mdandui-new/AGENTS.mdnow describe the typed services and the narrowed passthrough.Stack
main, which includes the [UI] ui-new: add typed RPC protobuf definitions and validation rules #2040 protobuf contracts. All 9 commits here belong to this PR.Callare rejected; ui-new has no active users yet.Tracking issue: #1888
Tests
tests/services.rs(20 tests):tests/proxy.rs(9 tests): theCallallowlist as allowed and denied rows, including method mismatches, a smuggled query, extra or dot segments, and encoded slashes. Also the client-chosen upstream and the forwarded body, content type, and cookies.cargo test --locked(29 passed),cargo fmt --check,bun run typecheck,bun run test:coverage(79 passed),bun run build.Compatibility
Affects ui-new only. There are no changes to the UC server, its REST API, or
api/all.yaml.CallRequest.server_urlis deprecated, and requests that set it are rejected.