Repository navigation
commands: Rebuild assets also mounted as static - #15567
Conversation
Keep static synchronization and also invalidate assets when a changed file belongs to both filesystems. Cover both mount directions with server tests for edits and deletion. Fixes gohugoio#7740 Co-authored-by: Didier Divinerites <divinerites@gmail.com> Co-authored-by: Joe Mooring <joe.mooring@veriphor.com>
|
The Ubuntu job stopped during Investigation uncovered an independently reproducible defect: Could a maintainer rerun the failed Ubuntu job and triage #15568? My account cannot rerun upstream workflows or apply the |
Files mounted into both
staticandassetsare classified only as static changes by the server watcher. Editing them copies the static file but leaves cached resources and their consumers unchanged, so fingerprinted CSS keeps its old URL and content until a full build.Keep static synchronization and also rebuild when the changed file belongs to the assets filesystem. Add server regression tests for both mount directions, covering edits and deletion while checking the page URL and both published CSS files.
This intentionally does not change fingerprint semantics, mount precedence, or the handling of files used only as static resources. The pre-existing missing-resource cache behavior after deleting and recreating an asset is outside this change.
Validation on macOS arm64 with Go 1.27.2:
./check.shstaticcheck ./...(2026.2.2)CI_LOCAL=true go test . -run '^TestServer$' -parallel 2 -count=1CI_LOCAL=true go test -race . -run 'TestServer/server__mounted_resource_' -parallel 2 -count=3Both regression cases fail on base
bdde5aa51at the updated fingerprint assertion. Windows CI passed. Ubuntu passed the main andcommandstest suites, but the job failed inTestTailwindCSSImportContextduringnpm installwithENOTEMPTYwhile removingnode_modules/tapable/lib, before the Tailwind assertion ran. Failed job. A rerun requires upstream permissions.The regression cases are adapted from the reports by @divinerites and @jmooring; both are credited as co-authors.
OpenAI Codex was used for investigation, implementation, regression tests, automated validation, and preparation of this PR.
Fixes #7740