Skip to content

Make templates docs preview a minimal prebuilt build (fixes 15k-file upload cap) - #101

Merged
somacdivad merged 2 commits into
mainfrom
docs-preview-minimal-prebuilt
Aug 19, 2026
Merged

Make templates docs preview a minimal prebuilt build (fixes 15k-file upload cap)#101
somacdivad merged 2 commits into
mainfrom
docs-preview-minimal-prebuilt

Conversation

@somacdivad

@somacdivad somacdivad commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

�]633;E;printf 'Closes #91\n\n';b876e6c5-e170-48d7-983e-40b94debad4c��]633;C�Closes #91

Source and scope

The preview job on this repo's PRs has been failing repo-wide (tracked in #91) with:

Error: Invalid request: `files` should NOT have more than 15000 items, received 26660.
Try using `--archive=tgz` to limit the amount of files you upload.

The old step deployed through aldenquimby/deploy-to-vercel-action@v2, which uploads the entire relationalai-docs working directory as loose files. That set (the docs site, its node_modules, ~24.7k committed API-reference artifacts, and the synced templates) now exceeds Vercel's hard 15,000-file upload cap, so the deploy fails before it starts. The action exposes no way to pass Vercel's own --archive=tgz suggestion.

This PR reworks the templates docs preview to behave like the PyRel repo's docs preview (relationalai/pyrel.github/workflows/docs-preview.yml): build locally and upload a prebuilt tarball. It fully resolves #91 for this repo and makes the preview a minimal, templates-only build.

What changed

Rewrote .github/workflows/docs-preview.yml:

  • Prebuilt + archive upload: replaced the third-party action with the Vercel CLI directly — vercel build then vercel deploy --prebuilt --archive=tgz. Only the built output is uploaded, as a single tarball, so the file-count cap no longer applies.
  • Minimal build, no API reference: the build runs with PRIVATE=true, SKIP_API_ARTIFACTS=true (skip composing the committed Python/CLI API-reference artifacts), and IS_PYREL_PR=true (reuse the docs build's existing lever to skip generating the "latest" API reference). The templates gallery is the only thing the preview needs.
  • Templates-page comment: the PR comment links straight to …/build/templates.
  • Added the toolchain the local build needs (Node 22, Python 3.12, D2) and GitHub deployment-status reporting, mirroring PyRel.

Why

Before: every PR's preview was red because the loose-file upload exceeded Vercel's 15k cap, and the build also produced the full docs site (including all API reference) even though templates PRs only need the gallery.

After: the preview builds a minimal private site (no API reference), uploads a prebuilt tarball that stays well under the cap, and comments a link that lands the reviewer directly on the templates page.

Risks

  • Reused IS_PYREL_PR flag: this is the only existing docs-build lever that skips "latest" API-reference generation; using it here is functional but a misnomer. A follow-up could add a template-neutral flag (e.g. SKIP_LATEST_API_DOCS) to the relationalai-docs build.
  • Cannot be validated without the Vercel secrets, so it needs a live CI run on this PR to confirm the build/deploy succeed and the file-count error is gone.
  • The minimal build intentionally omits API-reference pages, so any in-site links to /api/... will 404 in the preview only. That's expected for a templates preview.
  • The local build runs on ubuntu-latest with NODE_OPTIONS=--max-old-space-size=6144; if the private build OOMs, the runner/heap may need bumping (PyRel uses a larger runner for its full build).

How to verify

  1. On this PR, watch the preview check: the Deploy Preview to Vercel step should complete without the files should NOT have more than 15000 items error.
  2. Confirm the bot comment links to <preview-url>/build/templates and that the page renders the templates gallery.
  3. Open the preview and confirm the templates content reflects this branch (the build syncs templates from RAI_TEMPLATES_REPO_BRANCH).
  4. Confirm API-reference pages are absent from the preview (expected for the minimal build).

Rework the templates docs preview to mirror the PyRel repo's docs preview:

- Build the docs site locally with the Vercel CLI (vercel build) and deploy
  the prebuilt output with 'vercel deploy --prebuilt --archive=tgz', replacing
  'aldenquimby/deploy-to-vercel-action@v2'. The tarball upload sidesteps
  Vercel's 15,000-file cap that was failing the previous source upload.
- Make it a minimal build with no API reference docs: PRIVATE=true,
  SKIP_API_ARTIFACTS=true (skip committed Python/CLI artifacts), and
  IS_PYREL_PR=true (reuse the docs build's lever to skip generating the
  'latest' API reference). Only the templates gallery is needed.
- Point the PR preview comment directly at /build/templates.

Refs #91.
The Vercel project install command runs 'uv venv --python 3.13 && uv pip
install .', so the runner needs uv on PATH. Replace the actions/setup-python
step with astral-sh/setup-uv (+ uv python install 3.13), matching PyRel.
Fixes 'uv: not found' (exit 127) during 'vercel build'.
@github-actions

Copy link
Copy Markdown

The templates docs preview for this pull request has been deployed to Vercel!

✅ Preview: https://relationalai-docs-5ejwlqleq-relationalai.vercel.app/build/templates
🔍 Inspect: https://vercel.com/relationalai/relationalai-docs/BTJMsAvVvL82B1akxs3QVRewQDMD

@somacdivad
somacdivad merged commit aed5506 into main Aug 19, 2026
1 check passed
@somacdivad
somacdivad deleted the docs-preview-minimal-prebuilt branch August 19, 2026 19:37
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.

Docs preview CI fails repo-wide: Vercel 15,000-file upload cap exceeded

1 participant