Skip to content

Upgrade Hugo to 0.163.3 and add Playwright E2E tests - #731

Draft
rossigee wants to merge 5 commits into
goharbor:mainfrom
rossigee:docs/dockerfile-display
Draft

Upgrade Hugo to 0.163.3 and add Playwright E2E tests#731
rossigee wants to merge 5 commits into
goharbor:mainfrom
rossigee:docs/dockerfile-display

Conversation

@rossigee

Copy link
Copy Markdown

Summary

  • Upgrade Hugo from 0.74.0 (2020) to 0.163.3 (latest stable)
  • Fix breaking changes: markdownify on template.HTML, disableKinds taxonomy rename, mediaTypes config, toCSS → css.Sass
  • Add Playwright E2E test suite validating breaking changes are fixed
  • Update npm dependencies to latest versions (autoprefixer, bulma, postcss-cli)
  • Add GitHub Actions test workflow for CI/CD
  • Fix .gitignore to not track generated cli-docs content

Test plan

✅ All 5 Playwright E2E tests passing
✅ Production build succeeds
✅ _redirects file generated correctly
✅ CSS pipeline works with updated packages
✅ No npm audit vulnerabilities
✅ All commits signed-off (DCO)

Files changed

  • Hugo version pins: netlify.toml, Dockerfile
  • Template fixes: layouts/partials/admonition.html, layouts/partials/css.html
  • Configuration: config.toml (disableKinds, mediaTypes)
  • Tests: e2e/breaking-changes.spec.ts, playwright.config.ts
  • CI/CD: .github/workflows/test.yml
  • Dependencies: package.json (npm packages and Playwright test suite)
  • Documentation: README.md, Makefile
  • Cleanup: Removed unused version.html shortcode, cli-docs from git tracking

@rossigee
rossigee requested review from a team as code owners June 30, 2026 11:42
@rossigee
rossigee force-pushed the docs/dockerfile-display branch 3 times, most recently from 3021477 to 9f2d002 Compare June 30, 2026 11:50
@rossigee
rossigee marked this pull request as draft June 30, 2026 12:00
@rossigee
rossigee force-pushed the docs/dockerfile-display branch 2 times, most recently from ddc7f70 to f147c85 Compare June 30, 2026 23:36
@rossigee

Copy link
Copy Markdown
Author

Other than the Netlify failures and the weird 'conflict' claims here, and despite the huge six year gap the upgrades have covered, the branch itself actually works well running locally and compares well with the live site.

Right now, I need some assistance understanding the remaining Netlify failures and why GitHub insists these files are conflicts despite them not showing as such locally or from a fresh checkout. My AI agents can't figure it out and think GH has something cached, and sugggest raising a new PR, but I'm not so sure about the explanation, and I tried it once (#730) and it made no difference.

@rossigee
rossigee force-pushed the docs/dockerfile-display branch from 873773f to b5a7481 Compare July 1, 2026 01:01
@OrlinVasilev

Copy link
Copy Markdown
Member

thank you for that contribution can you slipt that in to few PRs ?:)

rossigee added 5 commits July 20, 2026 13:35
… tracking generated cli-docs

- kentaro-m/auto-assign-action v1.2.4 -> v2.1.2
- autoprefixer 9.7.4 -> 10.5.2, postcss-cli 7.1.2 -> 11.0.1 (fixes
  npm audit picomatch ReDoS advisory)
- content/cli-docs/ is regenerated on every build by cli-docs.sh but
  was committed to git, causing spurious diffs each time it runs.
  Add it to .gitignore and untrack the 109 already-committed files.

Verified: postcss-cli 11 + autoprefixer 10 process CSS correctly
(existing postcss.config.js unchanged), npm audit reports zero
vulnerabilities after the bump.

Signed-off-by: Ross Golder <ross@golder.org>
Breaking changes fixed:
- markdownify on template.HTML: cast with `| string |` in admonition.html
- disableKinds: rename taxonomyTerm to term in config.toml
- mediaTypes: replace delimiter with suffixes array
- toCSS -> css.Sass, .Site.IsServer -> hugo.IsServer in css.html
- Remove unused version.html shortcode

Bulma 1.0.4 drops LibSass support, so this also:
- Installs Dart Sass via scripts/setup-dart-sass.sh (Hugo needs the
  real executable, not the npm JS wrapper), invoked from `make serve`
  and exported onto PATH from the Makefile for production builds
- Rewrites assets/sass/*.sass into a single style.scss, loading
  Bulma's precompiled CSS via CDN (its own Sass build no longer
  needs LibSass/Dart Sass) and layering only site-specific
  overrides/CSS custom properties on top
- Removes yarn.lock in favor of npm (package-lock.json only)
- Adds a Dockerfile pinned to Hugo 0.163.3 + Node 20 for local/CI
  parity with Netlify

Note: layouts/partials/{navbar,social-buttons}.html,
layouts/_default/baseof.html, layouts/partials/docs/{menu,sidebar}.html
are intentionally untouched here - upstream/main already carries its
own .File nil-guards and its own dark-mode/theme-toggle and CLI-docs
nav features (added independently since this work was branched), so
re-copying the stale versions from the original PR branch would have
reverted already-shipped upstream work.

Verified: `make production-build` succeeds cleanly against current
upstream/main (2261 pages, 0 errors, only pre-existing deprecation
warnings unrelated to this change).

Signed-off-by: Ross Golder <ross@golder.org>
The single-file style.scss rewrite dropped these two partials
entirely, even though the JS/HTML wiring for both features (navbar's
theme-toggle partial, javascript.html's table-popout.js) was left
untouched and still upstream-correct. Result: both features would
still activate at runtime but render completely unstyled, since their
source .sass files were no longer imported by anything once
style.sass was replaced.

Converts the indented Sass syntax to SCSS and folds the content
directly into style.scss rather than keeping them as separate
imports. table-popout.sass's `outline: 2px solid $primary` (a Bulma
Sass variable, unavailable now that Bulma is loaded via CDN rather
than compiled from source) is replaced with the equivalent
hsl(var(--bulma-primary-h), var(--bulma-primary-s),
var(--bulma-primary-l)) already used elsewhere in this file for the
same color.

Verified by compiling the resulting style.scss directly with Dart
Sass (bypassing Hugo/PostCSS, which are hitting an unrelated
environment-level Node permission issue in this sandbox): 712 lines
of output, dark-mode and table-popout selectors all present, the
outline substitution resolves correctly.

Signed-off-by: Ross Golder <ross@golder.org>
- e2e/breaking-changes.spec.ts covers the four breaking-change fixes
  from the Hugo/Bulma upgrade: admonition markdownify, disableKinds
  taxonomy/term pages, the _redirects custom output format, and the
  css.Sass CSS pipeline (fingerprinted output, computed styles applied)
- .github/workflows/test.yml: build -> test -> lint pipeline, Hugo
  0.163.3 pinned via peaceiris/actions-hugo, Playwright browsers
  installed in CI
- make test / make test-ui targets, README section documenting them
- .gitignore: test-results/, playwright-report/

Built on top of the Hugo/Bulma upgrade branch since these tests
assert against its output (fingerprinted CSS, css.Sass pipeline,
disableKinds behavior) and would fail against current upstream/main.

Note: local `make production-build` in this sandbox intermittently
fails with a Node permission-model error inside autoprefixer's
browserslist parent-directory walk, unrelated to any code here - it
reproduced identically on the unmodified Hugo/Bulma upgrade branch
that had built successfully minutes earlier in the same session, with
no dependency or code change in between. Treating it as an
environment artifact rather than a real defect; worth a clean re-run
in CI to confirm.

Signed-off-by: Ross Golder <ross@golder.org>
Same class of breaking change as the docs/ partials: these two
templates (added by goharbor#645, after the Hugo upgrade work
was originally branched) never got the .File nil-guard that Hugo
0.163 requires. Broke the /cli-docs section outright once
content/cli-docs stopped being tracked in git and started coming
purely from cli-docs.sh's generated output at build time - the
section index page has no .File, and Hugo 0.163 errors instead of
Hugo 0.74's more lenient handling.

Verified: full `make production-build` succeeds (2150 pages, 0
errors), /cli-docs renders.

Signed-off-by: Ross Golder <ross@golder.org>
@rossigee

Copy link
Copy Markdown
Author

@OrlinVasilev per your request, this has been split into three independently reviewable PRs:

Suggested landing order: #744 -> #745 -> #746.

Along the way, rebuilding these against current main surfaced that this branch had drifted significantly since it was originally opened (25+ commits behind by the time of the split), including changes that would have reverted already-shipped work like the dark-mode toggle (#703) and the table-popout feature (#693) had it been merged as-is. The three PRs above are rebuilt fresh off current main and fold in fixes for that (e.g. porting the dark-mode/table-popout CSS into the new stylesheet, and a .File nil-guard fix in layouts/partials/cli-docs/* needed for Hugo 0.163 that this branch also hadn't picked up).

Leaving this PR open for reference/history; happy to close it once the three above land, or sooner if you'd prefer.

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.

5 participants