Skip to content

[UI] Migrate from yarn to bun - #1732

Merged
yili-db merged 13 commits into
unitycatalog:mainfrom
newfront:feat/migrate-to-bun
Aug 24, 2026
Merged

yili-db merged 13 commits into
unitycatalog:mainfrom
newfront:feat/migrate-to-bun

Conversation

@newfront

Copy link
Copy Markdown
Collaborator

PR Checklist

  • 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. (UI: Migrate off of yarn to bun for the UC UI #1731)
  • 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

Description of changes
This PR replaces yarn with bun. It captures the minimal changes needed to update the UI to be built with bun (supports npm, typescript, etc) and is defacto-standard in a lot of the ecosystem.

Issue Link

#1731

@newfront
newfront requested review from dennyglee and tdas as code owners July 29, 2026 19:00
newfront added 2 commits July 29, 2026 12:01
Bun replaces yarn as the package manager and script runner for the UI.
react-scripts still runs on Node, so the Docker image keeps its Node base
and copies the bun binary in from oven/bun.

The lockfile is resolved fresh rather than converted from yarn.lock: bun's
yarn.lock migration drops peer-dependency metadata, which hoisted
ajv-keywords@5 next to ajv@6 and broke the webpack build. Direct
dependencies stay pinned to the same exact versions; only transitive
versions move within their existing ranges.

Bun does not support yarn's nested resolutions, so the postcss and
nth-check security pins become flat overrides. Both now resolve to a
single deduped copy at or above the previously pinned version.

npm-run-all is dropped because run-p shells out to npm, which is absent
in a bun-only environment; the two codegen scripts now chain with bun run.
Adds a .dockerignore so a host node_modules cannot overwrite the image's
install with wrong-platform binaries.

Signed-off-by: Scott Haines <[email protected]>
@newfront
newfront force-pushed the feat/migrate-to-bun branch from e446a87 to 97856cf Compare July 29, 2026 19:02
@yili-db
yili-db requested a review from openinx July 29, 2026 20:36
@openinx

openinx commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

nit (PR description): Please paste the commit rationale into the PR body — fresh lock vs yarn migration, ajv/peer deps, flat overrides, drop npm-run-all, .dockerignore. That is the real “why.”

nit (title): Feat/migrate to bun → something like [UI] Migrate from yarn to bun.

@openinx openinx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comments on the blocking items and nits 1–2.

Comment thread .github/workflows/lint-check.yml Resolved
Comment thread ui/scripts/clean-bun-lock.ts Resolved
Comment thread helm/templates/ui/deployment.yaml Resolved
Comment thread ui/bunfig.toml Resolved
Comment thread ui/package.json Resolved
@newfront newfront changed the title Feat/migrate to bun [UI] Migrate from yarn to bun Jul 29, 2026
…versions of packages, and quality of life improvements for UI maintainers

Signed-off-by: Scott Haines <[email protected]>

@openinx openinx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me, but @newfront pls take a look at the failing github check. thank you for the work.

@tdas tdas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks fine. but please hold off on merging this PR until branch 0.6 is cut? i doesnt make sense to make such large changes so close to a release. changes like this usually needs some baking time.

@openinx @yili-db to do a detailed review.

@openinx

openinx commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Since branch-0.6 is cut, and I already did the review and approved. @yili-db do you want to take a look also ? let's wait for 1 day, if @yili-db don't have any more comment, I will merge it.

Thanks @tdas for the reviewing, and thanks @newfront for the great work.

@yili-db
yili-db merged commit 7cd1c58 into unitycatalog:main Aug 24, 2026
14 checks passed
@newfront
newfront deleted the feat/migrate-to-bun branch September 15, 2026 20:56
yili-db pushed a commit that referenced this pull request Oct 27, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/unitycatalog/unitycatalog/pull/2019/files) to
review incremental changes.
-
[**stack/ep3-helm-ci**](#2019)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2019/files)]
← _this PR_
-
[stack/ep3-helm-release](#2020)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2020/files/9090e88439087610b7240d3dd89c8464e6ac83d9..573a422bfdfcc8aa1e144e1a8d28c19879ed5b14)]
-
[stack/ep3-helm-docs](#2021)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2021/files/573a422bfdfcc8aa1e144e1a8d28c19879ed5b14..936a12fac01b260d4d3fa97706943c076c8ac757)]

---------
**Description of changes**

The UI moved from yarn to bun in #1732, but the Helm chart still starts
it with `yarn start`. Yarn 1 refuses to run in a project whose
`package.json` declares `packageManager: bun@…`. So with any UI image
built from today's `ui/`, the UI pod crash-loops and `helm install
--wait` times out.

This PR:

- starts the UI with `bun run start` when the image has bun, and with
`yarn start` otherwise. The UI stays on by default, as on main;
- adds a `helm test` hook that checks the server API, the UI page and
the UI's `/api` proxy. Its image is set by `test.image` (with
`test.imagePullSecrets`), so a mirrored registry can run it;
- adds a **Helm Chart Tests** workflow for pull requests that touch
`helm/`, `ui/` or the `Dockerfile`. It checks that the chart README is
current (helm-docs), runs `ct lint`, installs the chart on kind with
server and UI images built from the PR, and runs `helm test`;
- regenerates the chart README, which was missing the values added in
#1689 and #1690, and fixes two yamllint errors in `values.yaml`. The
yamllint fixes are whitespace only, and the parsed values are identical.

UI images built from today's `ui/` now start with bun. The published
`unitycatalog-ui:main` image (May 2025) predates bun and has only yarn,
so it keeps starting with yarn, and a default install or `helm upgrade`
from main keeps its UI. bun is checked first, because a bun image also
has yarn (from `node:18`), but yarn refuses to run there. Once each
release publishes a bun-based UI image (#2020, #2021), the yarn branch
can go.

**Tests:** on a local kind cluster, the unchanged chart crash-loops the
UI as described above. With this PR, the install is ready in about 30
seconds and `helm test` passes. CI installs the chart with its default
values, with server and UI images built from the PR. This stack changes
no JVM code, and the full `build/sbt test` suite passes locally.

<details><summary><b>📐 Design notes &amp; details</b></summary>

**Repro of the bug** (kind with Kubernetes 1.32, server image `v0.7.0`,
UI image built from `main`):

```
error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version of Yarn is 1.22.22.
```

With `bun run start`, the following all returned 200 through a
port-forward: the UI page, the server API, a read through the UI's
`/api` proxy, and creating and deleting a catalog and a schema through
that proxy.

**Why this workflow builds Docker images.** #1420 disabled the image
*publishing* workflows to protect their Docker Hub secrets. This
workflow builds images only to load them into a throwaway kind cluster:

- it pushes nothing and uses no secrets;
- `permissions: contents: read` and `persist-credentials: false`;
- it runs on `pull_request`, not `pull_request_target`;
- actions are pinned to commit SHAs and the helm-docs image to a digest;
- zizmor reports no findings for it.

**What the test checks.**

- The UI dev server enables its host check whenever it proxies the API.
In that mode it accepts `localhost`, `*.localhost` and IP addresses, and
rejects other hostnames such as the Service name (see #753). The test
sends `Host: localhost`, as a browser on `kubectl port-forward` does.
Ingress and HTTPRoute mode turn the proxy off, and the test then skips
the proxy check.
- With `auth.enabled`, the test has no token, so it checks only the UI
page. With auth on and the UI off, there is nothing to check, and no
test pod is rendered.
- A failed check prints which check failed, and CI runs `helm test
--logs` so the output reaches the job log. The test pod is kept after it
passes and replaced on the next run, because `--logs` reads it after the
test finishes.
- The test checks that the UI is served, not that the UI compiles: the
dev server serves `index.html` even after a compile error.
- Ingress and HTTPRoute installs aren't exercised, because they need a
controller in kind.

**Local limits.** This machine can't build the server image from source
(old Docker and kernel), so locally I ran the same steps with the
released `v0.7.0` server image. The first from-source build in this
workflow is this PR's CI run.

Tools: Helm 3.20.0, chart-testing-action 2.9.0 (ct 3.15.0), kind-action
1.15.1, helm-docs 1.14.2.

**Measured results** (kind, chart from this PR, UI on, images built from
the PR):

| Request | Status |
|---|---|
| server `GET /api/2.1/unity-catalog/catalogs` | 200 |
| UI `GET /` with `Host: localhost:3000` | 200, UI page |
| UI `GET /` with `Host: uc.example.com` | 200, but the body is `Invalid
Host header` (the dev server's rejection page, see #753) |
| through the UI: `GET /api/2.1/unity-catalog/catalogs` | 200 |
| through the UI: `POST /catalogs {"name": "ep3"}` | 200 |
| through the UI: the same `POST` again | 400 (already exists) |
| through the UI: `GET /catalogs/missing` | 404 |
| through the UI: `DELETE /catalogs/ep3` | 200 |
| unchanged chart (`yarn start`) | UI pod in CrashLoopBackOff; `helm
install --wait` times out |

**Security review: building images in CI again.** #1420 turned off the
workflows that built and pushed images, because they held Docker Hub
secrets. This workflow builds images again, for testing only. I reviewed
it, and also ran GLM 5.3 and Claude Opus reviews; every point below was
checked against the files, the actions at their pinned commits, and a CI
run.

*If a container in this job is compromised:*

| Where the bad code runs | What it can do |
|---|---|
| inside `docker build` (a base image, or an npm, Maven, apk or apt
package) | change the image under test; it gets no token and no secret |
| inside a kind pod (a chart helper image) | the same, unless it escapes
the pod |
| on the runner (helm, uv, ct, kind, helm-docs, or an escape from the
privileged kind node) | control this job: a read-only `GITHUB_TOKEN`, no
secrets, no way to push images, charts or code; it can make the test
pass or fail wrongly |

The one way out of the job was the GitHub Actions cache. A job running
on `main` writes caches that other workflows on `main` restore,
including the sbt and bun caches and `ai-review.yml`, which holds
secrets. So the workflow runs **only on pull requests**: a pull
request's caches are scoped to that pull request, and `main` never reads
them. A tampered helm-docs image could edit chart files before the
install, so the check now fails on any change under `helm/`, not only
`README.md`.

*Docker Hub credentials:* this workflow can't reach them under any
trigger. GitHub gives a job only the secrets it names, and this workflow
names none; pull requests from forks get no secrets at all. Before
anyone turns the old image workflows back on: they log in to Docker Hub
and use the `type=gha` build cache in the same job, so a poisoned cache
could reach the published images.

*Pinned inputs:* actions by commit SHA (`actions/checkout` at v7.0.1);
helm-docs, the Dockerfiles' base images and syntax frontend, the `helm
test` image and the kind node image
(`kindest/node:v1.37.0@sha256:a1ed…`) by digest; kind v0.33.0, kubectl
v1.37.1, helm v3.20.0 and uv 0.13.1 by version; the UI's npm packages by
`bun.lock`. The chart's other helper images still use `latest` here;
#2020 pins them. Not pinned, and pre-existing: `apk add bash` and
`apt-get install jq` during the image builds and `apk add` in the config
init container (signed packages, but versions move), and sbt's Maven
downloads and launcher jar (no hash lock).

*Follow-ups (not in this stack):* zizmor checks for all workflows.
Separately, the existing cache exposure this workflow avoids stays as it
is: `unit-tests.yml`, `lint-check.yml` and `cross-spark-build.yml` write
caches on `main`, and `ai-review.yml` restores caches while holding
secrets. zizmor's cache-poisoning audit doesn't flag the `ai-review.yml`
case (0 findings when run on it).

</details>

**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.
- [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

This pull request and its description were written by Isaac.

---------

Signed-off-by: Shubham Bansal <[email protected]>
Co-authored-by: Isaac <[email protected]>
@newfront newfront linked an issue Nov 12, 2026 that may be closed by this pull request
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.

[UI] Foundations for the new Unity Catalog Console "ui-new"

4 participants