Skip to content

build: stop committing the admin UI bundle; build it in CI, Docker and releases - #137

Merged
ngoyal16 merged 4 commits into
mainfrom
build/ui-not-committed
Nov 23, 2026
Merged

ngoyal16 merged 4 commits into
mainfrom
build/ui-not-committed

Conversation

@ngoyal16

@ngoyal16 ngoyal16 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The built admin UI (internal/admin/ui, about 600 KB, 36 commits) was committed so that a plain go build had it. As a result, nearly every UI PR conflicted with the next one over the hashed bundle.

Changes

  • Not committed any more. internal/admin/ui/* is in .gitignore, except internal/admin/ui/.keep, which keeps //go:embed all:ui compiling on a fresh checkout. web/public/.keep puts it back after each Vite build (Vite empties the folder), so git status stays clean.
  • Dockerfile: a node:24-bookworm-slim stage runs npm ci && npm run build, and the output is copied in before go build. .dockerignore drops any local build.
  • GoReleaser: make web in the before hooks, so the release binaries embed the UI. It relies on the Node.js that GitHub's Ubuntu runners include; Vite 6 needs Node 18 or later.
  • CI: both shared workflows build the UI first, through new optional inputs in divmora/.github (feat(ci): optional build step before the Go checks .github#25, merge it first): ci.yml and docker-publish.yml pass node-version: '24', node-cache-dependency-path: web/package-lock.json and pre-build-command: make web. The stale-bundle check is gone, and no console-specific CI job is added.
  • Makefile: build, test, test-db and lint build the UI first when internal/admin/ui/index.html is missing.
  • Without the UI: a binary built that way starts, and /admin shows "The admin UI isn't in this build", with how to build it, instead of panicking at start-up. go test of the admin package says "run make web" instead of failing test by test.
  • README and AGENTS.md are updated.

Checked

  • A fresh worktree with only .keep passes go vet and go build.
  • go test ./... and golangci-lint v2.15.0 pass with the UI built.
  • docker build succeeds. The image's binary embeds the real bundle (assets/index-…, theme.js).

Note

Merge this after #121 and #122: they still carry bundle changes, and this PR deletes the bundle. If they land first, this PR only needs main merged in.

🤖 Generated with Claude Code

ngoyal16 and others added 3 commits November 23, 2026 19:59
…d releases

The built admin UI (internal/admin/ui, about 600 KB) was committed so a
plain go build had it, which made nearly every UI change conflict with
the next. It is now ignored, except internal/admin/ui/.keep (restored by
web/public/.keep on each build) so go:embed still compiles.

- Dockerfile: a node:24 stage builds the UI, copied in before go build.
- GoReleaser: make web in the before hooks.
- CI: the console's own Go job (like the org go-ci workflow, same pinned
  golangci-lint) builds the UI first; the stale-bundle check is gone.
- Makefile: build, test, test-db and lint build the UI when it's missing.
- A binary built without the UI starts and serves a page saying how to
  build it, instead of panicking; the admin tests say to run make web.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The org docker-publish workflow's Go quality job ran lint and tests
without building the admin UI, which is no longer committed, so the
admin tests failed there. ci.yml runs the same lint and tests with the
UI built on every PR and push; the image build runs when the quality
job is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Back to divmora/.github's go-ci.yml and docker-publish.yml, which now
take node-version, node-cache-dependency-path and pre-build-command
(divmora/.github#25): make web runs before lint and tests in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ngoyal16
ngoyal16 merged commit b006c73 into main Nov 23, 2026
11 checks passed
@ngoyal16
ngoyal16 deleted the build/ui-not-committed branch November 23, 2026 15:47
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.

1 participant