Repository navigation
ci: publish preview fixtures to R2 instead of main - #225
Merged
Merged
Conversation
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.
Contributor
Deploying Modrex previews with
|
| App preview: | https://app-preview.modrex.net/pr/225 |
| Site preview: | https://site-preview.modrex.net/pr/225 |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The browser preview's ModWorkshop snapshot no longer lives in git. The weekly refresh committed about ten thousand changed lines to
mainevery Monday through a deploy key that bypassed the ruleset, for data that only a preview reads.apps/desktop/scripts/preview-fixtures.mtsdownloads the snapshot fromhttps://index.modrex.net/preview/using a manifest.dev-preview,build-preview,test:preview,test:rendererandtypecheck:rendererrun 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.ymlkeeps its Monday schedule but now syncs the current snapshot down from R2, exports withPREVIEW_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 tomainand the retry loop are gone.preview_fixtures.rsreads its output directory fromPREVIEW_FIXTURES_DIR, with the old relative path as the local default. The news fallback follows it.Rollout, already done: the
preview-fixturesdeploy hook exists on themodrex-app-previewPages project and is stored asCLOUDFLARE_APP_PREVIEW_DEPLOY_HOOK_URL, and the workflow was dispatched once from this branch to seed the bucket.Type of change
Validation
bun checks)Details:
bun format:check,bun lint, desktoptypecheckandcargo checkpass.test:preview(107 tests) andtest:renderer(714 tests) pass against the local snapshot withPREVIEW_FIXTURES_READY=1. No dependency changes.