Skip to content

[Helm] Start the UI with bun and test the chart install in CI - #2019

Merged
yili-db merged 7 commits into
unitycatalog:mainfrom
shba24:stack/ep3-helm-ci
Oct 27, 2026
Merged

yili-db merged 7 commits into
unitycatalog:mainfrom
shba24:stack/ep3-helm-ci

Conversation

@shba24

@shba24 shba24 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


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 Add configurable expiry for UC access tokens issued by token exchange #1689 and Support wildcard patterns in server.allowed-issuers and server.audiences #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.

📐 Design notes & details

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 Getting Invalid Host header error in browser with https URL #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).

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.
  • 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.

@shba24

shba24 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@shba24
shba24 force-pushed the stack/ep3-helm-ci branch 4 times, most recently from 067e6eb to a1a706e Compare October 19, 2026 22:30
@shba24
shba24 marked this pull request as ready for review October 19, 2026 23:34
@shba24
shba24 requested review from dennyglee and tdas as code owners October 19, 2026 23:34
@shba24

shba24 commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

AI review, run locally on the whole stack (#2019 → #2020 → #2021)

I ran this repository's AI reviewer locally: the six roles in .github/omnigent/reviewer (domain, two maintainer passes, architecture, test coverage, docs), then the disprove gate over their combined findings. The reviewers checked their claims with helm template, helm lint, ct lint, helm package and helm-docs.

Known and left as is: until a release publishes unitycatalog-ui:vX.Y.Z, an install from a checkout with ui.enabled=true runs the old :main UI image and can't start the UI (see #2020's description).

@yili-db

yili-db commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

/review

@yili-db
yili-db requested review from openinx and roeap October 20, 2026 23:07
@yili-db

yili-db commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Hi @roeap @newfront. Please take a look at this PR. Thank you!

@newfront newfront 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.

This looks good to me. :shipit:

@roeap roeap 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.

small nits, otherwise looking good.

Comment thread .github/workflows/helm-chart-tests.yml Resolved
Comment thread helm/values.yaml

# -- (string) PostgreSQL user password secret key
# @default -- password
passwordSecretKey: password

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.

hmm, not sure its a good practice to set a default password, if we need this for tests, lets overwrite the value in the helm deploy command there.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

passwordSecretKey isn't a password. It's the name of the key inside the Secret named by passwordSecretName: the chart reads the password with secretKeyRef: {name: passwordSecretName, key: passwordSecretKey} (server/deployment.yaml). passwordSecretName has no default, so no password is set out of the box. This line is unchanged from main; this PR only re-indents it to fix a yamllint error. CI uses H2, so it doesn't set either value.

@shba24
shba24 requested a review from roeap October 22, 2026 18:15

@roeap roeap 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.

LGTM

@yili-db yili-db 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.

[AI Assisted] Do we need to turn the UI off by default? A start command that falls back to yarn would fix the crash-loop without changing the default. Details inline. cc @newfront, since you did the bun migration.

Comment thread helm/templates/ui/deployment.yaml Resolved
@shba24
shba24 force-pushed the stack/ep3-helm-ci branch from 18a9a46 to 1743734 Compare October 26, 2026 17:03
@shba24
shba24 requested a review from yili-db October 26, 2026 17:05
shba24 and others added 4 commits October 26, 2026 22:19
The UI moved from yarn to bun (unitycatalog#1732), but the chart still starts it with
`yarn start`. Yarn 1 refuses to run because package.json declares
`packageManager: bun@...`, so the UI pod crash-loops on any image built
from the current ui/ directory. The published unitycatalog-ui:main image
(May 2025) predates bun and still needs `yarn start`, so after this change
the chart needs a UI image built from today's ui/; the next PR pins one.

- Start the UI with `bun run start`.
- Add a Helm test hook that checks the server API, the UI page and the
  UI's /api proxy (API checks only when auth is off), and names the
  check that failed. Its busybox image is pinned by digest.
- Add a Helm Chart Tests workflow for pull requests: helm-docs freshness
  (failing on any change under helm/), ct lint, and a helm install plus
  helm test on kind with server and UI images built from the same commit.
  It uses no secrets, runs only on pull requests so it can't write caches
  that main reads, and pins uv, kind, the kind node image and kubectl.
- Regenerate the chart README (it missed the unitycatalog#1689/unitycatalog#1690 values) and fix
  the two yamllint errors in values.yaml (whitespace only).

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
The published unitycatalog-ui:main image predates bun, so with bun run start a default install
would crash-loop the UI pod until a release publishes a bun-based UI image. A default install now
runs only the server; set ui.enabled=true for the UI. CI sets it, so the chart test still checks
the UI.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
…ute example

The helm test pod image now comes from test.image, with test.imagePullSecrets, so a mirrored
registry can run helm test. values.httproute.yaml turns the UI on, because the example serves the
API and the UI on one hostname and the UI is now off by default.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
CI regenerates the README with helm-docs v1.14.2, and the README footer records that version, so
a README made with another local version still fails the check. The message now points to the
pre-commit hook, which pins the same version.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
shba24 and others added 2 commits October 26, 2026 22:19
Pinned by commit SHA, like the other actions in the workflow.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
A call that connects but never gets an answer now fails after 5 seconds,
so the retry loop can try again.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
@shba24
shba24 force-pushed the stack/ep3-helm-ci branch from 1743734 to 583eaca Compare October 26, 2026 22:19
@yili-db

yili-db commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

/review

The published unitycatalog-ui:main image predates bun and only has yarn,
so the start command uses bun when the image has it and yarn otherwise.
That keeps a default install and helm upgrade working on today's image,
so ui.enabled stays true, as on main.

Co-authored-by: Isaac <[email protected]>
Signed-off-by: Shubham Bansal <[email protected]>
@yili-db
yili-db merged commit dcad0aa into unitycatalog:main Oct 27, 2026
16 checks passed
yili-db pushed a commit that referenced this pull request Oct 27, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/unitycatalog/unitycatalog/pull/2020/files) to
review incremental changes.
-
[**stack/ep3-helm-release**](#2020)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2020/files)]
← _this PR_
-
[stack/ep3-helm-docs](#2021)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2021/files/22d5742dcd3de2ec7784ec335f32eb4aca321559..dc242459fb5b9bf7e5ddd757cb988fad092be25e)]
-
[stack/ep3-helm-graceful-shutdown](#2060)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2060/files/dc242459fb5b9bf7e5ddd757cb988fad092be25e..21484d93c12f0b49af7b37cb86f5905983d85588)]
-
[stack/ep14-helm-readyz](#2063)
[[Files
changed](https://github.com/unitycatalog/unitycatalog/pull/2063/files/21484d93c12f0b49af7b37cb86f5905983d85588..c2bc7a8976ff0757c1b79d22724a4df534608453)]

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

The chart has been version `0.0.1-pre.1` with app version `main` since
May 2025. A default install therefore runs the `main` server image, a
March 2026 development build, and there is no published chart: users
clone the repository and install from the folder (#1058, #1025).

This PR makes the chart releasable:

- **Published name:** the chart is named `unitycatalog-chart`, to be
published at
`oci://registry-1.docker.io/unitycatalog/unitycatalog-chart`. Docker Hub
stores a chart in a repository named after the chart, and
`unitycatalog/unitycatalog` already holds the server image.
- **Versions from the release:** `Chart.yaml` keeps placeholder
versions. `helm/package-chart.sh X.Y.Z` packages chart X.Y.Z with app
version `vX.Y.Z`, so a release chart runs that release's server image by
default. It rejects a version with a leading `v`, which would point at a
`vvX.Y.Z` image.
- **UI version:** the UI image keeps the chart's default tag, the app
version. Chart X.Y.Z runs `unitycatalog/unitycatalog:vX.Y.Z` and
`unitycatalog/unitycatalog-ui:vX.Y.Z`, and each release publishes both.
- **README:** install from the OCI registry, which needs Helm 3.8 or
later.
- **Package contents:** `.helmignore` excludes `*.sh`, so
`package-chart.sh` and `generate-docs.sh` don't ship in the published
chart. The README drops the version badges, which showed the `0.0.0-dev`
and `main` placeholders in a released chart.
- **CI:** the workflow packages the chart with the same script and
installs that package. Both image tags come only from the version the
script stamps.
- **Pinned helper images:** the Alpine and busybox helper images move
from `latest` to `alpine:3.24.2` and `busybox:1.37.0`, pinned by digest,
so every install of a release runs the same images. Each release updates
them to the latest stable release (step in #2021's `RELEASING.md`).

**User impact.** The published chart is named `unitycatalog-chart`, but
resource names don't change: the name helpers fall back to
`unitycatalog`, the chart's old name, instead of the chart name. Release
`unitycatalog` still creates `unitycatalog-server`, so an install from a
cloned folder upgrades in place and keeps its database volume and
signing key, with no `nameOverride`. The default is in the helpers
rather than `values.yaml`, so a `helm upgrade --reuse-values` keeps it
too. I checked with `helm template` that `main`'s chart and this one
give the same resource names, apart from the new test pod.

**Before the first release.** Docker Hub has only `unitycatalog-ui:main`
(May 2025, which predates bun), which the chart starts with yarn
(#2019). Each release publishes `unitycatalog-ui:vX.Y.Z`, built with bun
(steps in #2021); 0.8.0 is the first.

**Tests:** on kind, the chart packaged by `package-chart.sh 0.0.0-ci`
ran `unitycatalog:v0.0.0-ci` (built from source) and
`unitycatalog-ui:v0.0.0-ci` with no tag override, and `helm test`
passed. CI installs that package with the chart's default values, so the
UI runs too. `package-chart.sh` rejects `v0.8.0`, `0.8` and `foo`, and
accepts `0.8.0`, `0.8.0-rc0` and `0.0.0-ci`.

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

**Why placeholders instead of keeping `Chart.yaml` in sync with
`version.sbt`.** The release version passed to the script is the only
source, so there's no second file to keep in sync and nothing to
compare. The Unity Catalog images rendered after packaging 0.7.0:

```
unitycatalog/unitycatalog:v0.7.0
unitycatalog/unitycatalog-ui:v0.7.0
```

**Why chart version = Unity Catalog version.** A user who asks for chart
0.8.1 expects server 0.8.1. The cost is that a chart-only fix ships with
the next release.

**Why the UI uses the server's version.** Releases are published by
hand. A separate UI version would add a decision and a pin bump to every
release, and CI couldn't test a pinned tag before it was published.
Rebuilding an unchanged UI image for a release takes a few minutes.

**Why not a separate Docker Hub namespace for charts** (for example
`unitycatalogcharts/unitycatalog`):

- Docker Hub namespaces allow only lowercase letters and digits, and
repositories can't be nested.
- The `unitycatalog` organization's open-source program benefits apply
per organization, and a new organization would start without them.

**CI step.** Both images are loaded into kind only as
`unitycatalog:v0.0.0-ci` and `unitycatalog-ui:v0.0.0-ci`, with
`pullPolicy: Never`. If the stamping broke (for example, the app version
stayed `main`), the pods couldn't start and the install would fail.

**Pinned helper images.** The chart's helper images used `latest`, so CI
and every install could pull different bytes from one run to the next.
Tags move too: `busybox:1.37.0` was rebuilt under the same tag on
2026-09-23. They are now pinned by digest: `alpine:3.24.2@sha256:294b…`
for the config init container and the create-users job, and
`busybox:1.37.0@sha256:bdf5…` for the UI init container. The config init
container still runs `apk add` at start (signed packages; versions
follow Alpine 3.24); building those tools into an image is a separate
change (#1019). The security review of the CI build is in #2019.

**Measured with auth on** (kind, `auth.users` set): the create-users job
ran on the pinned Alpine, created `[email protected]` and granted CREATE
CATALOG. `GET /api/2.1/unity-catalog/catalogs` returned 401 without a
token and 401 with a forged token.

</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]>
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.

4 participants