fix(cdn): fingerprint joule.css + sap-fundamental.css (dual-emit) [#1605] - #1611
Merged
Conversation
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.
Why
Follow-up to #1601 / #1603 (CSS fingerprinting) and the 2026-08-10 giant-logo incident. Two stylesheets were still referenced by hardcoded bare path and so were NOT fingerprinted — leaving them exposed to the same CDN stale-edge bug (fresh HTML pairing with an edge-cached stale stylesheet under a stable
/css/<name>.cssURL):joule.css—baseof.htmlsap-fundamental.css—head.html+scanner-vue/list.htmlCloses #1605.
Two corrections to the issue's premises (found during recon)
assets/copy ofsap-fundamental.csswas NOT a usable equivalent.hugo/assets/css/sap-fundamental.css(76 KB) was the uncompiled@importsource; the shippedhugo/static/css/sap-fundamental.css(807 KB) was the compiled output ofnpm run build:css. Fingerprinting the source as-is would ship a browser-broken (@import 'fundamental-styles/dist/...') stylesheet. This PR fingerprints the compiled bytes.<head>. Catalog/mission/group/concept pages render through Hugo's published__shell__(the_shelllayout wrapsbaseof.html→head.html), so fingerprintinghead.htmlautomatically flows the hashed URL into CAP-served pages. The hardcoded/css/sap-fundamental.cssincontent-store.js/concept-list-page.jsis only the rare degraded fallback — left bare intentionally.What — single-source dual-emit
Each stylesheet lives once in
hugo/assets/css/. The layout links a| fingerprint(hashed) URL and calls Hugo'sResource.Publishto also emit the bare/css/<name>.css. So:__shell__link the edge-safe hashed URL.app/admin-shell/webapp/index.html), the scanner layout, the CAP degraded-fallback renderers, and the joule smoke tests.sap-fundamental.css's@importsource is renamedsap-fundamental.src.css;build:cssnow compiles it intohugo/assets/css/sap-fundamental.css(committed compiled bytes —npm run devrunshugo serverwith no CSS build step and depends on the committed file, exactly as before).Changed
package.json—build:cssretargeted to…src.css → hugo/assets/css/sap-fundamental.csshugo/assets/css/sap-fundamental.src.css— renamed@importsource (+ drift-guard header)hugo/assets/css/sap-fundamental.css— regenerated committed compiled byteshugo/static/css/sap-fundamental.css— deletedhugo/static/css/joule.css→hugo/assets/css/joule.css— movedhugo/layouts/_default/baseof.html,partials/head.html,scanner-vue/list.html— dual-emittest/hugo-css-fingerprint.test.js— new guard testdocs/developers/architecture/{cdn-caching,build}.md— doc updatesDeliberately untouched
srv/lib/content-store.js,srv/lib/concept-list-page.js,app/admin-shell/webapp/index.html, and both joule smoke tests keep their bare/css/*paths —.Publishguarantees those files still exist.Verification
npm run build:css && hugo --minifybuild confirms dual-emit inhugo/public: both<name>.cssand<name>.<hash>.cssemit; rendered pages link only the hashed URLs (zero bare<link>s); the published baresap-fundamental.cssis the compiled form.hugo-step-badges.test.js: 24/24 pass.Note
This is the durable fix; JS islands (
/js/*) remain un-fingerprinted (tracked separately as the gate for raising the static-asset TTL to immutable). See #1604 + the CDN cache-policy umbrella item.