Skip to content

fix(docs): fix version regex in assemble-versions.sh#1377

Open
hkad98 wants to merge 2 commits intogooddata:masterfrom
hkad98:jkd/docs-ci-build
Open

fix(docs): fix version regex in assemble-versions.sh#1377
hkad98 wants to merge 2 commits intogooddata:masterfrom
hkad98:jkd/docs-ci-build

Conversation

@hkad98
Copy link
Contributor

@hkad98 hkad98 commented Feb 27, 2026

Summary

  • Fix regex in assemble-versions.sh that finds the highest version directory to promote to /latest. The previous pattern ^[0-9]+$ only matched pure integers, but version directories are major.minor (e.g. 1.60). This caused the "promote to latest" step to find nothing, resulting in no /latest directory and a broken doc site. Updated to ^[0-9]+\.[0-9]+$ to match the original generate.sh behavior.

  • Cache three hot Hugo template partials identified via --templateMetrics, reducing build time by 29% (18.5s to 13.1s on 864 pages):

    • head-css.html: SCSS compilation repeated for all 860+ pages despite identical output. Pass .Site as context so partialCached shares a single cache entry.
    • structureddata.looker.html: iterated all site pages to build a title list on every render (O(n^2)). Extracted into a cached capital-titles.html partial (84s to 4s
      cumulative).
    • sidebar.html: SVG chevron icon loaded, minified, and string-replaced ~15k times inside the recursive nav template. Extracted into a cached chevron-svg.html partial.

…inor dirs

The regex '^[0-9]+$' only matched pure integers but version directories
are major.minor (e.g. 1.60). This caused the "promote to latest" step
to find nothing, breaking the latest symlink. Updated to match the
original generate.sh pattern '^[0-9]+\.[0-9]+$'.

jira: trivial
risk: nonprod
Add partialCached to three hot paths identified via --templateMetrics. head-css.html: SCSS compilation was repeated for all 860+ pages despite identical output. Pass .Site as context so partialCached shares a single cache entry (100% hit rate, was 0%). structureddata.looker.html: iterated ALL site pages to build a title list on every page render, O(n^2) total work. Extract the computation into a cached capital-titles.html partial (84s to 4s). sidebar.html: SVG chevron icon was loaded, minified, and string-replaced inside the recursive nav template (~15k invocations). Extract into cached chevron-svg.html partial (100% hit rate). Verified locally: before/after HTML output is byte-identical (diff -rq). Build time on 864 pages: 18.5s to 13.1s (29% faster).

JIRA: trivial
risk: nonprod
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