Skip to content

fix(ci): prune legacy assets/-prefixed entries from asset retention - #2926

Merged
jung-thomas merged 1 commit into
DEVfrom
fix-retained-assets-stale-prune
Oct 25, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
fix-retained-assets-stale-prune

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

The post-deploy asset-retention smoke gate (test/smoke/asset-retention.smoke.test.js) flaps on a healthy deploy: 5 island CSS bundles in _retained-assets.json return 404 on the approuter —
nav-dropdown-*.css, mini-navigator-*.css, app-space-*.css, event-display-*.css, navigator-*.css.

Root cause

Old Vite layouts emitted island CSS as separate assets/<name>-<hash>.css files. The current pipeline injects island CSS via JS (vite-plugin-css-injected-by-js, hugo-apps/vite.config.ts) and emits no assets/-prefixed bundles. Such a prior-manifest entry:

  • can never match a current-build file (current files live directly under hugo/static/{js,css}/, no assets/ prefix), and
  • its carry-forward download (/css/assets/… / /js/assets/…) always 404s,

so it lingered forever as an "immediately-prior build" entry that mergeRetention re-carried every build, and the smoke gate kept flagging it.

No user impact: island CSS is JS-injected, so no page ever fetches an assets/*.css URL. This is purely a stale retention-list / smoke-flap bug.

Fix

mergeRetention now drops any prior entry whose file starts with assets/. The generated _retained-assets.json is gitignored and regenerated on the next content rebuild / deploy, so this clears the stale entries with no manual JSON edit.

Tests

  • New mergeRetention regression case: an assets/-prefixed entry is pruned even when it looks like it was in the immediately-prior build, while a normal prior bundle still carries forward.
  • test/unit/asset-retention.test.js — 11 pass. test/unit/retain-asset-bundles.test.js — 9 pass.

CI-only; no runtime/srv change.

🤖 Generated with Claude Code

The asset-retention smoke gate flapped on 5 island CSS bundles
(nav-dropdown/mini-navigator/app-space/event-display/navigator) that 404 on
the approuter. Root cause: old Vite layouts emitted island CSS as separate
assets/<name>-<hash>.css files; the current pipeline injects island CSS via JS
(vite-plugin-css-injected-by-js) and emits NO assets/-prefixed bundles. Such a
prior-manifest entry can never match a current file, and its carry-forward
download (/css/assets/... or /js/assets/...) always 404s, so it lingered forever
as an 'immediately-prior build' entry that mergeRetention re-carried every build.

mergeRetention now drops any prior entry whose file starts with 'assets/' — the
current build references nothing under that prefix. The generated
_retained-assets.json is gitignored and regenerated on the next content rebuild /
deploy, so this clears the stale entries without a manual JSON edit. No user
impact (island CSS is JS-injected; nothing fetched those URLs) — this just stops
the post-deploy smoke gate flapping on a healthy deploy.

Adds a mergeRetention regression test.
@jung-thomas
jung-thomas merged commit 0ea9133 into DEV Oct 25, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the fix-retained-assets-stale-prune branch October 25, 2026 14:13
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