Repository navigation
build: stop committing the admin UI bundle; build it in CI, Docker and releases - #137
Merged
Merged
Conversation
…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>
# Conflicts: # internal/admin/ui/index.html
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>
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.
The built admin UI (
internal/admin/ui, about 600 KB, 36 commits) was committed so that a plaingo buildhad it. As a result, nearly every UI PR conflicted with the next one over the hashed bundle.Changes
internal/admin/ui/*is in.gitignore, exceptinternal/admin/ui/.keep, which keeps//go:embed all:uicompiling on a fresh checkout.web/public/.keepputs it back after each Vite build (Vite empties the folder), sogit statusstays clean.node:24-bookworm-slimstage runsnpm ci && npm run build, and the output is copied in beforego build..dockerignoredrops any local build.make webin 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.ymlanddocker-publish.ymlpassnode-version: '24',node-cache-dependency-path: web/package-lock.jsonandpre-build-command: make web. The stale-bundle check is gone, and no console-specific CI job is added.build,test,test-dbandlintbuild the UI first wheninternal/admin/ui/index.htmlis missing./adminshows "The admin UI isn't in this build", with how to build it, instead of panicking at start-up.go testof the admin package says "runmake web" instead of failing test by test.Checked
.keeppassesgo vetandgo build.go test ./...and golangci-lint v2.15.0 pass with the UI built.docker buildsucceeds. 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