Skip to content

fix(rebuild): propagate deployed CSS hash + real xref titles to HANA pages - #3092

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-fix-demo-samples-render
Nov 10, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-fix-demo-samples-render

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #3091. Verifying the directive-demo fixes on DEV surfaced two rebuild-pipeline gaps that blocked the fixes from reaching HANA-served pages:

1. sync-approuter-css.cjs self-perpetuating stale-hash loop

A CSS-only source change ships on deploy (build:css rotates the fingerprinted file, and the new file is served), but the rebuild's CSS-sync step scrapes the served hash from a live page, re-pins Hugo to it, and republishes — and since all pages are HANA-served and stale, it re-pins the old hash forever. The console line-wrap fix (863da9b0…) deployed but every page kept referencing 9dbb07c7….

Fix: build from source first; if the approuter already serves the source-built hash (200), keep the source build. Propagates the new CSS and cannot 404 (the deploy shipped that exact file). Falls through to the unchanged #2920 sync path when source is ahead of the deploy — preserving the anti-drift invariant that step exists for.

2. xref / prereq cards showed raw slug instead of title

On slug-targeted rebuilds the referenced tutorial's <slug>.md isn't fetched to CACHE_DIR, so catalogBySlug fell back to slug-as-title. Fix: thread tutorials[].title through fetchBuildCatalog → CatalogTutorialMeta, and seed catalogBySlug from the CAP /build/catalog titles (every slug has one). On-disk frontmatter still overrides where cached.

Verification

  • Against live DEV: source CSS hash 863da9b0… (the fix) is served 200 by the approuter → prefer-source path keeps it.
  • Tests: 70/70 directive + new catalog-title test pass.

Next

After merge → DEV, a content rebuild for the 4 directive demos will finally land the console-scroll CSS + real xref/prereq titles on DEV. Then DEV→main + PROD.

…pages

Two gaps found while verifying the directive-demo fixes on DEV:

1. sync-approuter-css.cjs self-perpetuating stale-hash loop: a CSS-only SOURCE
   change ships on deploy (build:css rotates the fingerprinted file, which IS
   served), but every rebuild re-pins the OLD hash it scrapes from still-stale
   HANA pages — so the new CSS never reaches published pages. Fix: build from
   source first, and if the approuter already SERVES the source-built hash (200),
   keep the source build. This propagates the new CSS AND cannot 404 (the deploy
   shipped that exact file). Falls through to the #2920 sync path unchanged when
   source is ahead of the deploy (preserves the anti-drift invariant).

2. xref/prereq cards rendered the raw slug instead of the tutorial title on
   slug-targeted rebuilds — the referenced tutorial's <slug>.md isn't fetched to
   CACHE_DIR, so catalogBySlug fell back to slug-as-title. Fix: thread
   tutorials[].title through fetchBuildCatalog → CatalogTutorialMeta, and seed
   catalogBySlug from the CAP catalog titles (on-disk frontmatter still overrides
   where cached). The CAP /build/catalog carries a title for EVERY slug.

Verified against live DEV: source CSS hash 863da9b0 (console line-wrap fix) is
served 200 by the approuter → prefer-source path keeps it. 70/70 directive +
catalog tests pass.
@jung-thomas
jung-thomas merged commit 51b3b86 into DEV Nov 10, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-demo-samples-render branch November 10, 2026 19:14
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