Repository navigation
[UI] ui-new: add typed RPC protobuf definitions and validation rules - #2040
Merged
Merged
Conversation
newfront
requested review from
dennyglee,
roeap,
tdas and
yili-db
as code owners
October 23, 2026 21:47
Collaborator
Author
|
This PR introduces RPC definitions for the code UC apis, and implementations for the server/web services in the new ui architecture. These will be useful for driving agentic UIs and interesting ways of working in the future as well. FYI - @roeap |
newfront
force-pushed
the
feat/create-rpc-definitions
branch
from
November 4, 2026 20:31
3a41e07 to
08bb20f
Compare
Collaborator
|
/review |
roeap
reviewed
Nov 11, 2026
roeap
left a comment
Collaborator
There was a problem hiding this comment.
just a couple of question on some validation rules.
…c java service Signed-off-by: Scott Haines <[email protected]>
Address review feedback on the uc.v1 validation rules by using
protovalidate's standard rules and CEL extension functions instead of
hand-written regular expressions.
- Add uc/v1/predefined_string_rules.proto with two predefined rules that
mirror the UC Java server:
- securable_name: ValidationUtils.validateSqlObjectName (1-255 of
letters, digits, '_', '-', '@'; a leading '_' is legal).
- storage_path: isUriRef() plus the UriScheme allowlist (s3, gs, abfs,
abfss, file, or a scheme-less local path) and a non-empty bucket.
http(s) stays rejected because UC does not support it.
- Apply securable_name to every ref, create name, and new_name field, and
storage_path to storage_root and ExternalStorageLocation.
- Express the ExternalStorageLocation hardening as named CEL rules
(no '.'/'..' segments; no '?', '#', '%'). The bucket-root check is left
to UC, which already rejects it for tables and volumes.
- Keep the standard pattern rule on the Dependency oneof members:
protovalidate-buffa 0.8 cannot apply CEL or predefined rules to oneof
members.
- Replace internal "Branch 2" wording with "the bridge" and document that
per-request max_results caps match each endpoint's maximum in
api/all.yaml.
Verified with buf lint/build, @bufbuild/protovalidate 1.3.0, and the Rust
bridge (cargo test plus a 55-case rule probe) at the stack tip.
Restacking requires two downstream follow-ups: pass a registry with
file_uc_v1_predefined_string_rules to createValidator() in
web/src/lib/validation.ts, and add a direct regex dependency to the
bridge (or upgrade protoc-gen-protovalidate-buffa to >= 0.10.1).
Co-authored-by: Isaac <[email protected]>
Signed-off-by: Scott Haines <[email protected]>
newfront
force-pushed
the
feat/create-rpc-definitions
branch
from
November 11, 2026 20:16
35b3077 to
66b508e
Compare
This was referenced Nov 11, 2026
roeap
approved these changes
Nov 12, 2026
roeap
left a comment
Collaborator
There was a problem hiding this comment.
LGTM - once we worked through the stack, we'll have to do some more exploratory testing as well :).
newfront
added a commit
that referenced
this pull request
Nov 12, 2026
## PR Checklist - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in docs is updated (tracked in #1953) ## Description of changes This PR implements the typed `uc.v1` Connect 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. - **Services:** Catalog, Schema, Table, Volume, Function, Model, and View services under `server/src/services/`, served at `/uc.v1.<Service>/<Method>`. - **Generated code:** `build.rs` generates the Rust types and validators from `ui-new/proto` at build time (buffa, connectrpc, protoc-gen-protovalidate-buffa). The build runs Buf, from `web/node_modules` or `PATH`, so the README now lists it as a prerequisite. - **Requests to UC:** `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.rs` converts UC's JSON responses into proto messages. - **`upstream.rs`:** a shared UC client that forwards the caller's `Cookie` and `Authorization` headers 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_EXISTS` becomes `already_exists` and a timeout becomes `deadline_exceeded`. - **Tables vs. metric views:** both share UC's tables API. `TableService` and `ViewService` each return one UC page filtered to their own table type, so a page can be empty while `next_page_token` is set. Get and delete return `not_found` for the other type. Creating a metric view checks its YAML definition and requires the columns to match its fields. - **Request size:** `CreateFunction` and `CreateView` accept request bodies up to 128 MiB, because their definitions may be up to 16,777,215 characters. - **`Call` passthrough:** now limited to the endpoints that have no typed service yet: SCIM `Me`, auth tokens and logout, and permission reads. It rejects a client-supplied `server_url`, which is now deprecated. It now forwards `Authorization` as well as `Cookie`, and caps responses at 4 MiB. - **Proto changes:** `CreateTableRequest` rejects column names that differ only by case, and `UpdateVolumeRequest.comment` can now be set to empty. - **`regex` dependency:** code generated by protoc-gen-protovalidate-buffa 0.8.0 for CEL `matches()` needs a direct `regex` dependency. It can be removed after upgrading the generator to 0.10.1+. - **Docs:** `ui-new/README.md` and `ui-new/AGENTS.md` now describe the typed services and the narrowed passthrough. ## Stack - Based on `main`, which includes the #2040 protobuf contracts. All 9 commits here belong to this PR. - Next: #2190 moves the web UI onto these services. Until it lands, the web UI's data requests through `Call` are rejected; ui-new has no active users yet. Tracking issue: #1888 ## Tests - `tests/services.rs` (20 tests): - validation runs before anything is sent to UC - a table of RPCs, each checked against the exact UC method, path, query, and body - auth and cookie forwarding, and pagination - column metadata derivation and metric-view YAML checks - list filtering by table type - delete guards that never send the DELETE - UC error codes, HTTP statuses, and transport failures (unreachable UC, body-read timeout) mapped to Connect codes - `tests/proxy.rs` (9 tests): the `Call` allowlist 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. - Ran: `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_url` is deprecated, and requests that set it are rejected. --------- Signed-off-by: Scott Haines <[email protected]> Co-authored-by: Isaac <[email protected]>
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
docsis updatedDescription of changes
This PR moves from the client-side typescript service to the client<>server separation of concerns for the new UI. This allows us to protect the calls that go to the Unity Catalog server from this new environment. This PR introduces protovalidate into equation as well. This allows us to add automatic validation for RPC methods across the RPC surfaces.
These changes will not affect any active users of the new UI. There are another 7 PRs before this gets into a stable state.
Tracking Issue
Tracking github issue: #1888
Upstream PR
given I can't stack PRs in this environment, the ideal case is that PR 1902 is merged first, and then this PR can be rebased off of main to create a better "stack-like" experience.
#1902
Tests
This PR introduces a config test for the routes exposed by the main UI. There is a full suite of tests coming with this branch's PR (https://github.com/newfront/unitycatalog/tree/chore/add-ui-web-validation-tests)
Docs
The docs issue is tracked here #1953