Render the changed docs pages on a rig with contrib docs-preview

Closes #31 (closed)

just contrib docs-preview renders only the documentation pages a change touched, from the working tree, on a rig, and prints each rendered page's path. The preview stays on the rig and goes with it.

flowchart LR
  A[working tree] -->|files differing from the merge-base| B[changed doc and docs pages]
  B -->|tar over ssh| C[rig]
  C --> D[docs at the merge-base plus the changed pages]
  D -->|hugo --renderSegments| E[rendered index.html per changed page]
  E --> F[path printed, one line per page]
  B -.->|none| G[no docs pages changed, exit 0]

Render path

The docs site's own Hugo build, read from its Makefile, mise.toml and the docs-lint job in gitlab-org/gitlab: hugo --environment test over the project's doc/ tree, with a one-entry changed segment (--renderSegments changed) so only the changed pages render. It needs the pinned Hugo and the site's icon step, not make view, the data build, the frontend build or a monorepo checkout. The base docs come from one archive call at the merge-base sha, so no token goes to the rig.

Not rendered: the frontend bundle, so pages have no site JavaScript. Section pages (_index.md) are matched as section, pages as page.

Plain rig

--no-gitlab was refused without an accelerator. A docs preview needs git and a shell, so the gate is gone and the engine self-test now asserts a plain rig completes, creates no accelerator and installs no GitLab.

Live proof on one GCE rig

A real gitlab-org/gitlab working tree, doc/user/profile/preferences.md with a marker line appended:

  • one line printed, doc/user/profile/preferences.md to .../preview/user/profile/preferences/index.html
  • the marker found once in that file; find -name '*.html' over the preview lists that one page and nothing else
  • render 3.9 s in Hugo, 9 to 14 s end to end on a warm rig
  • with the edit reverted: no docs pages changed, exit 0
  • the rig torn down; the instance, snapshot, disk and address lists filtered by sim-docs print nothing

The word budget stays under its ceiling. Skill-scan counts are the local scan's, in their own commit; hosted CI is the reference.

Merge request reports

Loading
Loading