Skip to content

feat(site): bundle public repo docs at build time (RIG-9139) - #73

Merged
mattwilkinsonn merged 3 commits into
mainfrom
web/rig-9139-bundle-public-repo-docs-at-build-time
Nov 12, 2026
Merged

mattwilkinsonn merged 3 commits into
mainfrom
web/rig-9139-bundle-public-repo-docs-at-build-time

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 3 PRs:

  1. main
  2. "feat(site): bundle public repo docs at build time (RIG-9139)" (this PR)
  3. test(site): cover docs fetch clone paths against a local bare repo (RIG-9686) #74
  4. feat(site): re-add meissa to the bundled sources (RIG-9685) #75

Summary

The public docs site bundles markdown from our public repos at build time. Each build fetches every source's main over anonymous HTTPS, bundles it with @rigelbuild/docs-bundle 1.2.0, and runs a reference gate over the built output before deploy. The build holds no credential, so a private source fails the fetch.

  • site/scripts/fetch.ts: shallow sparse clone per source; writes fetched.json; honors DOCS_BUNDLE_PINS.
  • site/scripts/gather.ts, bundle-routes.ts: bundle and route each source under its mount.
  • site/scripts/ref-gate-dist.ts: reference gate over site/dist.
  • site/sources.json: the public source list.
  • deploy.yml, ci.yml, hk.pkl pre-push: fetch before build; gate before deploy; daily schedule.
  • Also drops two Q1 sources that do not fetch anonymously (one archived and private, one does not resolve), adds compass-forge-testbed, and aligns two stripFirstH1 tests with docs-bundle 1.2.0.

Not in this change: failing the build on a broken link in the repo's own pages (it only warns).

Follow-ups: RIG-9685 (re-add meissa after its testdata is excluded), RIG-9686 (fetch clone-path tests).

Verification

On an Azure dev-offload VM:

  • bun test site: 52 pass, 0 fail (main: 36). bun run fetch && bun run build && bun run ref-gate:dist: pass.
  • biome check: clean.
  • tsc: four DeployEnv errors in deploy.ts, the same four as main.

Also drops RigelBuild/meissa until its testdata is excluded upstream. Adds a sidebar group per source.

Not verified: a real deploy.

Risks

  • A private or renamed source blocks the deploy, by design.
  • compass-forge-testbed shows encoded README text until fixed upstream.

Refs RIG-9139

Co-authored-by: Matt Wilkinson matt@rigel.build

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Nov 11, 2026

Copy link
Copy Markdown

RIG-9139

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Rigel public design docs preview: https://web-rig-9139-bundle-public-r.docs-2ui.pages.dev

Deployed from web/rig-9139-bundle-public-repo-docs-at-build-time at ebf2022.

Strip source frontmatter, keep link suffixes, add per-source nav, drop
meissa until its testdata is excluded, and harden the fetch env.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review round 1 (head 66b8887): 1 high, 4 medium, 5 low.

  • High, source frontmatter: fixed. Frontmatter is stripped and used as the fallback title. Invalid YAML (a real case in terraform-provider-googleworkspace) is stripped instead of failing the build. Covered by tests.
  • Meissa testdata: meissa is dropped from sources.json until meissa excludes **/testdata/** upstream.
  • No nav for sources: fixed. There is a sidebar group per source, and the landing page links each source.
  • rewriteDesignLinks regressions: fixed. Suffixes are kept, tree vs blob is chosen correctly, and images are left as they are. Covered by tests.
  • Untested paths: a gather test over temp dirs now covers the manifest, editUrl, a missing source and a designs mount. The fetchSources bare-repo test is deferred: the clone URL is hardcoded.
  • Lows: GIT_CONFIG_GLOBAL=/dev/null is set, dot-named repos are rejected, ref-gate:dist runs in the hook and CI, the README is fixed, and the direct github-slugger dependency is dropped.

Fixed in 9d61ffc. VM gate: 52 tests pass, and fetch + build + ref-gate:dist pass.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review round 2 (interdiff 66b8887..9d61ffc): 0 high, 1 medium, 2 low.

  • Medium, fetch clone paths untested: deferred to RIG-9686, which adds a baseUrl option and bare-repo tests. Linked in the body.
  • Low, meissa re-add is untracked: filed RIG-9685.
  • Low, frontmatter catch is silent: fixed in ebf2022. It now warns gather: unparsable frontmatter <repo>/<path>.

All-clear on ebf2022: the only change since the reviewed 9d61ffc is the one-line warning. The VM pre-push gate passed.

@mattwilkinsonn
mattwilkinsonn merged commit 9639305 into main Nov 12, 2026
2 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the web/rig-9139-bundle-public-repo-docs-at-build-time branch November 12, 2026 21:48
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.

2 participants