Repository navigation
fix(ci): prune legacy assets/-prefixed entries from asset retention - #2926
Merged
Merged
Conversation
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.
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.
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.jsonreturn 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>.cssfiles. The current pipeline injects island CSS via JS (vite-plugin-css-injected-by-js,hugo-apps/vite.config.ts) and emits noassets/-prefixed bundles. Such a prior-manifest entry:hugo/static/{js,css}/, noassets/prefix), and/css/assets/…//js/assets/…) always 404s,so it lingered forever as an "immediately-prior build" entry that
mergeRetentionre-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/*.cssURL. This is purely a stale retention-list / smoke-flap bug.Fix
mergeRetentionnow drops any prior entry whosefilestarts withassets/. The generated_retained-assets.jsonis gitignored and regenerated on the next content rebuild / deploy, so this clears the stale entries with no manual JSON edit.Tests
mergeRetentionregression case: anassets/-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