Repository navigation
[UI] Format ui-new/web with Prettier - #2292
Merged
Merged
Conversation
bun run test:format fails on main: 39 files under ui-new/web/src predate the package's Prettier check. Apply the package's own `bun run format` to them. Each file is now exactly Prettier's output of its previous version, so nothing changes at runtime. Landing this on its own keeps the reformatting out of unitycatalog#2262. Signed-off-by: Scott Haines <[email protected]> Co-authored-by: Isaac <[email protected]>
Collaborator
Author
|
/review |
roeap
approved these changes
Nov 19, 2026
2 of 4 tasks
newfront
added a commit
that referenced
this pull request
Nov 19, 2026
…2262) **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. (No separate issue; follow-up to #2190.) - [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. (ui-new is documented in `ui-new/README.md`, updated here.) ## Summary Follow-up to #2190. This consolidates the ui-new RPC implementation, reduces duplicated request handling, and rejects malformed upstream responses instead of constructing incomplete objects. The Prettier reformatting it used to carry landed separately in #2292. ### Changes - Share one `UiRpc` implementation across the typed services and register the control-plane proxy through the generated Connect service. - Share one upstream round trip (`Upstream::send`) between the typed services and the proxy: header forwarding, the caller's deadline, and the size-limited read. - Cap client-asserted deadlines at the bridge's 30-second upstream limit. - Use borrowed protobuf request views instead of cloning entire requests. - Validate required object identities, positive model-version numbers, and `table_type` when mapping UC responses. - Bound the table and metric-view RPCs to their own kind. Both share UC's `/tables/{full_name}` resource, so each typed get and delete reads the kind first. - Preserve auth/CSRF header forwarding and propagate multiple `Set-Cookie` headers. - Reject invalid configuration values at startup instead of silently falling back. - Simplify the web test harness around typed service implementations and share query-parameter conversion. ## Compatibility and behavior changes The Java REST API and OpenAPI specifications are unchanged. ui-new has not shipped, so the SPA/bridge contract changes below need no migration, but they do change behavior: - **Protobuf contract:** unused response fields and enums are removed outright, without reservations. A Call body's `serverUrl` or `token` keys are now ignored; `main` rejected them with 400. The bridge always uses its configured `UC_SERVER`, and a bearer token travels only in the Authorization header. - **SPA hosting:** the bridge no longer serves the SPA, and `WEB_DIST` is gone. Vite or a separate web server must serve the SPA, proxy bridge requests, and fall back to `index.html` for client-side routes. - **Definition limits:** function and metric-view definitions are limited to 1 MiB of UTF-8 (`max_bytes`). That narrows `main`'s 16,777,215-character limit, which matches UC's columns, and removes the 128 MiB request-limit overrides on those two routes. Requests use Connect's default 4 MiB limit, so a definition that JSON escaping expands past 4 MiB is rejected by the transport rather than the rule; for example, control characters escape to 6 bytes each. Either way it fails closed. - **Table and metric-view kinds:** - `DeleteTable` and `DeleteView` read the resource before deleting it. The wrong kind returns `FAILED_PRECONDITION` and deletes nothing. - `GetTable` and `GetView` name the actual kind in their `NOT_FOUND`. - A reply with no known `table_type` is `INTERNAL` in list, get, and delete, and nothing is deleted. - UC's delete takes only the name, so the check is best effort against a concurrent drop-and-recreate. - **Delete controls:** on every detail page, the button, dialog title, and success toast name their type (for example, "Delete metric view"). - **Deadlines:** a client's `Connect-Timeout-Ms` is clamped to the bridge's 30-second upstream limit, which also applies when the client sends none. Typed RPCs on `main` honored any client value. - **Error codes:** an oversized UC response is `internal` instead of `resource_exhausted` (HTTP 429). Proxy body-read failures map to `unavailable` or `deadline_exceeded`, as the typed services' do. - **Configuration:** an invalid or empty `PORT` or `*_ENABLED` value, or a non-Unicode `ALLOWED_ORIGINS`, stops the bridge with an error naming the variable. ## Validation Checked on this branch: - `bun run proto:check`, `bun run typecheck`, `bun run test:format`, and `bun run build` passed. - Web coverage passed: 193 tests, 95.4% line coverage. - Rust: `cargo test --locked` passed (50 tests); `cargo fmt --check` passed. - Against a disposable `unitycatalog:v0.8.0-SNAPSHOT` server through this branch's bridge: created a catalog, schema, external table, and metric view; confirmed wrong-kind gets and deletes were refused and both objects survived; deleted each through its own service; and listed catalogs with a 10-minute `Connect-Timeout-Ms`. All 19 checks passed. - Signed-out reads against a remote, auth-enabled UC over HTTPS returned `unauthenticated`, as expected. ## Dependencies Updates rustls from 0.23.43 to 0.23.45, which fixes RUSTSEC-2026-0285. ## Stack This PR targets `main` after #2190 and #2292. Follow-up branches, each depending on the previous one: 1. `feat/add-ui-docker-environments` 2. `chore/add-ui-web-validation-tests` 3. `chore/add-jwt-copy-btn` This pull request and its description were written by Isaac. --------- Signed-off-by: Scott Haines <[email protected]> Co-authored-by: Isaac <[email protected]>
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 updated. (No feature change.)Description of changes
bun run test:formatfails onmain: 39 files underui-new/web/srcpredate the package's Prettier check. This applies the package's ownbun run formatto them and changes nothing else.Why now: #2262 carried this reformatting alongside its bridge changes, which made 38 of its 51 web files formatting-only. Landing it separately keeps #2262 reviewable; once this merges, #2262 is rebased and those hunks drop out.
No behavior change:
main(checked file by file).src/gen,routeTree.gen.ts).Validation, run locally in
ui-new/web(CI does not runui-newchecks):bun run test:format: passes (was 39 files flagged).bun run typecheck,bun run test(188 tests), andbun run build: pass.This pull request and its description were written by Isaac.