fix(build): rebuild when the embedded dashboard changes
The build task's only sources were **/*.go, go.mod and go.sum, while ui/embed.go embeds the committed bundle with //go:embed all:dist. Task's up-to-date check is a content checksum over files, so a change to ui/dist -- including the one `task ui` writes in place -- left the task "up to date" and the previously embedded dashboard in every binary. Measured on this worktree, appending a byte to ui/dist/index.html: git status M ui/dist/index.html task build task: Task "build" is up to date grep <marker> bin/archied 0 <- stale asset shipped With ui/dist/** listed, the same probe rebuilds all six binaries and the marker is present; a nested asset (ui/dist/assets/index.css) does too. Reverting the probe rebuilds again, and a second build with nothing changed still reports "up to date", so the content cache is intact. touch-only changes do not retrigger, confirming the check is on content rather than mtime. deployment_contract_test.go gains a bounded test over the build task's sources block, the shape the neighbouring fmt assertion already uses. The version stamps in the same task stay out of reach of a file checksum: git describe moves with HEAD while no file content does, and the git metadata is not addressable from a worktree, where .git is a file. That needs a status/stamp design decision, so it is split to archie-core-pdq2.
This commit is contained in:
1 parent
8b27037641
commit
66b07a4b46
2 files changed
+35
No files matched your search
@@ -375,6 +375,9 @@ tasks:
|
||||
- "**/*.go"
|
||||
- go.mod
|
||||
- go.sum
|
||||
# ui/dist is committed and embedded by ui/embed.go (//go:embed all:dist),
|
||||
# so it is a build input even though no .go file names it.
|
||||
- "ui/dist/**"
|
||||
generates:
|
||||
- "{{.BIN_DIR}}/archied"
|
||||
- "{{.BIN_DIR}}/archie-gateway"
|
||||
|
||||
Reference in new issue
Block a user