Skip to content

ci: publish preview fixtures to R2 instead of main - #225

Merged
ShulhaOleh merged 4 commits into
mainfrom
ci/preview-fixtures-r2
Nov 16, 2026
Merged

ShulhaOleh merged 4 commits into
mainfrom
ci/preview-fixtures-r2

Conversation

@ShulhaOleh

@ShulhaOleh ShulhaOleh commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

The browser preview's ModWorkshop snapshot no longer lives in git. The weekly refresh committed about ten thousand changed lines to main every Monday through a deploy key that bypassed the ruleset, for data that only a preview reads.

  • The 40 fixture files are removed and the directory is ignored.
  • apps/desktop/scripts/preview-fixtures.mts downloads the snapshot from https://index.modrex.net/preview/ using a manifest. dev-preview, build-preview, test:preview, test:renderer and typecheck:renderer run it first, since the preview loader is typechecked and one renderer test imports a fixture. CI and the Cloudflare build call those scripts by name and need no changes.
  • preview-fixtures.yml keeps its Monday schedule but now syncs the current snapshot down from R2, exports with PREVIEW_FIXTURES_DIR, verifies the export with the preview tests, uploads the files and the manifest, and POSTs the app preview deploy hook. The deploy key, the push to main and the retry loop are gone.
  • preview_fixtures.rs reads its output directory from PREVIEW_FIXTURES_DIR, with the old relative path as the local default. The news fallback follows it.

Rollout, already done: the preview-fixtures deploy hook exists on the modrex-app-preview Pages project and is stored as CLOUDFLARE_APP_PREVIEW_DEPLOY_HOOK_URL, and the workflow was dispatched once from this branch to seed the bucket.

Type of change

  • Bug fix
  • Feature
  • Improvement
  • Translation
  • Maintenance (CI, build, tooling, refactors)
  • Dependencies
  • Documentation only

Validation

  • Full local repository checks (bun checks)
  • Relevant local checks
  • CI only
  • Not applicable

Details: bun format:check, bun lint, desktop typecheck and cargo check pass. test:preview (107 tests) and test:renderer (714 tests) pass against the local snapshot with PREVIEW_FIXTURES_READY=1. No dependency changes.

The ModWorkshop snapshot behind the browser preview is published to R2
and fetched into an ignored directory before every preview build, dev
server and test run. The weekly refresh no longer churns main.
The refresh workflow syncs the current snapshot down, exports with
PREVIEW_FIXTURES_DIR, verifies it with the preview tests, uploads the
files and a manifest, and triggers the app preview rebuild. The deploy
key, the push to main and the retry loop are gone.
@ShulhaOleh ShulhaOleh added the maintenance CI, build, tooling, refactors, release plumbing label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deploying Modrex previews with  Cloudflare Pages  Cloudflare Pages

App preview:https://app-preview.modrex.net/pr/225
Site preview:https://site-preview.modrex.net/pr/225

View logs: app | site

The renderer typecheck covers the preview loader and BrowsePage.test.tsx
imports a fixture, so both need the snapshot on disk.
CI runs the root typecheck, which references the desktop tsconfig
directly and never goes through the desktop scripts.
@ShulhaOleh ShulhaOleh closed this Nov 16, 2026
@ShulhaOleh ShulhaOleh reopened this Nov 16, 2026
@ShulhaOleh
ShulhaOleh merged commit fbe63ce into main Nov 16, 2026
20 checks passed
@ShulhaOleh
ShulhaOleh deleted the ci/preview-fixtures-r2 branch November 16, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance CI, build, tooling, refactors, release plumbing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant